Exemplo n.º 1
0
        /// <summary>
        /// Handles the Loaded event of this control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void This_Loaded(object sender, RoutedEventArgs e)
        {
            if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this))
            {
                this.NodeViewer = LayoutHelper.FindLogicalParent <UcNodeViewer>(this, true);
                if (this.NodeViewer == null)
                {
                    this.NodeViewer = LayoutHelper.FindVisualParent <UcNodeViewer>(this, true);
                }

                if (this.NodeViewer != null && !this.IsPreview)
                {
                    this.treeDesigner = LayoutHelper.FindLogicalParent <UcTreeDesigner>(this.NodeViewer, true);
                    if (this.treeDesigner != null)
                    {
                        this.treeDesigner.RegisterIOHandle(this);

                        DisposablesHandler.Instance.AddDisposeConnection(this,
                                                                         PropertyChangedHandle.GetDistinctInstance(this.treeDesigner, "ConnectingIOHandle", this.OnTreeDesignerConnectingIOHandleChanged));
                    }

                    DisposablesHandler.Instance.AddDisposeConnection(this,
                                                                     PropertyChangedHandle.GetDistinctInstance(this.NodeViewer, "IsSelected", this.OnNodeViewerIsSelectedChanged));
                }
            }
            LoadedCompletely = true;
        }
Exemplo n.º 2
0
 private void OnDefferingPropertyChangeOcurred(PropertyChangedCallbackArgs args)
 {
     if (this.deferringPropertyChangeCallback == null || this.deferringPropertyChangeCallback(args))
     {
         args.Handle.Dispose();
         this.deferringPropertyChangeHandle   = null;
         this.deferringPropertyChangeCallback = null;
         this.InitializeAfterDeferrence();
     }
 }
Exemplo n.º 3
0
        public void DeferInitialization(Binding binding, Func <PropertyChangedCallbackArgs, bool> deferringPropertyChangeCallback = null)
        {
            if (binding == null)
            {
                throw new ArgumentNullException("binding");
            }

            if (!(this.initialized || this.initializationDeferred))
            {
                this.initializationDeferred          = true;
                this.deferringPropertyChangeCallback = deferringPropertyChangeCallback;
                this.deferringPropertyChangeHandle   = PropertyChangedHandle.GetDistinctInstance(binding, this.OnDefferingPropertyChangeOcurred);
            }
        }