public Context() { removeCommand = new RelayCommand(o => { if (SelectedItem != null) { findItemAndRemoveRecursively(Items, SelectedItem); } }, o => { return SelectedItem != null; }); expandCollapseCommand = new RelayCommand(o => { if (SelectedItem != null) { SelectedItem.Expanded = !SelectedItem.Expanded; } }, o => SelectedItem != null); changeTitleCommand = new RelayCommand( o => { if ( SelectedItem != null ) { SelectedItem.Title = "Changed title"; } }, o => SelectedItem != null ); }
public DataContext( ) { command = new RelayCommand( parameter => MessageBox.Show( "Information", "Command executed !", result => { } ), parameter => true ); }