private void HookUpEvents() { Click -= EyedropperToolButton_Click; Click += EyedropperToolButton_Click; Unloaded -= EyedropperToolButton_Unloaded; Unloaded += EyedropperToolButton_Unloaded; ThemeManager.RemoveActualThemeChangedHandler(this, EyedropperToolButton_ActualThemeChanged); ThemeManager.AddActualThemeChangedHandler(this, EyedropperToolButton_ActualThemeChanged); _eyedropper.ColorChanged -= Eyedropper_ColorChanged; _eyedropper.ColorChanged += Eyedropper_ColorChanged; _eyedropper.PickStarted -= Eyedropper_PickStarted; _eyedropper.PickStarted += Eyedropper_PickStarted; _eyedropper.PickCompleted -= Eyedropper_PickCompleted; _eyedropper.PickCompleted += Eyedropper_PickCompleted; }
private void OnLoaded(object sender, RoutedEventArgs e) { HookListeners(); ThemeManager.AddActualThemeChangedHandler(this, OnActualThemeChanged); // Register for property callbacks that are owned by our parent class. _fontSizePropertyToken = this.RegisterPropertyChangedCallback(FontSizeProperty, OnPropertyChanged); _flowDirectionPropertyToken = this.RegisterPropertyChangedCallback(FlowDirectionProperty, OnPropertyChanged); _backgroundPropertyToken = this.RegisterPropertyChangedCallback(BackgroundProperty, OnPropertyChanged); _borderBrushPropertyToken = this.RegisterPropertyChangedCallback(BorderBrushProperty, OnPropertyChanged); _borderThicknessPropertyToken = this.RegisterPropertyChangedCallback(BorderThicknessProperty, OnPropertyChanged); _fontFamilyPropertyToken = this.RegisterPropertyChangedCallback(FontFamilyProperty, OnPropertyChanged); _fontStretchPropertyToken = this.RegisterPropertyChangedCallback(FontStretchProperty, OnPropertyChanged); _fontStylePropertyToken = this.RegisterPropertyChangedCallback(FontStyleProperty, OnPropertyChanged); _fontWeightPropertyToken = this.RegisterPropertyChangedCallback(FontWeightProperty, OnPropertyChanged); _foregroundPropertyToken = this.RegisterPropertyChangedCallback(ForegroundProperty, OnPropertyChanged); _paddingPropertyToken = this.RegisterPropertyChangedCallback(PaddingProperty, OnPropertyChanged); }
public ThreadedVisualHost() { DataContextChanged += OnDataContextChanged; ThemeManager.AddActualThemeChangedHandler(this, OnActualThemeChanged); }