using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media.Imaging; using Tango.Core.Commands; namespace Tango.Scripting.IDE { public class SolutionItemCommand : RelayCommand, ISolutionItemCommand, INotifyPropertyChanged { public SolutionItemCommand() : base(()=> { }) { Init(); } public SolutionItemCommand(Action action) : base(action) { Init(); } public SolutionItemCommand(Action action) : base(action) { Init(); } public SolutionItemCommand(Action action, Func canExecute) : base(action, canExecute) { Init(); } public SolutionItemCommand(Action action, Func canExecute) : base(action, canExecute) { Init(); } public SolutionItemCommand(Action action, Func canExecute) : base(action, canExecute) { Init(); } public SolutionItemCommand(Action action, Func canExecute) : base(action, canExecute) { Init(); } private void Init() { Commands = new ObservableCollection(); } public String Name { get; set; } BitmapSource _bImage; public event PropertyChangedEventHandler PropertyChanged; public BitmapSource Image { get { return _bImage; } set { _bImage = value; RaisePropertyChanged(nameof(Image)); } } public ObservableCollection Commands { get; set; } protected virtual void RaisePropertyChanged(String propName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName)); } } }