示例#1
0
 private static void OnEditShortName(object parameter)
 {
     if (SingleInstanceApplication.Instance != null)
     {
         var          mainWindow       = SingleInstanceApplication.Instance.MainWindow;
         ItemsControl itemsContainer   = mainWindow.FindChild <INTV.Shared.View.TreeListView>(t => t.Name == "_menuLayout");
         var          viewModel        = parameter as MenuLayoutViewModel;
         var          currentSelection = viewModel.CurrentSelection;
         if ((currentSelection != null) && (itemsContainer != null))
         {
             var containerOfCurrentSelection = FindVisualContainerForViewModel(itemsContainer, viewModel, currentSelection);
             InPlaceEditBehavior.BeginInPlaceEdit(itemsContainer, containerOfCurrentSelection, currentSelection, (v) => v.FindChild <TextBlock>(t => t.Name == "ShortName"));
         }
     }
 }
 /// <summary>
 /// Function used to register the factory for this editor.
 /// </summary>
 /// <returns><c>true</c> if the factory was registered.</returns>
 public static bool RegisterInPlaceEditor()
 {
     return(InPlaceEditBehavior.RegisterInPlaceEditorFactory(InPlaceEditorType, GetTextBlockEditorAdorner));
 }