static void OnAlwaysOnBottomChanged(object sender, DependencyPropertyChangedEventArgs e) { var Window = sender as Window; if (Window != null) { if ((bool)e.NewValue) { var Sinker = new WindowSinker(Window); Sinker.Sink(); SetSinker(Window, Sinker); } else { var Sinker = GetSinker(Window); Sinker.Unsink(); SetSinker(Window, null); } } }
public static void SetSinker(DependencyObject obj, WindowSinker value) { obj.SetValue(SinkerProperty, value); }