From b41347f1528e5e34d8c8c8ef2c5b6b63876098f1 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 11 Apr 2019 16:07:21 +0300 Subject: added icons to menu, solution for setting icons dynamically to context menu --- .../Scripting/Tango.Scripting.IDE/SolutionItemCommand.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/Scripting/Tango.Scripting.IDE/SolutionItemCommand.cs') diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/SolutionItemCommand.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/SolutionItemCommand.cs index c6627d354..9fbac01c2 100644 --- a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/SolutionItemCommand.cs +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/SolutionItemCommand.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.ComponentModel; +using System.IO; using System.Linq; using System.Text; @@ -10,7 +12,7 @@ using Tango.Core.Commands; namespace Tango.Scripting.IDE { - public class SolutionItemCommand : RelayCommand, ISolutionItemCommand + public class SolutionItemCommand : RelayCommand, ISolutionItemCommand, INotifyPropertyChanged { public SolutionItemCommand() : base(()=> { }) { @@ -53,6 +55,9 @@ namespace Tango.Scripting.IDE public String Name { get; set; } BitmapSource _bImage; + + public event PropertyChangedEventHandler PropertyChanged; + public BitmapSource Image { get { @@ -61,9 +66,14 @@ namespace Tango.Scripting.IDE set { _bImage = value; + RaisePropertyChanged(nameof(Image)); } } public ObservableCollection Commands { get; set; } + protected virtual void RaisePropertyChanged(String propName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName)); + } } } -- cgit v1.3.1