private void EnsureSynchronisationRootExists() { if (this.synchronisationRoot == null) { this.synchronisationRoot = new PanelSynchronisationRoot(); this.synchronisationRoot.AddMember(this); } }
private static void OnPrivateSynchronisationRootPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) { DialogPanel Panel = (DialogPanel)dependencyObject; PanelSynchronisationRoot SynchronisationRoot = (PanelSynchronisationRoot)e.NewValue; if (Panel.synchronisationRoot != null) { // if definition is already registered And shared size scope is changing, // then un-register the definition from the current shared size state object. Panel.synchronisationRoot.RemoveMember(Panel); Panel.synchronisationRoot = null; } if ((Panel.synchronisationRoot == null) && (SynchronisationRoot != null)) { // if definition is not registered and both: shared size group id AND private shared scope // are available, then register definition. Panel.synchronisationRoot = SynchronisationRoot; Panel.synchronisationRoot.AddMember(Panel); } }