/// <summary> /// Called when [user preference changed]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="UserPreferenceChangedEventArgs"/> instance containing the event data.</param> private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e) { if (e.Category == UserPreferenceCategory.Desktop) { DesktopBackgroundChanged?.Invoke(this, new DesktopBackgroundChangedEventArgs() { OldBackground = "this", NewBackground = "that" }); } }
/// <summary> /// Called when [user preference changed]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="UserPreferenceChangedEventArgs"/> instance containing the event data.</param> private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e) { if (e.Category == UserPreferenceCategory.Desktop) { var currentBackground = GetDesktopBackgroundFilename(); DesktopBackgroundChanged?.Invoke(this, new DesktopBackgroundChangedEventArgs() { OldBackground = _previousBackground, NewBackground = currentBackground }); } }
/// <summary> /// Invokes the default window procedure associated with this window. /// </summary> /// <param name="m">A <see cref="T:System.Windows.Forms.Message" /> that is associated with the current Windows message.</param> protected override void WndProc(ref Message m) { if (m.Msg == WindowsConstants.UserPreferenceChanged) { DesktopBackgroundChanged?.Invoke(this, new DesktopBackgroundChangedEventArgs() { OldBackground = "boop", NewBackground = "beep" }); } base.WndProc(ref m); }