Пример #1
0
 protected void onNameTextBoxLostFocus(object sender, RoutedEventArgs e)
 {
     if (diagramEditor.designerCanvas.SelectionService.CurrentSelection.Count > 0)
     {
         var          designerItems = diagramEditor.designerCanvas.SelectionService.CurrentSelection.OfType <DesignerItem>();
         DesignerItem item          = designerItems.ElementAt(0);
         item.Editor.Text = nameTextBox.Text;
         item.ValidateEdition();
     }
 }
Пример #2
0
 protected void onNameTextChange(object sender, KeyEventArgs args)
 {
     if (diagramEditor.designerCanvas.SelectionService.CurrentSelection.Count > 0)
     {
         var          designerItems = diagramEditor.designerCanvas.SelectionService.CurrentSelection.OfType <DesignerItem>();
         DesignerItem item          = designerItems.ElementAt(0);
         if (args.Key == Key.Escape)
         {
             item.CancelEdition();
         }
         else if (args.Key == Key.Enter)
         {
             item.Editor.Text = nameTextBox.Text;
             item.ValidateEdition();
         }
     }
 }