public ViewPresenter() { base.IsVisibleChanged += new DependencyPropertyChangedEventHandler(this.OnIsVisibleChanged); UtilityMethods.AddPresentationSourceCleanupAction(this, () => { base.Content = null; if (this.currentFocusScope != null) { FocusManager.SetFocusedElement(this.currentFocusScope, null); } }); }
public GroupControl() { this.Loaded += (RoutedEventHandler) delegate { this.ClearValue(Selector.SelectedItemProperty); }; UtilityMethods.AddPresentationSourceCleanupAction((UIElement)this, (Action)(() => { BindingOperations.SetBinding((DependencyObject)this, Selector.SelectedItemProperty, (BindingBase) new Binding() { Mode = BindingMode.OneTime }); BindingOperations.SetBinding((DependencyObject)this, ItemsControl.ItemsSourceProperty, (BindingBase) new Binding() { Mode = BindingMode.OneTime }); this.DataContext = (object)null; })); }