src/Misc/EFTools/EntityDesign/UI/Views/MappingDetails/MappingDetailsWindow.cs
// <summary>
//     Does the work of actually showing the view model in the Trid.
// </summary>
Does the work of actually showing the view model in the Trid.
Does the work of actually showing the view model in the Trid .
private void DoShowMappingDetailsForElement(EFElement element)
        {
            Debug.Assert(element != null, "A null element was passed to DoShowMappingDetailsForElement()");
            if (element != null)
            {
                var xref = Context.Items.GetValue<ModelToMappingModelXRef>();
                var mappingElement = xref.GetExisting(element);
                Debug.Assert(mappingElement != null, "Failed to get ViewModel element for the passed in Model element");
                if (mappingElement != null)
                {
                    TreeControl.BatchDrawItem = true;
                    try
                    {
                        var invalidate = DoSelectionChanged(mappingElement);
                        if (invalidate)
                        {
                            var tree = TreeProvider;
                            var rootBranch = tree.Root;
                            if (rootBranch != null
                                && !WatermarkVisible)
                            {
                                for (var i = 0; i < tree.VisibleItemCount; i++)
                                {
                                    if (tree.IsExpandable(i, 0)
                                        && !tree.IsExpanded(i, 0))
                                    {
                                        tree.ToggleExpansion(i, 0);
                                    }
                                }
                                TreeControl.CurrentIndex = 0;
                                UpdateTitleBar(mappingElement.Name);
                            }
                        }
                        if (WatermarkVisible && invalidate)
                        {
                            UpdateTitleBar(null);
                        }
                    }
                    finally
                    {
                        TreeControl.BatchDrawItem = false;
                    }
                }
            }
        }
private void DoShowMappingDetailsForElement ( EFElement element ) { Debug . Assert ( element != null , " " ) ; if ( element != null ) { var xref = Context . Items . GetValue < ModelToMappingModelXRef > ( ) ; var mappingElement = xref . GetExisting ( element ) ; Debug . Assert ( mappingElement != null , " " ) ; if ( mappingElement != null ) { TreeControl . BatchDrawItem = true ; try { var invalidate = DoSelectionChanged ( mappingElement ) ; if ( invalidate ) { var tree = TreeProvider ; var rootBranch = tree . Root ; if ( rootBranch != null && ! WatermarkVisible ) { for ( var i = 0 ; i < tree . VisibleItemCount ; i ++ ) { if ( tree . IsExpandable ( i , 0 ) && ! tree . IsExpanded ( i , 0 ) ) { tree . ToggleExpansion ( i , 0 ) ; } } TreeControl . CurrentIndex = 0 ; UpdateTitleBar ( mappingElement . Name ) ; } } if ( WatermarkVisible && invalidate ) { UpdateTitleBar ( null ) ; } } finally { TreeControl . BatchDrawItem = false ; } } } }
Does the work of actually showing the view model in the Trid.
Does the work of actually showing the view model in the Trid .
// local shortcuts // expand all nodes // scroll tree to top // if the watermark is showing and selection changed, update the title bar
element
EFElement