CHG Added missing designer attributes to some properties. Reformatted code.

(NTFY-21)

git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@181 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
Philipp Sumi
2013-11-17 14:17:40 +00:00
parent c261d99378
commit 6d505b1580

View File

@@ -22,7 +22,6 @@
// THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE // THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Drawing; using System.Drawing;
@@ -55,7 +54,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// TrayPopupResolved Read-Only Dependency Property /// TrayPopupResolved Read-Only Dependency Property
/// </summary> /// </summary>
private static readonly DependencyPropertyKey TrayPopupResolvedPropertyKey private static readonly DependencyPropertyKey TrayPopupResolvedPropertyKey
= DependencyProperty.RegisterReadOnly("TrayPopupResolved", typeof(Popup), typeof(TaskbarIcon), = DependencyProperty.RegisterReadOnly("TrayPopupResolved", typeof (Popup), typeof (TaskbarIcon),
new FrameworkPropertyMetadata(null)); new FrameworkPropertyMetadata(null));
@@ -76,7 +75,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
[Category(CategoryName)] [Category(CategoryName)]
public Popup TrayPopupResolved public Popup TrayPopupResolved
{ {
get { return (Popup)GetValue(TrayPopupResolvedProperty); } get { return (Popup) GetValue(TrayPopupResolvedProperty); }
} }
/// <summary> /// <summary>
@@ -97,8 +96,8 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// TrayToolTipResolved Read-Only Dependency Property /// TrayToolTipResolved Read-Only Dependency Property
/// </summary> /// </summary>
private static readonly DependencyPropertyKey TrayToolTipResolvedPropertyKey private static readonly DependencyPropertyKey TrayToolTipResolvedPropertyKey
= DependencyProperty.RegisterReadOnly("TrayToolTipResolved", typeof(ToolTip), typeof(TaskbarIcon), = DependencyProperty.RegisterReadOnly("TrayToolTipResolved", typeof (ToolTip), typeof (TaskbarIcon),
new FrameworkPropertyMetadata(null )); new FrameworkPropertyMetadata(null));
/// <summary> /// <summary>
@@ -119,7 +118,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
[Bindable(true)] [Bindable(true)]
public ToolTip TrayToolTipResolved public ToolTip TrayToolTipResolved
{ {
get { return (ToolTip)GetValue(TrayToolTipResolvedProperty); } get { return (ToolTip) GetValue(TrayToolTipResolvedProperty); }
} }
/// <summary> /// <summary>
@@ -140,7 +139,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// CustomBalloon Read-Only Dependency Property /// CustomBalloon Read-Only Dependency Property
/// </summary> /// </summary>
private static readonly DependencyPropertyKey CustomBalloonPropertyKey private static readonly DependencyPropertyKey CustomBalloonPropertyKey
= DependencyProperty.RegisterReadOnly("CustomBalloon", typeof(Popup), typeof(TaskbarIcon), = DependencyProperty.RegisterReadOnly("CustomBalloon", typeof (Popup), typeof (TaskbarIcon),
new FrameworkPropertyMetadata(null)); new FrameworkPropertyMetadata(null));
public static readonly DependencyProperty CustomBalloonProperty public static readonly DependencyProperty CustomBalloonProperty
@@ -152,7 +151,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// </summary> /// </summary>
public Popup CustomBalloon public Popup CustomBalloon
{ {
get { return (Popup)GetValue(CustomBalloonProperty); } get { return (Popup) GetValue(CustomBalloonProperty); }
} }
/// <summary> /// <summary>
@@ -166,8 +165,6 @@ namespace Hardcodet.Wpf.TaskbarNotification
#endregion #endregion
//DEPENDENCY PROPERTIES //DEPENDENCY PROPERTIES
#region Icon property / IconSource dependency property #region Icon property / IconSource dependency property
@@ -199,8 +196,8 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// </summary> /// </summary>
public static readonly DependencyProperty IconSourceProperty = public static readonly DependencyProperty IconSourceProperty =
DependencyProperty.Register("IconSource", DependencyProperty.Register("IconSource",
typeof(ImageSource), typeof (ImageSource),
typeof(TaskbarIcon), typeof (TaskbarIcon),
new FrameworkPropertyMetadata(null, IconSourcePropertyChanged)); new FrameworkPropertyMetadata(null, IconSourcePropertyChanged));
/// <summary> /// <summary>
@@ -212,7 +209,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
[Description("Sets the displayed taskbar icon.")] [Description("Sets the displayed taskbar icon.")]
public ImageSource IconSource public ImageSource IconSource
{ {
get { return (ImageSource)GetValue(IconSourceProperty); } get { return (ImageSource) GetValue(IconSourceProperty); }
set { SetValue(IconSourceProperty, value); } set { SetValue(IconSourceProperty, value); }
} }
@@ -227,7 +224,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// <param name="e">Provides information about the updated property.</param> /// <param name="e">Provides information about the updated property.</param>
private static void IconSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void IconSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
TaskbarIcon owner = (TaskbarIcon)d; TaskbarIcon owner = (TaskbarIcon) d;
owner.OnIconSourcePropertyChanged(e); owner.OnIconSourcePropertyChanged(e);
} }
@@ -237,11 +234,11 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// WPF internally uses the dependency property system and bypasses the /// WPF internally uses the dependency property system and bypasses the
/// <see cref="IconSource"/> property wrapper, updates of the property's value /// <see cref="IconSource"/> property wrapper, updates of the property's value
/// should be handled here. /// should be handled here.
/// </summary /// </summary>
/// <param name="e">Provides information about the updated property.</param> /// <param name="e">Provides information about the updated property.</param>
private void OnIconSourcePropertyChanged(DependencyPropertyChangedEventArgs e) private void OnIconSourcePropertyChanged(DependencyPropertyChangedEventArgs e)
{ {
ImageSource newValue = (ImageSource)e.NewValue; ImageSource newValue = (ImageSource) e.NewValue;
//resolving the ImageSource at design time is unlikely to work //resolving the ImageSource at design time is unlikely to work
if (!Util.IsDesignMode) Icon = newValue.ToIcon(); if (!Util.IsDesignMode) Icon = newValue.ToIcon();
@@ -297,7 +294,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// WPF internally uses the dependency property system and bypasses the /// WPF internally uses the dependency property system and bypasses the
/// <see cref="ToolTipText"/> property wrapper, updates of the property's value /// <see cref="ToolTipText"/> property wrapper, updates of the property's value
/// should be handled here. /// should be handled here.
/// </summary /// </summary>
/// <param name="e">Provides information about the updated property.</param> /// <param name="e">Provides information about the updated property.</param>
private void OnToolTipTextPropertyChanged(DependencyPropertyChangedEventArgs e) private void OnToolTipTextPropertyChanged(DependencyPropertyChangedEventArgs e)
{ {
@@ -361,7 +358,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// WPF internally uses the dependency property system and bypasses the /// WPF internally uses the dependency property system and bypasses the
/// <see cref="TrayToolTip"/> property wrapper, updates of the property's value /// <see cref="TrayToolTip"/> property wrapper, updates of the property's value
/// should be handled here. /// should be handled here.
/// </summary /// </summary>
/// <param name="e">Provides information about the updated property.</param> /// <param name="e">Provides information about the updated property.</param>
private void OnTrayToolTipPropertyChanged(DependencyPropertyChangedEventArgs e) private void OnTrayToolTipPropertyChanged(DependencyPropertyChangedEventArgs e)
{ {
@@ -397,7 +394,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// </summary> /// </summary>
public static readonly DependencyProperty TrayPopupProperty = public static readonly DependencyProperty TrayPopupProperty =
DependencyProperty.Register("TrayPopup", DependencyProperty.Register("TrayPopup",
typeof(UIElement), typeof (UIElement),
typeof (TaskbarIcon), typeof (TaskbarIcon),
new FrameworkPropertyMetadata(null, TrayPopupPropertyChanged)); new FrameworkPropertyMetadata(null, TrayPopupPropertyChanged));
@@ -410,7 +407,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
[Description("Displayed as a Popup if the user clicks on the taskbar icon.")] [Description("Displayed as a Popup if the user clicks on the taskbar icon.")]
public UIElement TrayPopup public UIElement TrayPopup
{ {
get { return (UIElement)GetValue(TrayPopupProperty); } get { return (UIElement) GetValue(TrayPopupProperty); }
set { SetValue(TrayPopupProperty, value); } set { SetValue(TrayPopupProperty, value); }
} }
@@ -435,21 +432,21 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// WPF internally uses the dependency property system and bypasses the /// WPF internally uses the dependency property system and bypasses the
/// <see cref="TrayPopup"/> property wrapper, updates of the property's value /// <see cref="TrayPopup"/> property wrapper, updates of the property's value
/// should be handled here. /// should be handled here.
/// </summary /// </summary>
/// <param name="e">Provides information about the updated property.</param> /// <param name="e">Provides information about the updated property.</param>
private void OnTrayPopupPropertyChanged(DependencyPropertyChangedEventArgs e) private void OnTrayPopupPropertyChanged(DependencyPropertyChangedEventArgs e)
{ {
if (e.OldValue != null) if (e.OldValue != null)
{ {
//remove the taskbar icon reference from the previously used element //remove the taskbar icon reference from the previously used element
SetParentTaskbarIcon((DependencyObject)e.OldValue, null); SetParentTaskbarIcon((DependencyObject) e.OldValue, null);
} }
if (e.NewValue != null) if (e.NewValue != null)
{ {
//set this taskbar icon as a reference to the new tooltip element //set this taskbar icon as a reference to the new tooltip element
SetParentTaskbarIcon((DependencyObject)e.NewValue, this); SetParentTaskbarIcon((DependencyObject) e.NewValue, this);
} }
//create a pop //create a pop
@@ -458,7 +455,6 @@ namespace Hardcodet.Wpf.TaskbarNotification
#endregion #endregion
#region MenuActivation dependency property #region MenuActivation dependency property
/// <summary> /// <summary>
@@ -515,7 +511,6 @@ namespace Hardcodet.Wpf.TaskbarNotification
#endregion #endregion
#region Visibility dependency property override #region Visibility dependency property override
/// <summary> /// <summary>
@@ -538,7 +533,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// WPF internally uses the dependency property system and bypasses the /// WPF internally uses the dependency property system and bypasses the
/// <see cref="Visibility"/> property wrapper, updates of the property's value /// <see cref="Visibility"/> property wrapper, updates of the property's value
/// should be handled here. /// should be handled here.
/// </summary /// </summary>
/// <param name="e">Provides information about the updated property.</param> /// <param name="e">Provides information about the updated property.</param>
private void OnVisibilityPropertyChanged(DependencyPropertyChangedEventArgs e) private void OnVisibilityPropertyChanged(DependencyPropertyChangedEventArgs e)
{ {
@@ -602,7 +597,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// WPF internally uses the dependency property system and bypasses the /// WPF internally uses the dependency property system and bypasses the
/// <see cref="FrameworkElement.DataContext"/> property wrapper, updates of the property's value /// <see cref="FrameworkElement.DataContext"/> property wrapper, updates of the property's value
/// should be handled here. /// should be handled here.
/// </summary /// </summary>
/// <param name="e">Provides information about the updated property.</param> /// <param name="e">Provides information about the updated property.</param>
private void OnDataContextPropertyChanged(DependencyPropertyChangedEventArgs e) private void OnDataContextPropertyChanged(DependencyPropertyChangedEventArgs e)
{ {
@@ -630,7 +625,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// <param name="e">Provides information about the updated property.</param> /// <param name="e">Provides information about the updated property.</param>
private static void ContextMenuPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void ContextMenuPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
TaskbarIcon owner = (TaskbarIcon)d; TaskbarIcon owner = (TaskbarIcon) d;
owner.OnContextMenuPropertyChanged(e); owner.OnContextMenuPropertyChanged(e);
} }
@@ -646,13 +641,13 @@ namespace Hardcodet.Wpf.TaskbarNotification
if (e.OldValue != null) if (e.OldValue != null)
{ {
//remove the taskbar icon reference from the previously used element //remove the taskbar icon reference from the previously used element
SetParentTaskbarIcon((DependencyObject)e.OldValue, null); SetParentTaskbarIcon((DependencyObject) e.OldValue, null);
} }
if (e.NewValue != null) if (e.NewValue != null)
{ {
//set this taskbar icon as a reference to the new tooltip element //set this taskbar icon as a reference to the new tooltip element
SetParentTaskbarIcon((DependencyObject)e.NewValue, this); SetParentTaskbarIcon((DependencyObject) e.NewValue, this);
} }
UpdateDataContext((ContextMenu) e.NewValue, null, DataContext); UpdateDataContext((ContextMenu) e.NewValue, null, DataContext);
@@ -660,8 +655,6 @@ namespace Hardcodet.Wpf.TaskbarNotification
#endregion #endregion
#region DoubleClickCommand dependency property #region DoubleClickCommand dependency property
/// <summary> /// <summary>
@@ -680,6 +673,8 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// Associates a command that is being executed if the tray icon is being /// Associates a command that is being executed if the tray icon is being
/// double clicked. /// double clicked.
/// </summary> /// </summary>
[Category(CategoryName)]
[Description("A command that is being executed if the tray icon is being double-clicked.")]
public ICommand DoubleClickCommand public ICommand DoubleClickCommand
{ {
get { return (ICommand) GetValue(DoubleClickCommandProperty); } get { return (ICommand) GetValue(DoubleClickCommandProperty); }
@@ -704,6 +699,8 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// dependency property:<br/> /// dependency property:<br/>
/// Command parameter for the <see cref="DoubleClickCommand"/>. /// Command parameter for the <see cref="DoubleClickCommand"/>.
/// </summary> /// </summary>
[Category(CategoryName)]
[Description("Parameter to submit to the DoubleClickCommand when the user double clicks on the NotifyIcon.")]
public object DoubleClickCommandParameter public object DoubleClickCommandParameter
{ {
get { return GetValue(DoubleClickCommandParameterProperty); } get { return GetValue(DoubleClickCommandParameterProperty); }
@@ -728,6 +725,8 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// dependency property:<br/> /// dependency property:<br/>
/// The target of the command that is fired if the notify icon is double clicked. /// The target of the command that is fired if the notify icon is double clicked.
/// </summary> /// </summary>
[Category(CategoryName)]
[Description("The target of the command that is fired if the notify icon is double clicked.")]
public IInputElement DoubleClickCommandTarget public IInputElement DoubleClickCommandTarget
{ {
get { return (IInputElement) GetValue(DoubleClickCommandTargetProperty); } get { return (IInputElement) GetValue(DoubleClickCommandTargetProperty); }
@@ -736,8 +735,6 @@ namespace Hardcodet.Wpf.TaskbarNotification
#endregion #endregion
#region LeftClickCommand dependency property #region LeftClickCommand dependency property
/// <summary> /// <summary>
@@ -754,8 +751,10 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// A property wrapper for the <see cref="LeftClickCommandProperty"/> /// A property wrapper for the <see cref="LeftClickCommandProperty"/>
/// dependency property:<br/> /// dependency property:<br/>
/// Associates a command that is being executed if the tray icon is being /// Associates a command that is being executed if the tray icon is being
/// double clicked. /// left-clicked.
/// </summary> /// </summary>
[Category(CategoryName)]
[Description("A command that is being executed if the tray icon is being left-clicked.")]
public ICommand LeftClickCommand public ICommand LeftClickCommand
{ {
get { return (ICommand) GetValue(LeftClickCommandProperty); } get { return (ICommand) GetValue(LeftClickCommandProperty); }
@@ -780,6 +779,9 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// dependency property:<br/> /// dependency property:<br/>
/// Command parameter for the <see cref="LeftClickCommand"/>. /// Command parameter for the <see cref="LeftClickCommand"/>.
/// </summary> /// </summary>
[Category(CategoryName)]
[Description("The target of the command that is fired if the notify icon is clicked with the left mouse button."
)]
public object LeftClickCommandParameter public object LeftClickCommandParameter
{ {
get { return GetValue(LeftClickCommandParameterProperty); } get { return GetValue(LeftClickCommandParameterProperty); }
@@ -804,6 +806,9 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// dependency property:<br/> /// dependency property:<br/>
/// The target of the command that is fired if the notify icon is clicked. /// The target of the command that is fired if the notify icon is clicked.
/// </summary> /// </summary>
[Category(CategoryName)]
[Description("The target of the command that is fired if the notify icon is clicked with the left mouse button."
)]
public IInputElement LeftClickCommandTarget public IInputElement LeftClickCommandTarget
{ {
get { return (IInputElement) GetValue(LeftClickCommandTargetProperty); } get { return (IInputElement) GetValue(LeftClickCommandTargetProperty); }
@@ -812,8 +817,6 @@ namespace Hardcodet.Wpf.TaskbarNotification
#endregion #endregion
//EVENTS //EVENTS
#region TrayLeftMouseDown #region TrayLeftMouseDown
@@ -821,8 +824,9 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// <summary> /// <summary>
/// TrayLeftMouseDown Routed Event /// TrayLeftMouseDown Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayLeftMouseDownEvent = EventManager.RegisterRoutedEvent("TrayLeftMouseDown", public static readonly RoutedEvent TrayLeftMouseDownEvent = EventManager.RegisterRoutedEvent(
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); "TrayLeftMouseDown",
RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Occurs when the user presses the left mouse button. /// Occurs when the user presses the left mouse button.
@@ -864,8 +868,9 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// <summary> /// <summary>
/// TrayRightMouseDown Routed Event /// TrayRightMouseDown Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayRightMouseDownEvent = EventManager.RegisterRoutedEvent("TrayRightMouseDown", public static readonly RoutedEvent TrayRightMouseDownEvent =
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); EventManager.RegisterRoutedEvent("TrayRightMouseDown",
RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Occurs when the presses the right mouse button. /// Occurs when the presses the right mouse button.
@@ -905,8 +910,9 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// <summary> /// <summary>
/// TrayMiddleMouseDown Routed Event /// TrayMiddleMouseDown Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayMiddleMouseDownEvent = EventManager.RegisterRoutedEvent("TrayMiddleMouseDown", public static readonly RoutedEvent TrayMiddleMouseDownEvent =
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); EventManager.RegisterRoutedEvent("TrayMiddleMouseDown",
RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Occurs when the user presses the middle mouse button. /// Occurs when the user presses the middle mouse button.
@@ -941,14 +947,13 @@ namespace Hardcodet.Wpf.TaskbarNotification
#endregion #endregion
#region TrayLeftMouseUp #region TrayLeftMouseUp
/// <summary> /// <summary>
/// TrayLeftMouseUp Routed Event /// TrayLeftMouseUp Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayLeftMouseUpEvent = EventManager.RegisterRoutedEvent("TrayLeftMouseUp", public static readonly RoutedEvent TrayLeftMouseUpEvent = EventManager.RegisterRoutedEvent("TrayLeftMouseUp",
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Occurs when the user releases the left mouse button. /// Occurs when the user releases the left mouse button.
@@ -989,7 +994,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// TrayRightMouseUp Routed Event /// TrayRightMouseUp Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayRightMouseUpEvent = EventManager.RegisterRoutedEvent("TrayRightMouseUp", public static readonly RoutedEvent TrayRightMouseUpEvent = EventManager.RegisterRoutedEvent("TrayRightMouseUp",
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Occurs when the user releases the right mouse button. /// Occurs when the user releases the right mouse button.
@@ -1029,8 +1034,9 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// <summary> /// <summary>
/// TrayMiddleMouseUp Routed Event /// TrayMiddleMouseUp Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayMiddleMouseUpEvent = EventManager.RegisterRoutedEvent("TrayMiddleMouseUp", public static readonly RoutedEvent TrayMiddleMouseUpEvent = EventManager.RegisterRoutedEvent(
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); "TrayMiddleMouseUp",
RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Occurs when the user releases the middle mouse button. /// Occurs when the user releases the middle mouse button.
@@ -1065,14 +1071,14 @@ namespace Hardcodet.Wpf.TaskbarNotification
#endregion #endregion
#region TrayMouseDoubleClick #region TrayMouseDoubleClick
/// <summary> /// <summary>
/// TrayMouseDoubleClick Routed Event /// TrayMouseDoubleClick Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayMouseDoubleClickEvent = EventManager.RegisterRoutedEvent("TrayMouseDoubleClick", public static readonly RoutedEvent TrayMouseDoubleClickEvent =
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); EventManager.RegisterRoutedEvent("TrayMouseDoubleClick",
RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Occurs when the user double-clicks the taskbar icon. /// Occurs when the user double-clicks the taskbar icon.
@@ -1115,7 +1121,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// TrayMouseMove Routed Event /// TrayMouseMove Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayMouseMoveEvent = EventManager.RegisterRoutedEvent("TrayMouseMove", public static readonly RoutedEvent TrayMouseMoveEvent = EventManager.RegisterRoutedEvent("TrayMouseMove",
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Occurs when the user moves the mouse over the taskbar icon. /// Occurs when the user moves the mouse over the taskbar icon.
@@ -1142,7 +1148,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
{ {
if (target == null) return null; if (target == null) return null;
RoutedEventArgs args = new RoutedEventArgs(); var args = new RoutedEventArgs();
args.RoutedEvent = TrayMouseMoveEvent; args.RoutedEvent = TrayMouseMoveEvent;
RoutedEventHelper.RaiseEvent(target, args); RoutedEventHelper.RaiseEvent(target, args);
return args; return args;
@@ -1150,14 +1156,14 @@ namespace Hardcodet.Wpf.TaskbarNotification
#endregion #endregion
#region TrayBalloonTipShown #region TrayBalloonTipShown
/// <summary> /// <summary>
/// TrayBalloonTipShown Routed Event /// TrayBalloonTipShown Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayBalloonTipShownEvent = EventManager.RegisterRoutedEvent("TrayBalloonTipShown", public static readonly RoutedEvent TrayBalloonTipShownEvent =
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); EventManager.RegisterRoutedEvent("TrayBalloonTipShown",
RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Occurs when a balloon ToolTip is displayed. /// Occurs when a balloon ToolTip is displayed.
@@ -1197,8 +1203,9 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// <summary> /// <summary>
/// TrayBalloonTipClosed Routed Event /// TrayBalloonTipClosed Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayBalloonTipClosedEvent = EventManager.RegisterRoutedEvent("TrayBalloonTipClosed", public static readonly RoutedEvent TrayBalloonTipClosedEvent =
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); EventManager.RegisterRoutedEvent("TrayBalloonTipClosed",
RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Occurs when a balloon ToolTip was closed. /// Occurs when a balloon ToolTip was closed.
@@ -1238,8 +1245,9 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// <summary> /// <summary>
/// TrayBalloonTipClicked Routed Event /// TrayBalloonTipClicked Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayBalloonTipClickedEvent = EventManager.RegisterRoutedEvent("TrayBalloonTipClicked", public static readonly RoutedEvent TrayBalloonTipClickedEvent =
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); EventManager.RegisterRoutedEvent("TrayBalloonTipClicked",
RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Occurs when the user clicks on a balloon ToolTip. /// Occurs when the user clicks on a balloon ToolTip.
@@ -1274,14 +1282,14 @@ namespace Hardcodet.Wpf.TaskbarNotification
#endregion #endregion
#region TrayContextMenuOpen (and PreviewTrayContextMenuOpen) #region TrayContextMenuOpen (and PreviewTrayContextMenuOpen)
/// <summary> /// <summary>
/// TrayContextMenuOpen Routed Event /// TrayContextMenuOpen Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayContextMenuOpenEvent = EventManager.RegisterRoutedEvent("TrayContextMenuOpen", public static readonly RoutedEvent TrayContextMenuOpenEvent =
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); EventManager.RegisterRoutedEvent("TrayContextMenuOpen",
RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Bubbled event that occurs when the context menu of the taskbar icon is being displayed. /// Bubbled event that occurs when the context menu of the taskbar icon is being displayed.
@@ -1317,8 +1325,9 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// <summary> /// <summary>
/// PreviewTrayContextMenuOpen Routed Event /// PreviewTrayContextMenuOpen Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent PreviewTrayContextMenuOpenEvent = EventManager.RegisterRoutedEvent("PreviewTrayContextMenuOpen", public static readonly RoutedEvent PreviewTrayContextMenuOpenEvent =
RoutingStrategy.Tunnel, typeof(RoutedEventHandler), typeof(TaskbarIcon)); EventManager.RegisterRoutedEvent("PreviewTrayContextMenuOpen",
RoutingStrategy.Tunnel, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Tunneled event that occurs when the context menu of the taskbar icon is being displayed. /// Tunneled event that occurs when the context menu of the taskbar icon is being displayed.
@@ -1359,7 +1368,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// TrayPopupOpen Routed Event /// TrayPopupOpen Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayPopupOpenEvent = EventManager.RegisterRoutedEvent("TrayPopupOpen", public static readonly RoutedEvent TrayPopupOpenEvent = EventManager.RegisterRoutedEvent("TrayPopupOpen",
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Bubbled event that occurs when the custom popup is being opened. /// Bubbled event that occurs when the custom popup is being opened.
@@ -1395,8 +1404,9 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// <summary> /// <summary>
/// PreviewTrayPopupOpen Routed Event /// PreviewTrayPopupOpen Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent PreviewTrayPopupOpenEvent = EventManager.RegisterRoutedEvent("PreviewTrayPopupOpen", public static readonly RoutedEvent PreviewTrayPopupOpenEvent =
RoutingStrategy.Tunnel, typeof(RoutedEventHandler), typeof(TaskbarIcon)); EventManager.RegisterRoutedEvent("PreviewTrayPopupOpen",
RoutingStrategy.Tunnel, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Tunneled event that occurs when the custom popup is being opened. /// Tunneled event that occurs when the custom popup is being opened.
@@ -1431,14 +1441,13 @@ namespace Hardcodet.Wpf.TaskbarNotification
#endregion #endregion
#region TrayToolTipOpen (and PreviewTrayToolTipOpen) #region TrayToolTipOpen (and PreviewTrayToolTipOpen)
/// <summary> /// <summary>
/// TrayToolTipOpen Routed Event /// TrayToolTipOpen Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayToolTipOpenEvent = EventManager.RegisterRoutedEvent("TrayToolTipOpen", public static readonly RoutedEvent TrayToolTipOpenEvent = EventManager.RegisterRoutedEvent("TrayToolTipOpen",
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Bubbled event that occurs when the custom ToolTip is being displayed. /// Bubbled event that occurs when the custom ToolTip is being displayed.
@@ -1474,8 +1483,9 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// <summary> /// <summary>
/// PreviewTrayToolTipOpen Routed Event /// PreviewTrayToolTipOpen Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent PreviewTrayToolTipOpenEvent = EventManager.RegisterRoutedEvent("PreviewTrayToolTipOpen", public static readonly RoutedEvent PreviewTrayToolTipOpenEvent =
RoutingStrategy.Tunnel, typeof(RoutedEventHandler), typeof(TaskbarIcon)); EventManager.RegisterRoutedEvent("PreviewTrayToolTipOpen",
RoutingStrategy.Tunnel, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Tunneled event that occurs when the custom ToolTip is being displayed. /// Tunneled event that occurs when the custom ToolTip is being displayed.
@@ -1516,7 +1526,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// TrayToolTipClose Routed Event /// TrayToolTipClose Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent TrayToolTipCloseEvent = EventManager.RegisterRoutedEvent("TrayToolTipClose", public static readonly RoutedEvent TrayToolTipCloseEvent = EventManager.RegisterRoutedEvent("TrayToolTipClose",
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Bubbled event that occurs when a custom tooltip is being closed. /// Bubbled event that occurs when a custom tooltip is being closed.
@@ -1552,8 +1562,9 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// <summary> /// <summary>
/// PreviewTrayToolTipClose Routed Event /// PreviewTrayToolTipClose Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent PreviewTrayToolTipCloseEvent = EventManager.RegisterRoutedEvent("PreviewTrayToolTipClose", public static readonly RoutedEvent PreviewTrayToolTipCloseEvent =
RoutingStrategy.Tunnel, typeof(RoutedEventHandler), typeof(TaskbarIcon)); EventManager.RegisterRoutedEvent("PreviewTrayToolTipClose",
RoutingStrategy.Tunnel, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Tunneled event that occurs when a custom tooltip is being closed. /// Tunneled event that occurs when a custom tooltip is being closed.
@@ -1588,7 +1599,6 @@ namespace Hardcodet.Wpf.TaskbarNotification
#endregion #endregion
//ATTACHED EVENTS //ATTACHED EVENTS
#region PopupOpened #region PopupOpened
@@ -1597,7 +1607,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// PopupOpened Attached Routed Event /// PopupOpened Attached Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent PopupOpenedEvent = EventManager.RegisterRoutedEvent("PopupOpened", public static readonly RoutedEvent PopupOpenedEvent = EventManager.RegisterRoutedEvent("PopupOpened",
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Adds a handler for the PopupOpened attached event /// Adds a handler for the PopupOpened attached event
@@ -1641,7 +1651,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// ToolTipOpened Attached Routed Event /// ToolTipOpened Attached Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent ToolTipOpenedEvent = EventManager.RegisterRoutedEvent("ToolTipOpened", public static readonly RoutedEvent ToolTipOpenedEvent = EventManager.RegisterRoutedEvent("ToolTipOpened",
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Adds a handler for the ToolTipOpened attached event /// Adds a handler for the ToolTipOpened attached event
@@ -1685,7 +1695,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// ToolTipClose Attached Routed Event /// ToolTipClose Attached Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent ToolTipCloseEvent = EventManager.RegisterRoutedEvent("ToolTipClose", public static readonly RoutedEvent ToolTipCloseEvent = EventManager.RegisterRoutedEvent("ToolTipClose",
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Adds a handler for the ToolTipClose attached event /// Adds a handler for the ToolTipClose attached event
@@ -1729,7 +1739,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// BalloonShowing Attached Routed Event /// BalloonShowing Attached Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent BalloonShowingEvent = EventManager.RegisterRoutedEvent("BalloonShowing", public static readonly RoutedEvent BalloonShowingEvent = EventManager.RegisterRoutedEvent("BalloonShowing",
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Adds a handler for the BalloonShowing attached event /// Adds a handler for the BalloonShowing attached event
@@ -1773,7 +1783,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// BalloonClosing Attached Routed Event /// BalloonClosing Attached Routed Event
/// </summary> /// </summary>
public static readonly RoutedEvent BalloonClosingEvent = EventManager.RegisterRoutedEvent("BalloonClosing", public static readonly RoutedEvent BalloonClosingEvent = EventManager.RegisterRoutedEvent("BalloonClosing",
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TaskbarIcon)); RoutingStrategy.Bubble, typeof (RoutedEventHandler), typeof (TaskbarIcon));
/// <summary> /// <summary>
/// Adds a handler for the BalloonClosing attached event /// Adds a handler for the BalloonClosing attached event
@@ -1811,8 +1821,6 @@ namespace Hardcodet.Wpf.TaskbarNotification
#endregion #endregion
//ATTACHED PROPERTIES //ATTACHED PROPERTIES
#region ParentTaskbarIcon #region ParentTaskbarIcon
@@ -1835,7 +1843,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// </summary> /// </summary>
public static TaskbarIcon GetParentTaskbarIcon(DependencyObject d) public static TaskbarIcon GetParentTaskbarIcon(DependencyObject d)
{ {
return (TaskbarIcon)d.GetValue(ParentTaskbarIconProperty); return (TaskbarIcon) d.GetValue(ParentTaskbarIconProperty);
} }
/// <summary> /// <summary>
@@ -1849,7 +1857,6 @@ namespace Hardcodet.Wpf.TaskbarNotification
#endregion #endregion
//BASE CLASS PROPERTY OVERRIDES //BASE CLASS PROPERTY OVERRIDES
/// <summary> /// <summary>
@@ -1858,18 +1865,16 @@ namespace Hardcodet.Wpf.TaskbarNotification
static TaskbarIcon() static TaskbarIcon()
{ {
//register change listener for the Visibility property //register change listener for the Visibility property
PropertyMetadata md = new PropertyMetadata(Visibility.Visible, VisibilityPropertyChanged); var md = new PropertyMetadata(Visibility.Visible, VisibilityPropertyChanged);
VisibilityProperty.OverrideMetadata(typeof(TaskbarIcon), md); VisibilityProperty.OverrideMetadata(typeof (TaskbarIcon), md);
//register change listener for the DataContext property //register change listener for the DataContext property
md = new FrameworkPropertyMetadata(new PropertyChangedCallback(DataContextPropertyChanged)); md = new FrameworkPropertyMetadata(new PropertyChangedCallback(DataContextPropertyChanged));
DataContextProperty.OverrideMetadata(typeof(TaskbarIcon), md); DataContextProperty.OverrideMetadata(typeof (TaskbarIcon), md);
//register change listener for the ContextMenu property //register change listener for the ContextMenu property
md = new FrameworkPropertyMetadata(new PropertyChangedCallback(ContextMenuPropertyChanged)); md = new FrameworkPropertyMetadata(new PropertyChangedCallback(ContextMenuPropertyChanged));
ContextMenuProperty.OverrideMetadata(typeof(TaskbarIcon), md); ContextMenuProperty.OverrideMetadata(typeof (TaskbarIcon), md);
} }
} }
} }