示例#1
0
        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);
            }
        }
示例#2
0
        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);
        }
 private static void _OnTaskbarItemInfoChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     if (!DesignerProperties.GetIsInDesignMode(d))
     {
         Window          window   = (Window)d;
         TaskbarItemInfo oldValue = (TaskbarItemInfo)e.OldValue;
         TaskbarItemInfo newValue = (TaskbarItemInfo)e.NewValue;
         if ((oldValue != newValue) && Standard.Utility.IsOSWindows7OrNewer)
         {
             if ((oldValue != null) && (oldValue._window != null))
             {
                 oldValue._DetachWindow();
             }
             if (newValue != null)
             {
                 newValue._SetWindow(window);
             }
         }
     }
 }
示例#4
0
 public static void SetTaskbarItemInfo(Window window, TaskbarItemInfo value)
 {
     Verify.IsNotNull <Window>(window, "window");
     window.SetValue(TaskbarItemInfo.TaskbarItemInfoProperty, value);
 }
示例#5
0
 public static void SetTaskbarItemInfo(Window window, TaskbarItemInfo value)
 {
     Verify.IsNotNull(window, "window");
     window.SetValue(TaskbarItemInfoProperty, value);
 }