MVVM-后台代码绑定事件命令

  InvokeCommandAction ic = new InvokeCommandAction();
                    ic.Command = ((GISMapViewModel)(this.DataContext)).NavigtedToImageMapCommand;//绑定的命令
                    //ic.CommandParameter = treeView;
                    System.Windows.Interactivity.EventTrigger et = new System.Windows.Interactivity.EventTrigger();
                    et.EventName = "MouseLeftButtonDown";
                    et.Actions.Add(ic);
                    System.Windows.Interactivity.TriggerCollection tc = Interaction.GetTriggers(currentMarker.Shape);
                    tc.Add(et);

 

posted @ 2020-07-22 08:05  当年小清新  阅读(270)  评论(0编辑  收藏  举报