public GatewayNode(CommunicationDriver data) { Gateway = data; this.Icon = "/Images/solution/gateway.png"; UpdateText(); this.ContextMenuItems.Add(new ContextMenuItem() { Text = "属性", ClickHandler = (s, e) => OnDoublicClick(s, null), }); }
protected override void OnDoublicClick(object sender, MouseButtonEventArgs e) { var data = this.Gateway.Clone <CommunicationDriver>(); Dialogs.GatewayDialog dialog = new Dialogs.GatewayDialog(data); dialog.Owner = MainWindow.Instance; dialog.Title = this.Text; if (dialog.ShowDialog() == true) { this.Gateway = dialog.Data; this.Gateway.ChangedProperties.Clear(); this.UpdateText(); } }