private static void _OnTaskbarItemInfoChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(d))
            {
                return;
            }
            Window          window           = (Window)d;
            TaskbarItemInfo taskbarItemInfo  = (TaskbarItemInfo)e.OldValue;
            TaskbarItemInfo taskbarItemInfo2 = (TaskbarItemInfo)e.NewValue;

            if (taskbarItemInfo == taskbarItemInfo2)
            {
                return;
            }
            if (!Utility.IsOSWindows7OrNewer)
            {
                return;
            }
            if (taskbarItemInfo != null && taskbarItemInfo._window != null)
            {
                taskbarItemInfo._DetachWindow();
            }
            if (taskbarItemInfo2 != null)
            {
                taskbarItemInfo2._SetWindow(window);
            }
        }
        private static object _CoerceTaskbarItemInfoValue(DependencyObject d, object value)
        {
            if (DesignerProperties.GetIsInDesignMode(d))
            {
                return(value);
            }
            Verify.IsNotNull <DependencyObject>(d, "d");
            Window          window          = (Window)d;
            TaskbarItemInfo taskbarItemInfo = (TaskbarItemInfo)value;

            if (taskbarItemInfo != null && taskbarItemInfo._window != null && taskbarItemInfo._window != window)
            {
                throw new NotSupportedException();
            }
            window.VerifyAccess();
            return(taskbarItemInfo);
        }
 public static void SetTaskbarItemInfo(Window window, TaskbarItemInfo value)
 {
     Verify.IsNotNull <Window>(window, "window");
     window.SetValue(TaskbarItemInfo.TaskbarItemInfoProperty, value);
 }