internal void OnDropDownLoaded(object sender, RoutedEventArgs e) { var searchTextBox = ExplorerUtility.GetTypeDescendents(SearchBox, typeof(TextBox)).FirstOrDefault() as TextBox; if (searchTextBox != null) { searchTextBox.MaxLength = 1000; } }
public void ExecutePutInRenameMode() { var selectedExplorerEFElement = GetSelectedExplorerEFElement(); if (selectedExplorerEFElement != null) { var treeViewItem = GetTreeViewItem(selectedExplorerEFElement, false); if (treeViewItem != null) { var editableContentControl = ExplorerUtility.GetTypeDescendents(treeViewItem, typeof(EditableContentControl)).FirstOrDefault() as EditableContentControl; if (editableContentControl != null) { // put the EditableContentControl into edit mode so user can change the name editableContentControl.IsInEditMode = true; } } } }
internal void PutElementInRenameMode(ExplorerEFElement explorerElement) { Debug.Assert(explorerElement != null, "explorerElement must not be null"); if (explorerElement != null) { // if ExplorerElement.IsEditableInline is false then there will be no EditableContentControl to find Debug.Assert( explorerElement.IsEditableInline, "explorerElement.IsEditableInline should be true but was false. ExplorerElement has name " + explorerElement.Name + " and type " + explorerElement.GetType().FullName); if (explorerElement.IsEditableInline) { var treeViewItem = GetTreeViewItem(explorerElement, false); Debug.Assert(treeViewItem != null, "Could not find TreeViewItem for Explorer element named " + explorerElement.Name); if (treeViewItem != null) { // Note: if the ItemContainerGenerator status is NotStarted, the UI Element is not created yet. // This causes ExplorerUtility.GetTypeDescendents() call to return null. if (treeViewItem.ItemContainerGenerator.Status == GeneratorStatus.NotStarted) { treeViewItem.UpdateLayout(); } var editableContentControl = ExplorerUtility.GetTypeDescendents(treeViewItem, typeof(EditableContentControl)).FirstOrDefault() as EditableContentControl; Debug.Assert( null != editableContentControl, "Could not find EditableContentControl for Explorer element named " + explorerElement.Name); if (null != editableContentControl) { // put the EditableContentControl into edit mode so user can change the name editableContentControl.IsInEditMode = true; } } } } }