CHG Reformatting code (NTFY-20).

git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@192 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
Philipp Sumi
2013-11-18 00:03:09 +00:00
parent 1be7b176a9
commit 7014294506
64 changed files with 3832 additions and 3636 deletions

View File

@@ -33,14 +33,17 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// The balloon message is displayed without an icon.
/// </summary>
None,
/// <summary>
/// An information is displayed.
/// </summary>
Info,
/// <summary>
/// A warning is displayed.
/// </summary>
Warning,
/// <summary>
/// An error is displayed.
/// </summary>

View File

@@ -10,28 +10,34 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
/// No icon is displayed.
/// </summary>
None = 0x00,
/// <summary>
/// An information icon is displayed.
/// </summary>
Info = 0x01,
/// <summary>
/// A warning icon is displayed.
/// </summary>
Warning = 0x02,
/// <summary>
/// An error icon is displayed.
/// </summary>
Error = 0x03,
/// <summary>
/// Windows XP Service Pack 2 (SP2) and later.
/// Use a custom icon as the title icon.
/// </summary>
User = 0x04,
/// <summary>
/// Windows XP (Shell32.dll version 6.0) and later.
/// Do not play the associated sound. Applies only to balloon ToolTips.
/// </summary>
NoSound = 0x10,
/// <summary>
/// Windows Vista (Shell32.dll version 6.0.6) and later. The large version
/// of the icon should be used as the balloon icon. This corresponds to the
@@ -46,10 +52,10 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
/// SM_CXICON x SM_CYICON version in the supplied icon (hBalloonIcon).
/// </summary>
LargeIcon = 0x20,
/// <summary>
/// Windows 7 and later.
/// </summary>
RespectQuietTime = 0x80
}
}

View File

@@ -14,20 +14,24 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
/// The message ID is set.
/// </summary>
Message = 0x01,
/// <summary>
/// The notification icon is set.
/// </summary>
Icon = 0x02,
/// <summary>
/// The tooltip is set.
/// </summary>
Tip = 0x04,
/// <summary>
/// State information (<see cref="IconState"/>) is set. This
/// applies to both <see cref="NotifyIconData.IconState"/> and
/// <see cref="NotifyIconData.StateMask"/>.
/// </summary>
State = 0x08,
/// <summary>
/// The balloon ToolTip is set. Accordingly, the following
/// members are set: <see cref="NotifyIconData.BalloonText"/>,
@@ -40,7 +44,6 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
/// Internal identifier is set. Reserved, thus commented out.
/// </summary>
//Guid = 0x20,
/// <summary>
/// Windows Vista (Shell32.dll version 6.0.6) and later. If the ToolTip
/// cannot be displayed immediately, discard it.<br/>
@@ -50,6 +53,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
/// This modifies and must be combined with the <see cref="Info"/> flag.
/// </summary>
Realtime = 0x40,
/// <summary>
/// Windows Vista (Shell32.dll version 6.0.6) and later.
/// Use the standard ToolTip. Normally, when uVersion is set

View File

@@ -10,6 +10,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
/// The icon is visible.
/// </summary>
Visible = 0x00,
/// <summary>
/// Hide the icon.
/// </summary>

View File

@@ -1,6 +1,4 @@
namespace Hardcodet.Wpf.TaskbarNotification.Interop
namespace Hardcodet.Wpf.TaskbarNotification.Interop
{
/// <summary>
/// Event flags for clicked events.
@@ -12,34 +10,42 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
/// taskbar icon's area.
/// </summary>
MouseMove,
/// <summary>
/// The right mouse button was clicked.
/// </summary>
IconRightMouseDown,
/// <summary>
/// The left mouse button was clicked.
/// </summary>
IconLeftMouseDown,
/// <summary>
/// The right mouse button was released.
/// </summary>
IconRightMouseUp,
/// <summary>
/// The left mouse button was released.
/// </summary>
IconLeftMouseUp,
/// <summary>
/// The middle mouse button was clicked.
/// </summary>
IconMiddleMouseDown,
/// <summary>
/// The middle mouse button was released.
/// </summary>
IconMiddleMouseUp,
/// <summary>
/// The taskbar icon was double clicked.
/// </summary>
IconDoubleClick,
/// <summary>
/// The balloon tip was clicked.
/// </summary>

View File

@@ -1,5 +1,3 @@
namespace Hardcodet.Wpf.TaskbarNotification.Interop
{
/// <summary>
@@ -12,18 +10,22 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
/// The taskbar icon is being created.
/// </summary>
Add = 0x00,
/// <summary>
/// The settings of the taskbar icon are being updated.
/// </summary>
Modify = 0x01,
/// <summary>
/// The taskbar icon is deleted.
/// </summary>
Delete = 0x02,
/// <summary>
/// Focus is returned to the taskbar icon. Currently not in use.
/// </summary>
SetFocus = 0x03,
/// <summary>
/// Shell32.dll version 5.0 and later only. Instructs the taskbar
/// to behave according to the version number specified in the

View File

@@ -128,7 +128,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
if (Environment.OSVersion.Version.Major >= 6)
{
//use the current size
data.cbSize = (uint)Marshal.SizeOf(data);
data.cbSize = (uint) Marshal.SizeOf(data);
}
else
{

View File

@@ -11,11 +11,13 @@
/// a <see cref="NotifyIconData"/> size of 488.
/// </summary>
Win95 = 0x0,
/// <summary>
/// Behavior representing Win2000 an higher. Expects
/// a <see cref="NotifyIconData"/> size of 504.
/// </summary>
Win2000 = 0x3,
/// <summary>
/// Extended tooltip support, which is available
/// for Vista and later.

View File

@@ -45,16 +45,13 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
y = rcWorkArea.Bottom;
}
return new Point { X = x, Y = y};
return new Point {X = x, Y = y};
}
}
internal class AppBarInfo
{
[DllImport("user32.dll")]
private static extern IntPtr FindWindow(String lpClassName, String lpWindowName);
@@ -105,7 +102,6 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
}
public void GetPosition(string strClassName, string strWindowName)
{
m_data = new APPBARDATA();
@@ -135,8 +131,6 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
}
public enum ScreenEdge
{
Undefined = -1,
@@ -166,6 +160,5 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
public Int32 right;
public Int32 bottom;
}
}
}

View File

@@ -12,7 +12,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
/// Creates, updates or deletes the taskbar icon.
/// </summary>
[DllImport("shell32.Dll", CharSet = CharSet.Unicode)]
public static extern bool Shell_NotifyIcon(NotifyCommand cmd, [In]ref NotifyIconData data);
public static extern bool Shell_NotifyIcon(NotifyCommand cmd, [In] ref NotifyIconData data);
/// <summary>

View File

@@ -22,7 +22,6 @@
// THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE
using System;
using System.ComponentModel;
using System.Diagnostics;
@@ -36,7 +35,6 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
/// </summary>
public class WindowMessageSink : IDisposable
{
#region members
/// <summary>
@@ -84,7 +82,6 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
#endregion
#region events
/// <summary>
@@ -112,7 +109,6 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
#endregion
#region construction
/// <summary>
@@ -149,7 +145,6 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
#endregion
#region CreateMessageWindow
/// <summary>
@@ -187,7 +182,8 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
taskbarRestartMessageId = WinApi.RegisterWindowMessage("TaskbarCreated");
// Create the message window
MessageWindowHandle = WinApi.CreateWindowEx(0, WindowId, "", 0, 0, 0, 1, 1, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
MessageWindowHandle = WinApi.CreateWindowEx(0, WindowId, "", 0, 0, 0, 1, 1, IntPtr.Zero, IntPtr.Zero,
IntPtr.Zero, IntPtr.Zero);
if (MessageWindowHandle == IntPtr.Zero)
{
@@ -201,7 +197,6 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
#endregion
#region Handle Window Messages
/// <summary>
@@ -238,7 +233,8 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
switch (lParam.ToInt32())
{
case 0x200:
MouseEventReceived(MouseEvent.MouseMove); break;
MouseEventReceived(MouseEvent.MouseMove);
break;
case 0x201:
MouseEventReceived(MouseEvent.IconLeftMouseDown);
@@ -306,12 +302,10 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
Debug.WriteLine("Unhandled NotifyIcon message ID: " + lParam);
break;
}
}
#endregion
#region Dispose
/// <summary>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,11 +10,11 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Hardcodet.Wpf.TaskbarNotification</RootNamespace>
<AssemblyName>Hardcodet.Wpf.TaskbarNotification</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<TargetFrameworkSubset>Client</TargetFrameworkSubset>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -25,6 +25,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -34,6 +35,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Hardcodet.Wpf.TaskbarNotification.xml</DocumentationFile>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -41,6 +43,7 @@
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Xaml" />
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />

View File

@@ -35,32 +35,38 @@ namespace Hardcodet.Wpf.TaskbarNotification
/// tray icon with the left mouse button.
/// </summary>
LeftClick,
/// <summary>
/// The item is displayed if the user clicks the
/// tray icon with the right mouse button.
/// </summary>
RightClick,
/// <summary>
/// The item is displayed if the user double-clicks the
/// tray icon.
/// </summary>
DoubleClick,
/// <summary>
/// The item is displayed if the user clicks the
/// tray icon with the left or the right mouse button.
/// </summary>
LeftOrRightClick,
/// <summary>
/// The item is displayed if the user clicks the
/// tray icon with the left mouse button or if a
/// double-click is being performed.
/// </summary>
LeftOrDoubleClick,
/// <summary>
/// The item is displayed if the user clicks the
/// tray icon with the middle mouse button.
/// </summary>
MiddleClick,
/// <summary>
/// The item is displayed whenever a click occurs.
/// </summary>

View File

@@ -6,21 +6,25 @@ using System.Windows.Markup;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("NotifyIcon for WPF")]
[assembly: AssemblyDescription("NotifyIcon Implementation for the WPF platform.")]
[assembly: AssemblyDescription("NotifyIcon implementation for the WPF platform.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("hardcodet.net")]
[assembly: AssemblyProduct("NotifyIcon WPF")]
[assembly: AssemblyCopyright("Copyright © Philipp Sumi 2009")]
[assembly: AssemblyCopyright("Copyright © Philipp Sumi 2046")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//provides simplified declaration
[assembly: XmlnsPrefix("http://www.hardcodet.net/taskbar", "tb")]
[assembly: XmlnsDefinition("http://www.hardcodet.net/taskbar", "Hardcodet.Wpf.TaskbarNotification")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
@@ -40,7 +44,7 @@ using System.Windows.Markup;
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
)]
// Version information for an assembly consists of the following four values:
@@ -53,5 +57,6 @@ using System.Windows.Markup;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.4.0")]
[assembly: AssemblyFileVersion("1.0.4.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]

View File

@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3053
// Runtime Version:4.0.30319.18408
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -19,7 +19,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@@ -60,6 +60,9 @@ namespace Hardcodet.Wpf.TaskbarNotification.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon DefaultTrayIcon {
get {
object obj = ResourceManager.GetObject("DefaultTrayIcon", resourceCulture);

View File

@@ -705,7 +705,7 @@ namespace Hardcodet.Wpf.TaskbarNotification
IntPtr handle = IntPtr.Zero;
//try to get a handle on the context itself
HwndSource source = (HwndSource)PresentationSource.FromVisual(ContextMenu);
HwndSource source = (HwndSource) PresentationSource.FromVisual(ContextMenu);
if (source != null)
{
handle = source.Handle;

View File

@@ -61,7 +61,8 @@ namespace Hardcodet.Wpf.TaskbarNotification
{
isDesignMode =
(bool)
DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty, typeof (FrameworkElement))
DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty,
typeof (FrameworkElement))
.Metadata.DefaultValue;
}

View File

@@ -13,6 +13,5 @@ namespace Samples
/// </summary>
public partial class App : Application
{
}
}

View File

@@ -71,7 +71,8 @@ namespace Samples.Commands
get
{
return (bool)
DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty, typeof(FrameworkElement))
DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty,
typeof (FrameworkElement))
.Metadata.DefaultValue;
}
}
@@ -91,8 +92,6 @@ namespace Samples.Commands
return tb == null ? null : TryFindParent<Window>(tb);
}
#region TryFindParent helper
/// <summary>

View File

@@ -8,7 +8,6 @@ namespace Samples.Commands
/// </summary>
public class HideSampleWindowCommand : CommandBase<HideSampleWindowCommand>
{
public override void Execute(object parameter)
{
GetTaskbarWindow(parameter).Hide();
@@ -21,7 +20,5 @@ namespace Samples.Commands
Window win = GetTaskbarWindow(parameter);
return win != null && win.IsVisible;
}
}
}

View File

@@ -30,8 +30,10 @@
FontSize="14"
FontStyle="Italic"
FontWeight="Bold"
TextWrapping="Wrap"><Run
Text="WPF NotifyIcon 1.0.4 - Samples" /></TextBlock>
TextWrapping="Wrap">
<Run
Text="WPF NotifyIcon 1.0.4 - Samples" />
</TextBlock>
<Button
HorizontalAlignment="Left"
Margin="10,133,0,0"
@@ -46,8 +48,10 @@
Margin="10,50,0,0"
VerticalAlignment="Top"
FontWeight="Bold"
TextWrapping="Wrap"><Run
Text="Tutorials:" /></TextBlock>
TextWrapping="Wrap">
<Run
Text="Tutorials:" />
</TextBlock>
<TextBlock
HorizontalAlignment="Left"
Margin="10,75.96,0,0"
@@ -55,8 +59,10 @@
TextWrapping="Wrap"
Width="224.31"
Height="47.04"
d:LayoutOverrides="HorizontalAlignment"><Run
Text="Tutorials follow the contents of the CodeProject article. Check the &quot;Tutorials&quot; folder for the source code." /></TextBlock>
d:LayoutOverrides="HorizontalAlignment">
<Run
Text="Tutorials follow the contents of the CodeProject article. Check the &quot;Tutorials&quot; folder for the source code." />
</TextBlock>
<Button
HorizontalAlignment="Left"
Margin="10,170,0,0"
@@ -117,14 +123,18 @@
FontWeight="Bold"
TextWrapping="Wrap"
HorizontalAlignment="Right"
d:LayoutOverrides="HorizontalAlignment, Width"><Run
Text="Showcase Sample:" /></TextBlock>
d:LayoutOverrides="HorizontalAlignment, Width">
<Run
Text="Showcase Sample:" />
</TextBlock>
<TextBlock
Margin="255.31,75.96,145.38,0"
VerticalAlignment="Top"
TextWrapping="Wrap"
Height="47.04"><Run
Text="An interactive sample that shows off most features on a single NotifyIcon." /></TextBlock>
Height="47.04">
<Run
Text="An interactive sample that shows off most features on a single NotifyIcon." />
</TextBlock>
<Button
Margin="255.31,133,0,0"
VerticalAlignment="Top"
@@ -146,26 +156,27 @@
Margin="255.31,191,10,0"
TextWrapping="Wrap"
VerticalAlignment="Top">
<Run Text="The latest news related to the component can be found on the project page:"/>
<LineBreak/>
<Run Text="The latest news related to the component can be found on the project page:" />
<LineBreak />
<Hyperlink NavigateUri="http://www.hardcodet.net/wpf-notifyicon">
<Run Text="http://www.hardcodet.net/wpf-notifyicon"/>
<Run Text="http://www.hardcodet.net/wpf-notifyicon" />
</Hyperlink>
<LineBreak/>
<LineBreak/>
<Run Text="Critical feedback is appreciated - please post bug reports, requests, questions etc. to the CodeProject forum"/>
<Run Language="de-ch" Text=":"/>
<LineBreak/>
<LineBreak />
<LineBreak />
<Run
Text="Critical feedback is appreciated - please post bug reports, requests, questions etc. to the CodeProject forum" />
<Run Language="de-ch" Text=":" />
<LineBreak />
<Hyperlink NavigateUri="http://www.codeproject.com/KB/WPF/wpf_notifyicon.aspx">
<Run Text="http://www.codeproject.com/KB/WPF/wpf_notifyicon.aspx"/>
<Run Text="http://www.codeproject.com/KB/WPF/wpf_notifyicon.aspx" />
</Hyperlink>
<LineBreak/>
<LineBreak/>
<LineBreak/>
<LineBreak />
<LineBreak />
<LineBreak />
<TextBlock>
<Run Text="Love it or hate it? Please let me know and "/>
<Run Text="Love it or hate it? Please let me know and " />
<Hyperlink NavigateUri="http://www.codeproject.com/KB/WPF/wpf_notifyicon.aspx">
<Run FontWeight="Bold" Text="rate the project"/>
<Run FontWeight="Bold" Text="rate the project" />
</Hyperlink>
<Run Text=" - thanks!" />
</TextBlock>
@@ -176,11 +187,17 @@
VerticalAlignment="Bottom"
Height="22.42"
TextWrapping="Wrap"
FontWeight="Bold"><Run
Text="WPF NotifyIcon is free software, released under the" /><Run
Text=" " /><Hyperlink
NavigateUri="http://www.codeproject.com/info/cpol10.aspx"><Run
Text="CodeProject Open License" /></Hyperlink></TextBlock>
FontWeight="Bold">
<Run
Text="WPF NotifyIcon is free software, released under the" />
<Run
Text=" " />
<Hyperlink
NavigateUri="http://www.codeproject.com/info/cpol10.aspx">
<Run
Text="CodeProject Open License" />
</Hyperlink>
</TextBlock>
<Path
Fill="#FFFFFFFF"
Stretch="Fill"

View File

@@ -7,6 +7,7 @@ using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Sample Project")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
@@ -19,6 +20,7 @@ using System.Windows;
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
@@ -38,7 +40,7 @@ using System.Windows;
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
)]
// Version information for an assembly consists of the following four values:
@@ -51,5 +53,6 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,4 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />

View File

@@ -115,9 +115,13 @@
<TextBlock Margin="72,49.2,10,0"
VerticalAlignment="Top"
Foreground="#FFECAD25"
TextWrapping="Wrap"><Run Text="This is a user control. The animation uses the attached "/><Run FontStyle="Italic"
TextWrapping="Wrap">
<Run Text="This is a user control. The animation uses the attached " />
<Run FontStyle="Italic"
FontWeight="Bold"
Text="BalloonShowing "/><Run Text="event."/></TextBlock>
Text="BalloonShowing " />
<Run Text="event." />
</TextBlock>
<Path Fill="#FFFFFFFF"
Stretch="Fill"
Margin="72,38.2,34,0"

View File

@@ -48,7 +48,6 @@ namespace Samples
#endregion
public FancyBalloon()
{
InitializeComponent();
@@ -101,7 +100,7 @@ namespace Samples
/// </summary>
private void OnFadeOutCompleted(object sender, EventArgs e)
{
Popup pp = (Popup)Parent;
Popup pp = (Popup) Parent;
pp.IsOpen = false;
}
}

View File

@@ -43,12 +43,9 @@ namespace Samples
#endregion
public FancyToolTip()
{
this.InitializeComponent();
}
}
}

View File

@@ -22,7 +22,8 @@
<Border Background="{DynamicResource MenuBackground}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ScrollViewer Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}"
<ScrollViewer
Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}"
Uid="ScrollViewer_9"
CanContentScroll="True">
<ItemsPresenter Margin="{TemplateBinding Padding}"

View File

@@ -53,7 +53,6 @@
Hyperlink.RequestNavigate="OnNavigationRequest">
<!--
THE TASKBARICON ELEMENT WAS DECLARED INLINE IN ORDER TO USE DATABINDING
FOR ITS PROPERTIES. IN A REAL-LIFE APP, YOU'D PROBABLY RATHER DECLARE
@@ -71,8 +70,7 @@
MenuActivation="{Binding Path=SelectedItem, ElementName=lstMenuTrigger, Mode=Default}"
PopupActivation="{Binding Path=SelectedItem, ElementName=lstPopupTrigger, Mode=Default}"
DoubleClickCommand="{Commands:ShowSampleWindowCommand}"
DoubleClickCommandParameter="{Binding RelativeSource={RelativeSource Self}}"
>
DoubleClickCommandParameter="{Binding RelativeSource={RelativeSource Self}}">
<tb:TaskbarIcon.TrayPopup>
<!-- the control will be put into a popup with an explicit DataContext -->
@@ -89,8 +87,6 @@
</tb:TaskbarIcon>
<!-- ************************************************************************************* -->
<!-- ************************************************************************************* -->
<!-- EVERYTHING BELOW IS JUST PLUMBING FOR THE SAMPLE -->
@@ -112,7 +108,9 @@
Margin="125,0,17,133"
x:Name="txtBalloonTitle"
VerticalAlignment="Bottom"
Height="23">WPF NotifyIcon</TextBox>
Height="23">
WPF NotifyIcon
</TextBox>
<TextBox
Margin="125,0,17,76"
x:Name="txtBalloonText"
@@ -137,8 +135,10 @@
VerticalAlignment="Bottom"
Width="85"
Height="23"
TextWrapping="Wrap"><Run
Text="Balloon Title" /></TextBlock>
TextWrapping="Wrap">
<Run
Text="Balloon Title" />
</TextBlock>
<TextBlock
Margin="14,0,0,100"
TextWrapping="Wrap"
@@ -146,8 +146,10 @@
Width="85"
Height="23"
VerticalAlignment="Bottom"
d:LayoutOverrides="VerticalAlignment"><Run
Text="Balloon Text" /></TextBlock>
d:LayoutOverrides="VerticalAlignment">
<Run
Text="Balloon Text" />
</TextBlock>
<RadioButton
Margin="14,0,0,32"
VerticalAlignment="Bottom"
@@ -177,11 +179,16 @@
Margin="10,35.96,21,0"
VerticalAlignment="Top"
Height="56.04"
TextWrapping="Wrap"><Run
Text="Displays default balloon tips as supported by the OS. " /><Run
Text="You can use custom icons under all OS versions" /><Run
Text=" (not supported by WinForms NotifyIcon)." /><Run
Text="." /></TextBlock>
TextWrapping="Wrap">
<Run
Text="Displays default balloon tips as supported by the OS. " />
<Run
Text="You can use custom icons under all OS versions" />
<Run
Text=" (not supported by WinForms NotifyIcon)." />
<Run
Text="." />
</TextBlock>
<Button
HorizontalAlignment="Right"
Margin="0,0,17,12.52"
@@ -199,8 +206,10 @@
Height="Auto"
FontWeight="Bold"
TextDecorations="Underline"
TextWrapping="Wrap"><Run
Text="Standard (OS) Balloon Tips" /></TextBlock>
TextWrapping="Wrap">
<Run
Text="Standard (OS) Balloon Tips" />
</TextBlock>
</Grid>
<Grid
HorizontalAlignment="Left"
@@ -224,26 +233,45 @@
VerticalAlignment="Bottom" />
<TextBlock
Margin="10,31.7,14,137"
TextWrapping="Wrap"><Run
Text="If the user clicks on the " /><Run
Text="Notify" /><Run
Text="Icon, a " /><Run
Text="P" /><Run
Text="opup can be opened and displayed" /><Run
Text=" that allows the user to quickly interact with the application" /><Run
Text=". " /><Run
Text="Unlike custom ToolTips, this works under all OS versions" /><Run
Text=". " /><Run
Text="Which mouse button(s) opens the Popup is " /><Run
Text="determined by the " /><Run
TextWrapping="Wrap">
<Run
Text="If the user clicks on the " />
<Run
Text="Notify" />
<Run
Text="Icon, a " />
<Run
Text="P" />
<Run
Text="opup can be opened and displayed" />
<Run
Text=" that allows the user to quickly interact with the application" />
<Run
Text=". " />
<Run
Text="Unlike custom ToolTips, this works under all OS versions" />
<Run
Text=". " />
<Run
Text="Which mouse button(s) opens the Popup is " />
<Run
Text="determined by the " />
<Run
FontStyle="Italic"
FontWeight="Bold"
Text="PopupActivation " /><Run
Text="property." /><Run
Text=" If both Popup and ContextMenu are configured for the same mouse buttons, ContextMenu takes precedence." /><LineBreak /><Run
Text="(Note: " /><Run
Text="In case left-clicks are used, popups are displayed with a delay to ensure the user does not double-click." /><Run
Text=")" /></TextBlock>
Text="PopupActivation " />
<Run
Text="property." />
<Run
Text=" If both Popup and ContextMenu are configured for the same mouse buttons, ContextMenu takes precedence." />
<LineBreak />
<Run
Text="(Note: " />
<Run
Text="In case left-clicks are used, popups are displayed with a delay to ensure the user does not double-click." />
<Run
Text=")" />
</TextBlock>
<TextBlock
HorizontalAlignment="Left"
Margin="10,10,0,0"
@@ -252,8 +280,10 @@
Height="Auto"
FontWeight="Bold"
TextDecorations="Underline"
TextWrapping="Wrap"><Run
Text="Popup Controls" /></TextBlock>
TextWrapping="Wrap">
<Run
Text="Popup Controls" />
</TextBlock>
</Grid>
<Grid
Margin="10,278,0,0"
@@ -279,37 +309,61 @@
Margin="10,0,25,93"
TextWrapping="Wrap"
Height="21"
VerticalAlignment="Bottom"><Run
Text="ToolTipText" /><Run
Text=" (assigned to property and also used by several bindings)" /><Run
Text=":" /></TextBlock>
VerticalAlignment="Bottom">
<Run
Text="ToolTipText" />
<Run
Text=" (assigned to property and also used by several bindings)" />
<Run
Text=":" />
</TextBlock>
<TextBlock
Margin="10,29.88,10,114"
TextWrapping="Wrap"><Run
Text="If the user moves the mouse over the " /><Run
Text="Notify" /><Run
Text="Icon, " /><Run
Text="a ToolTip " /><Run
Text="can be displayed. Starting from Windows Vista, we have convenient events to display and hide tooltips." /><Run
Text=" You can assign arbitrary UIElements (e.g. User Controls) to the " /><Run
TextWrapping="Wrap">
<Run
Text="If the user moves the mouse over the " />
<Run
Text="Notify" />
<Run
Text="Icon, " />
<Run
Text="a ToolTip " />
<Run
Text="can be displayed. Starting from Windows Vista, we have convenient events to display and hide tooltips." />
<Run
Text=" You can assign arbitrary UIElements (e.g. User Controls) to the " />
<Run
FontStyle="Italic"
FontWeight="Bold"
Text="TrayToolTip " /><Run
Text="property." /><LineBreak /><Run
Text="" /><Run
Text="If " /><Run
Text="TrayToolTip " />
<Run
Text="property." />
<LineBreak />
<Run
Text="" />
<Run
Text="If " />
<Run
FontStyle="Italic"
FontWeight="Bold"
Text="TrayToolTip " /><Run
Text="is not set or the app runs under an older OS (e.g. " /><Run
Text="Windows " /><Run
Text="xp), the " /><Run
Text="NotifyIcon " /><Run
Text="falls back to the " /><Run
Text="TrayToolTip " />
<Run
Text="is not set or the app runs under an older OS (e.g. " />
<Run
Text="Windows " />
<Run
Text="xp), the " />
<Run
Text="NotifyIcon " />
<Run
Text="falls back to the " />
<Run
FontStyle="Italic"
FontWeight="Bold"
Text="ToolTipText " /><Run
Text="property." /></TextBlock>
Text="ToolTipText " />
<Run
Text="property." />
</TextBlock>
<Button
HorizontalAlignment="Left"
Margin="10,0,0,10"
@@ -323,8 +377,10 @@
Margin="10,0,25,44"
VerticalAlignment="Bottom"
Height="16"
TextWrapping="Wrap"><Run
Text="Click to fall back to ToolTipText (sets TrayToolTip to null):" /></TextBlock>
TextWrapping="Wrap">
<Run
Text="Click to fall back to ToolTipText (sets TrayToolTip to null):" />
</TextBlock>
<TextBlock
HorizontalAlignment="Left"
Margin="10,10,0,0"
@@ -333,8 +389,10 @@
Height="Auto"
FontWeight="Bold"
TextDecorations="Underline"
TextWrapping="Wrap"><Run
Text="ToolTips and ToolTipText" /></TextBlock>
TextWrapping="Wrap">
<Run
Text="ToolTips and ToolTipText" />
</TextBlock>
</Grid>
<Grid
HorizontalAlignment="Left"
@@ -359,24 +417,34 @@
Margin="10,97,48,0"
VerticalAlignment="Top"
Height="22"
TextWrapping="Wrap"><Run
Text="Mouse events that open the context menu:" /></TextBlock>
TextWrapping="Wrap">
<Run
Text="Mouse events that open the context menu:" />
</TextBlock>
<TextBlock
Margin="10,30,10,0"
VerticalAlignment="Top"
Height="57"
TextWrapping="Wrap"><Run
Text="Assign a custon context menu through the " /><Run
TextWrapping="Wrap">
<Run
Text="Assign a custon context menu through the " />
<Run
FontStyle="Italic"
FontWeight="Bold"
Text="ContextMenu " /><Run
Text="property of the " /><Run
Text="Notify" /><Run
Text="Icon. The " /><Run
Text="ContextMenu " />
<Run
Text="property of the " />
<Run
Text="Notify" />
<Run
Text="Icon. The " />
<Run
FontStyle="Italic"
FontWeight="Bold"
Text="MenuActivation " /><Run
Text="property determines what mouse events open the context menu." /></TextBlock>
Text="MenuActivation " />
<Run
Text="property determines what mouse events open the context menu." />
</TextBlock>
<TextBlock
Margin="10,10,0,0"
VerticalAlignment="Top"
@@ -385,8 +453,10 @@
Width="Auto"
HorizontalAlignment="Left"
FontWeight="Bold"
TextDecorations="Underline"><Run
Text="Context Menu" /></TextBlock>
TextDecorations="Underline">
<Run
Text="Context Menu" />
</TextBlock>
</Grid>
<TextBlock
Margin="10,10,0,0"
@@ -395,8 +465,10 @@
TextWrapping="Wrap"
FontWeight="Bold"
FontSize="16"
HorizontalAlignment="Left"><Run
Text="WPF NotifyIcon" /></TextBlock>
HorizontalAlignment="Left">
<Run
Text="WPF NotifyIcon" />
</TextBlock>
<TextBlock
Margin="12,57.62,15.5,0"
VerticalAlignment="Top"
@@ -404,15 +476,24 @@
FontStyle="Italic"
Foreground="#FF303030"
TextWrapping="Wrap"
HorizontalAlignment="Stretch"><Run
Text="This " /><Run
Text="is a showcase of the different features of the WPF NotifyIcon. Have a look at the used controls and styles in order to see how binding can be supported. For a real-life " /><Run
Text="example" /><Run
Text=", " /><Run
HorizontalAlignment="Stretch">
<Run
Text="This " />
<Run
Text="is a showcase of the different features of the WPF NotifyIcon. Have a look at the used controls and styles in order to see how binding can be supported. For a real-life " />
<Run
Text="example" />
<Run
Text=", " />
<Run
Language="de-ch"
Text="check out " /><Hyperlink
NavigateUri="http://www.hardcodet.net/netdrives/"><Run
Text="NetDrives" /></Hyperlink></TextBlock>
Text="check out " />
<Hyperlink
NavigateUri="http://www.hardcodet.net/netdrives/">
<Run
Text="NetDrives" />
</Hyperlink>
</TextBlock>
<Grid
Margin="486.5,380.38,0,0"
x:Name="CustomBalloons"
@@ -446,19 +527,34 @@
Margin="10,35,24.377,0"
VerticalAlignment="Top"
TextWrapping="Wrap"
Height="119.68"><Run
Text="Custom " /><Run
Text="Balloons are much " /><Run
Text="ore flexible then standard balloons " /><Run
Text="tips " /><Run
Text="when it comes to styling." /><Run
Text=" You can display arbitrary UI Elements (e.g. User Controls) as custom balloons." /><LineBreak /><Run
Text="Apart from the richer UI, custom balloons also provide a" /><Run
Text="ttached properties and events that can be used to control behavior." /><Run
Text=" Custom balloons also work if the NotifyIcon is not visible." /><LineBreak /><Run
Text="(Hint: Hover over the " /><Run
Text="balloon " /><Run
Text="to suspend the fade-out.)" /></TextBlock>
Height="119.68">
<Run
Text="Custom " />
<Run
Text="Balloons are much " />
<Run
Text="ore flexible then standard balloons " />
<Run
Text="tips " />
<Run
Text="when it comes to styling." />
<Run
Text=" You can display arbitrary UI Elements (e.g. User Controls) as custom balloons." />
<LineBreak />
<Run
Text="Apart from the richer UI, custom balloons also provide a" />
<Run
Text="ttached properties and events that can be used to control behavior." />
<Run
Text=" Custom balloons also work if the NotifyIcon is not visible." />
<LineBreak />
<Run
Text="(Hint: Hover over the " />
<Run
Text="balloon " />
<Run
Text="to suspend the fade-out.)" />
</TextBlock>
<Button
Content="Close"
x:Name="hideCustomBalloon"
@@ -476,8 +572,10 @@
Height="Auto"
FontWeight="Bold"
TextDecorations="Underline"
TextWrapping="Wrap"><Run
Text="Custom Balloons" /></TextBlock>
TextWrapping="Wrap">
<Run
Text="Custom Balloons" />
</TextBlock>
</Grid>
<Grid
Margin="10,114.5,0,0"
@@ -525,8 +623,10 @@
Width="Auto"
TextWrapping="Wrap"
d:LayoutOverrides="Width"
HorizontalAlignment="Left"><Run
Text="Select an image to switch icons:" /></TextBlock>
HorizontalAlignment="Left">
<Run
Text="Select an image to switch icons:" />
</TextBlock>
<TextBlock
HorizontalAlignment="Left"
Margin="10,10,0,0"
@@ -535,8 +635,10 @@
Height="Auto"
FontWeight="Bold"
TextDecorations="Underline"
TextWrapping="Wrap"><Run
Text="Icon / Visibility" /></TextBlock>
TextWrapping="Wrap">
<Run
Text="Icon / Visibility" />
</TextBlock>
</Grid>
</Grid>
</Window>

View File

@@ -61,7 +61,6 @@ namespace Samples
}
private void showCustomBalloon_Click(object sender, RoutedEventArgs e)
{
FancyBalloon balloon = new FancyBalloon();

View File

@@ -68,26 +68,38 @@
FontSize="14"
FontWeight="Bold"
TextWrapping="Wrap"
HorizontalAlignment="Center"><Run
HorizontalAlignment="Center">
<Run
Text="WPF NotifyIcon - Sample Application"
Language="de-ch" /></TextBlock>
Language="de-ch" />
</TextBlock>
<TextBlock
Margin="10,38.62,10,0"
VerticalAlignment="Top"
TextWrapping="Wrap"
HorizontalAlignment="Left"><Run
Text="You should see this icon in your system tray:" /><Run
Text=" " /><InlineUIContainer>
HorizontalAlignment="Left">
<Run
Text="You should see this icon in your system tray:" />
<Run
Text=" " />
<InlineUIContainer>
<Image
Source="{Binding Path=IconSource}"
Width="16"
Height="16" />
</InlineUIContainer><LineBreak /><Run
Text="This is your NotifyIcon." /><LineBreak /><Run
Text="" /><LineBreak /><Run
</InlineUIContainer>
<LineBreak />
<Run
Text="This is your NotifyIcon." />
<LineBreak />
<Run
Text="" />
<LineBreak />
<Run
FontSize="10"
FontStyle="Italic"
Text="You can change the displayed icon by selecting another image in the sample window." /></TextBlock>
Text="You can change the displayed icon by selecting another image in the sample window." />
</TextBlock>
</Grid>
</UserControl>

View File

@@ -13,7 +13,9 @@
x:Name="MyNotifyIcon"
IconSource="/Icons/Error.ico"
ToolTipText="hello world" />
<TextBlock Margin="26,26,24,0" VerticalAlignment="Top" FontWeight="Bold" TextWrapping="Wrap"><Run Text="You should see an icon in the tray." Language="de-ch"/></TextBlock>
<TextBlock Margin="26,26,24,0" VerticalAlignment="Top" FontWeight="Bold" TextWrapping="Wrap">
<Run Text="You should see an icon in the tray." Language="de-ch" />
</TextBlock>
</Grid>
</Window>

View File

@@ -28,13 +28,14 @@
<TextBlock
Text="hello world"
HorizontalAlignment="Center"
VerticalAlignment="Center"
/>
VerticalAlignment="Center" />
</Border>
</tb:TaskbarIcon.TrayToolTip>
</tb:TaskbarIcon>
<TextBlock Margin="26,26,24,0" VerticalAlignment="Top" FontWeight="Bold" TextWrapping="Wrap"><Run Text="Move mouse over NotifyIcon to show ToolTip" Language="de-ch"/></TextBlock>
<TextBlock Margin="26,26,24,0" VerticalAlignment="Top" FontWeight="Bold" TextWrapping="Wrap">
<Run Text="Move mouse over NotifyIcon to show ToolTip" Language="de-ch" />
</TextBlock>
</Grid>
</Window>

View File

@@ -1,8 +1,7 @@
<UserControl
x:Class="Samples.Tutorials.ToolTips.SimpleUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- a simple user control which displays a fixed text within a border -->
<Border

View File

@@ -19,7 +19,9 @@
</tb:TaskbarIcon.TrayToolTip>
</tb:TaskbarIcon>
<TextBlock Margin="26,26,24,0" VerticalAlignment="Top" FontWeight="Bold" TextWrapping="Wrap"><Run Text="Move mouse over NotifyIcon to show ToolTip" Language="de-ch"/></TextBlock>
<TextBlock Margin="26,26,24,0" VerticalAlignment="Top" FontWeight="Bold" TextWrapping="Wrap">
<Run Text="Move mouse over NotifyIcon to show ToolTip" Language="de-ch" />
</TextBlock>
</Grid>
</Window>

View File

@@ -46,8 +46,10 @@
<TextBlock Margin="26,26,24,0"
VerticalAlignment="Top"
FontWeight="Bold"
TextWrapping="Wrap"><Run Language="de-ch"
Text="Right-click on NotifyIcon to open Context Menu" /></TextBlock>
TextWrapping="Wrap">
<Run Language="de-ch"
Text="Right-click on NotifyIcon to open Context Menu" />
</TextBlock>
<TextBlock HorizontalAlignment="Left"
Margin="26,83,0,0"
TextWrapping="Wrap"

View File

@@ -32,7 +32,7 @@ namespace Samples.Tutorials.ContextMenus
private void MyNotifyIcon_PreviewTrayContextMenuOpen(object sender, System.Windows.RoutedEventArgs e)
{
//marking the event as handled suppresses the context menu
e.Handled = (bool)SuppressContextMenu.IsChecked;
e.Handled = (bool) SuppressContextMenu.IsChecked;
PreviewOpenEventCounter.Text = (int.Parse(PreviewOpenEventCounter.Text) + 1).ToString();
}

View File

@@ -16,38 +16,35 @@
x:Name="btnShowStandardBalloon"
Click="btnShowStandardBalloon_Click"
Margin="26,74,29,0"
Content="Show Standard Balloon" Height="29" VerticalAlignment="Top"
/>
Content="Show Standard Balloon" Height="29" VerticalAlignment="Top" />
<Button
x:Name="btnShowCustomBalloon"
Click="btnShowCustomBalloon_Click"
Margin="26,0,29,49"
VerticalAlignment="Bottom"
Height="27"
Content="Show Custom Balloon"
/>
Content="Show Custom Balloon" />
<TextBlock
Margin="26,26,24,0"
VerticalAlignment="Top"
FontWeight="Bold"
TextWrapping="Wrap"><Run
TextWrapping="Wrap">
<Run
Language="de-ch"
Text="Clicking on buttons shows balloon tips" /></TextBlock>
Text="Clicking on buttons shows balloon tips" />
</TextBlock>
<Button
x:Name="btnHideStandardBalloon"
Click="btnHideStandardBalloon_Click"
Margin="26,113,29,122"
Content="Hide Standard Balloon"
/>
Content="Hide Standard Balloon" />
<Button
x:Name="btnCloseCustomBalloon"
Click="btnCloseCustomBalloon_Click"
Margin="26,0,29,12"
VerticalAlignment="Bottom"
Height="27"
Content="Close Custom Balloon"
/>
Content="Close Custom Balloon" />
</Grid>

View File

@@ -61,7 +61,5 @@ namespace Samples.Tutorials.Balloons
{
MyNotifyIcon.CloseBalloon();
}
}
}

View File

@@ -40,13 +40,19 @@
Margin="26,26,24,0"
VerticalAlignment="Top"
FontWeight="Bold"
TextWrapping="Wrap"><Run
TextWrapping="Wrap">
<Run
Language="de-ch"
Text="Left / Double clicks on red NotifyIcon executes simple custom commands." /></TextBlock>
Text="Left / Double clicks on red NotifyIcon executes simple custom commands." />
</TextBlock>
<TextBlock
Margin="26,112,24,80"
FontWeight="Bold"
TextWrapping="Wrap"><Run Language="de-ch" Text="Left / Double clicks on grey NotifyIcon executes routed commands."/><LineBreak/><Run Language="de-ch" Text="Single click: Cuts selected text"/><LineBreak/><Run Language="de-ch" Text="Double click: Paste text from clipboard"/></TextBlock>
TextWrapping="Wrap">
<Run Language="de-ch" Text="Left / Double clicks on grey NotifyIcon executes routed commands." />
<LineBreak /><Run Language="de-ch" Text="Single click: Cuts selected text" /><LineBreak />
<Run Language="de-ch" Text="Double click: Paste text from clipboard" />
</TextBlock>
<TextBox
Margin="26,0,24,48"
VerticalAlignment="Bottom"

View File

@@ -116,8 +116,6 @@
IconSource="/Icons/Error.ico" />
<Ellipse
HorizontalAlignment="Left"
Margin="24,62,0,0"
@@ -231,29 +229,37 @@
Margin="63,62,91,0"
VerticalAlignment="Top"
Height="19"
TextWrapping="Wrap"><Run
TextWrapping="Wrap">
<Run
Language="de-ch"
Text="TrayMouseMove Event" /></TextBlock>
Text="TrayMouseMove Event" />
</TextBlock>
<TextBlock
Margin="63,106,91,0"
VerticalAlignment="Top"
Height="19"
TextWrapping="Wrap"><Run
TextWrapping="Wrap">
<Run
Language="de-ch"
Text="TrayLeftMouseUp Event" /></TextBlock>
Text="TrayLeftMouseUp Event" />
</TextBlock>
<TextBlock
Margin="63,0,91,94"
TextWrapping="Wrap"
VerticalAlignment="Bottom"
Height="19"><Run
Height="19">
<Run
Language="de-ch"
Text="TrayToolTipOpen Event" /></TextBlock>
Text="TrayToolTipOpen Event" />
</TextBlock>
<TextBlock
Margin="10,10,10,0"
VerticalAlignment="Top"
Height="31"
TextWrapping="Wrap"
FontWeight="Bold"><Run Language="de-ch" Text="The green ellipses are animated based on routed events of the NotifyIcon"/></TextBlock>
FontWeight="Bold">
<Run Language="de-ch" Text="The green ellipses are animated based on routed events of the NotifyIcon" />
</TextBlock>
</Grid>
</Window>

View File

@@ -72,14 +72,16 @@
</tb:TaskbarIcon>
<TextBlock
Margin="26,26,24,0"
VerticalAlignment="Top"
TextWrapping="Wrap"
FontWeight="Bold"><Run Text="This sample shows data bound ToolTips in two flavors"/><LineBreak/><Run Text=""/><LineBreak/><Run Text="- implicit binding via DataContext"/><LineBreak/><Run Text="- explicit binding via ParentTaskbarIcon (attached property)"/><LineBreak/><Run Text=""/><LineBreak/><Run Text="Move over NotifyIcons (grey / red) to show data bound ToolTip"/></TextBlock>
FontWeight="Bold">
<Run Text="This sample shows data bound ToolTips in two flavors" /><LineBreak /><Run Text="" />
<LineBreak /><Run Text="- implicit binding via DataContext" /><LineBreak />
<Run Text="- explicit binding via ParentTaskbarIcon (attached property)" /><LineBreak /><Run Text="" />
<LineBreak /><Run Text="Move over NotifyIcons (grey / red) to show data bound ToolTip" />
</TextBlock>
<TextBox
Margin="26,0,24,10"
Text="hello world"
@@ -89,9 +91,11 @@
Margin="26,0,125,45"
VerticalAlignment="Bottom"
Height="26"
TextWrapping="Wrap"><Run
TextWrapping="Wrap">
<Run
Text="ToolTipText:" /></TextBlock>
Text="ToolTipText:" />
</TextBlock>
</Grid>
</Window>

View File

@@ -7,15 +7,16 @@
Width="300" x:Name="me">
<UserControl.Resources>
<Storyboard x:Key="RotateIcon">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
<SplineDoubleKeyFrame KeySpline="0,0.284,0.39,1" KeyTime="00:00:01.4000000" Value="360"/>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image"
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
<SplineDoubleKeyFrame KeySpline="0,0.284,0.39,1" KeyTime="00:00:01.4000000" Value="360" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</UserControl.Resources>
<UserControl.Triggers>
<EventTrigger RoutedEvent="tb:TaskbarIcon.PopupOpened">
<BeginStoryboard Storyboard="{StaticResource RotateIcon}" x:Name="RotateIcon_BeginStoryboard"/>
<BeginStoryboard Storyboard="{StaticResource RotateIcon}" x:Name="RotateIcon_BeginStoryboard" />
</EventTrigger>
</UserControl.Triggers>
<Grid>
@@ -50,13 +51,13 @@
Width="72"
Height="72"
Source="/Images/Preferences.png"
Stretch="Fill" x:Name="image" RenderTransformOrigin="0.5,0.5" >
Stretch="Fill" x:Name="image" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1"/>
<SkewTransform AngleX="0" AngleY="0"/>
<RotateTransform Angle="0"/>
<TranslateTransform X="0" Y="0"/>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="0" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Image.RenderTransform>
</Image>
@@ -67,9 +68,11 @@
VerticalAlignment="Top"
FontSize="16"
FontWeight="Bold"
Foreground="#FF575757" HorizontalAlignment="Right"><Run
Foreground="#FF575757" HorizontalAlignment="Right">
<Run
Text="This is a fancy Popup..."
Language="de-ch" /></TextBlock>
Language="de-ch" />
</TextBlock>
<Button
Click="OnButtonClick"
ToolTip="{Binding Path=ToolTipText}"
@@ -104,11 +107,23 @@
</Button>
<TextBlock
Margin="19,92,10,49"
TextWrapping="Wrap"><Run Text="This user control makes use of the " Language="de-ch"/><Run FontStyle="Italic" FontWeight="Bold" Text="PopupOpened " Language="de-ch"/><Run Text="attached routed event . Whenever the popup is opened, this attached event fires and triggers the rotation animation." Language="de-ch"/></TextBlock>
<TextBlock Margin="0,52,20,0" VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap" FontWeight="Bold" FontSize="14" HorizontalAlignment="Right" Foreground="#FF575757"><Run Text="Clicks: " Language="de-ch"/><InlineUIContainer>
<TextBlock Width="Auto" Height="Auto" Text="{Binding Path=ClickCount, ElementName=me, Mode=Default}" TextWrapping="Wrap"/>
</InlineUIContainer></TextBlock>
TextWrapping="Wrap">
<Run Text="This user control makes use of the " Language="de-ch" />
<Run FontStyle="Italic" FontWeight="Bold" Text="PopupOpened " Language="de-ch" />
<Run
Text="attached routed event . Whenever the popup is opened, this attached event fires and triggers the rotation animation."
Language="de-ch" />
</TextBlock>
<TextBlock Margin="0,52,20,0" VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap" FontWeight="Bold"
FontSize="14" HorizontalAlignment="Right" Foreground="#FF575757">
<Run Text="Clicks: " Language="de-ch" />
<InlineUIContainer>
<TextBlock Width="Auto" Height="Auto" Text="{Binding Path=ClickCount, ElementName=me, Mode=Default}"
TextWrapping="Wrap" />
</InlineUIContainer>
</TextBlock>
<Image
Source="{Binding Path=IconSource}" Width="16" HorizontalAlignment="Left" Margin="19,0,0,23" Height="16" VerticalAlignment="Bottom" />
Source="{Binding Path=IconSource}" Width="16" HorizontalAlignment="Left" Margin="19,0,0,23" Height="16"
VerticalAlignment="Bottom" />
</Grid>
</UserControl>

View File

@@ -4,13 +4,13 @@ using Samples;
namespace WindowsFormsSample
{
static class Program
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

View File

@@ -5,6 +5,7 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WindowsFormsSample")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
@@ -17,9 +18,11 @@ using System.Runtime.InteropServices;
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("072bbfa0-9b8b-48df-bf88-3e4806b3e3e8")]
// Version information for an assembly consists of the following four values:
@@ -32,5 +35,6 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,4 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />