private DelegateCommand<object> _GuncelleCommand; public ICommand GuncelleCommand { get { if (_GuncelleCommand == null) { _GuncelleCommand = new DelegateCommand<object>(new Action<object>(this.BelgeGuncelle), new Func<bool>(() => this.IsGuncellemeTrue)); } return _GuncelleCommand; } } public bool IsGuncellemeTrue { get { return true; } }
and
public void BelgeGuncelle(object parameter) { MessageBox.Show("Test"); }
How Can I use with the following Treeviewitem of thepart DelegateCommand;
<TreeView.ItemContainerStyle><Style TargetType="{x:Type TreeViewItem}"><EventSetter Event="UIElement.PreviewMouseLeftButtonDown" Handler="SelectedTreeView"/><Style.Triggers><Trigger Property="IsSelected" Value="True"><Setter Property="IsExpanded" Value="False"/><Setter Property="FontWeight" Value="Bold"/><Setter Property="FontStyle" Value="Italic"/><Setter Property="Foreground" Value="Red"/></Trigger></Style.Triggers></Style></TreeView.ItemContainerStyle>Thanks;