Merge branch 'develop'
@@ -28,13 +28,13 @@ stages:
|
|||||||
|
|
||||||
- task: NuGetToolInstaller@1
|
- task: NuGetToolInstaller@1
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: '5.5.1'
|
versionSpec: '5.8.0'
|
||||||
|
|
||||||
- task: UseDotNet@2
|
- task: UseDotNet@2
|
||||||
displayName: 'Use .NET Core sdk 3.1.2'
|
displayName: 'Install .NET Core SDK 5.0'
|
||||||
inputs:
|
inputs:
|
||||||
packageType: sdk
|
packageType: sdk
|
||||||
version: 3.1.201
|
version: 5.0.100
|
||||||
|
|
||||||
- task: DotNetCoreCLI@2
|
- task: DotNetCoreCLI@2
|
||||||
displayName: Build
|
displayName: Build
|
||||||
@@ -57,7 +57,7 @@ stages:
|
|||||||
|
|
||||||
- task: NuGetCommand@2
|
- task: NuGetCommand@2
|
||||||
displayName: 'Publish to wpf-notifyicon feed'
|
displayName: 'Publish to wpf-notifyicon feed'
|
||||||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
|
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
|
||||||
inputs:
|
inputs:
|
||||||
command: 'push'
|
command: 'push'
|
||||||
versioningScheme: byBuildNumber
|
versioningScheme: byBuildNumber
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
hardcodet.net NotifyIcon for WPF - Changelog
|
hardcodet.net NotifyIcon for WPF - Changelog
|
||||||
Copyright (c) 2009-2020 Philipp Sumi
|
Copyright (c) 2009-2021 Philipp Sumi
|
||||||
Contact and Information: http://www.hardcodet.net
|
Contact and Information: http://www.hardcodet.net
|
||||||
|
|
||||||
1.0.9 (2020.xx.xx)
|
1.1.0 (2021.03.27)
|
||||||
*****
|
*****
|
||||||
|
|
||||||
ADD Added dotnet core 3.0 and 3.1 support
|
ADD Added dotnet core 3.1 and .Net 5 support.
|
||||||
|
ADD Added strong naming for assembly.
|
||||||
|
FIX When change dpi, the ContextMenu's position was wrong.
|
||||||
|
|
||||||
|
|
||||||
1.0.8 (2016.04.02)
|
1.0.8 (2016.04.02)
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
<TargetFrameworks>net45;net462;net472;netcoreapp3.1;net5.0-windows</TargetFrameworks>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
|
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
|
||||||
<IsSampleProject>$(MSBuildProjectName.Contains('Sample'))</IsSampleProject>
|
<IsSampleProject>$(MSBuildProjectName.Contains('Sample'))</IsSampleProject>
|
||||||
<Copyright>Copyright (c) 2009-2020 Philipp Sumi</Copyright>
|
<DebugSymbols>True</DebugSymbols>
|
||||||
|
<DebugType>embedded</DebugType>
|
||||||
|
|
||||||
|
<Copyright>Copyright (c) 2009-2021 Philipp Sumi</Copyright>
|
||||||
<Company>hardcodet.net</Company>
|
<Company>hardcodet.net</Company>
|
||||||
<Authors>Philipp Sumi</Authors>
|
<Authors>Philipp Sumi, Robin Krom, Jan Karger</Authors>
|
||||||
<PackageIcon>icon.png</PackageIcon>
|
<PackageIcon>icon.png</PackageIcon>
|
||||||
<RepositoryUrl>https://github.com/hardcodet/wpf-notifyicon</RepositoryUrl>
|
<RepositoryUrl>https://github.com/hardcodet/wpf-notifyicon</RepositoryUrl>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
@@ -18,7 +22,6 @@
|
|||||||
|
|
||||||
Source code and extensive sample application available at http://www.hardcodet.net/projects/wpf-notifyicon</Description>
|
Source code and extensive sample application available at http://www.hardcodet.net/projects/wpf-notifyicon</Description>
|
||||||
<Summary>NotifyIcon (aka system tray icon or taskbar icon) for the WPF platform.</Summary>
|
<Summary>NotifyIcon (aka system tray icon or taskbar icon) for the WPF platform.</Summary>
|
||||||
<language />
|
|
||||||
<tags>NotifyIcon WPF Tray Notify ToolTip Popup Balloon Toast</tags>
|
<tags>NotifyIcon WPF Tray Notify ToolTip Popup Balloon Toast</tags>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
@@ -27,18 +30,15 @@ Source code and extensive sample application available at http://www.hardcodet.n
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
|
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<DebugSymbols>True</DebugSymbols>
|
|
||||||
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
||||||
<DebugType>embedded</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
|
<ItemGroup>
|
||||||
<Optimize>true</Optimize>
|
<PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37">
|
||||||
<DebugType>embedded</DebugType>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<DebugSymbols>True</DebugSymbols>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
</PropertyGroup>
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<Choose>
|
<Choose>
|
||||||
<When Condition=" '$(IsSampleProject)' != 'true' ">
|
<When Condition=" '$(IsSampleProject)' != 'true' ">
|
||||||
@@ -48,11 +48,14 @@ Source code and extensive sample application available at http://www.hardcodet.n
|
|||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<SignAssembly>true</SignAssembly>
|
||||||
|
<AssemblyOriginatorKeyFile>..\NotifyIconWpf.snk</AssemblyOriginatorKeyFile>
|
||||||
|
<DelaySign>false</DelaySign>
|
||||||
|
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.91">
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
|
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
|
||||||
<None Include="$(SolutionDir)\icon.png" Pack="true" PackagePath="\"/>
|
<None Include="$(SolutionDir)\icon.png" Pack="true" PackagePath="\"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<Application x:Class="Samples.App"
|
<Application x:Class="NotifyIconWpf.Sample.ShowCases.App"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
StartupUri="Main.xaml">
|
StartupUri="Main.xaml">
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples
|
namespace NotifyIconWpf.Sample.ShowCases
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for App.xaml
|
/// Interaction logic for App.xaml
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Samples.Commands
|
namespace NotifyIconWpf.Sample.ShowCases.Commands
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Closes the current window.
|
/// Closes the current window.
|
||||||
@@ -6,7 +6,7 @@ using System.Windows.Markup;
|
|||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using Hardcodet.Wpf.TaskbarNotification;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
|
|
||||||
namespace Samples.Commands
|
namespace NotifyIconWpf.Sample.ShowCases.Commands
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Basic implementation of the <see cref="ICommand"/>
|
/// Basic implementation of the <see cref="ICommand"/>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Samples.Commands
|
namespace NotifyIconWpf.Sample.ShowCases.Commands
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Hides the main window.
|
/// Hides the main window.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Samples.Commands
|
namespace NotifyIconWpf.Sample.ShowCases.Commands
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows the main window.
|
/// Shows the main window.
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 502 B After Width: | Height: | Size: 502 B |
|
Before Width: | Height: | Size: 667 B After Width: | Height: | Size: 667 B |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 113 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 237 B |
@@ -1,5 +1,5 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Main"
|
x:Class="NotifyIconWpf.Sample.ShowCases.Main"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
Title="NotifyIcon Samples"
|
Title="NotifyIcon Samples"
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
FontSize="14"
|
FontSize="14"
|
||||||
FontStyle="Italic"
|
FontStyle="Italic"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
TextWrapping="Wrap" Text="WPF NotifyIcon 1.0.6 - Samples"/>
|
TextWrapping="Wrap" Text="{Binding Path=SampleTitle}"/>
|
||||||
<Button
|
<Button
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,133,0,0"
|
Margin="10,133,0,0"
|
||||||
@@ -38,8 +38,8 @@
|
|||||||
Width="164"
|
Width="164"
|
||||||
Height="27"
|
Height="27"
|
||||||
Content="NotifyIcon Declaration"
|
Content="NotifyIcon Declaration"
|
||||||
x:Name="btnDeclaration"
|
x:Name="BtnDeclaration"
|
||||||
Click="btnDeclaration_Click" />
|
Click="BtnDeclaration_Click" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,50,0,0"
|
Margin="10,50,0,0"
|
||||||
@@ -67,8 +67,8 @@
|
|||||||
Content="ToolTips - Inline Declaration"
|
Content="ToolTips - Inline Declaration"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Height="27"
|
Height="27"
|
||||||
x:Name="btnInlineToolTip"
|
x:Name="BtnInlineToolTip"
|
||||||
Click="btnInlineToolTip_Click" />
|
Click="BtnInlineToolTip_Click" />
|
||||||
<Button
|
<Button
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,244,0,0"
|
Margin="10,244,0,0"
|
||||||
@@ -76,8 +76,8 @@
|
|||||||
Content="Popups"
|
Content="Popups"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Height="27"
|
Height="27"
|
||||||
x:Name="btnPopups"
|
x:Name="BtnPopups"
|
||||||
Click="btnPopups_Click" />
|
Click="BtnPopups_Click" />
|
||||||
<Button
|
<Button
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,281,0,0"
|
Margin="10,281,0,0"
|
||||||
@@ -85,8 +85,8 @@
|
|||||||
Content="Context Menus"
|
Content="Context Menus"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Height="27"
|
Height="27"
|
||||||
x:Name="btnContextMenus"
|
x:Name="BtnContextMenus"
|
||||||
Click="btnContextMenus_Click" />
|
Click="BtnContextMenus_Click" />
|
||||||
<Button
|
<Button
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,318,0,0"
|
Margin="10,318,0,0"
|
||||||
@@ -94,8 +94,8 @@
|
|||||||
Content="Balloon Tips"
|
Content="Balloon Tips"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Height="27"
|
Height="27"
|
||||||
x:Name="btnBalloons"
|
x:Name="BtnBalloons"
|
||||||
Click="btnBalloons_Click" />
|
Click="BtnBalloons_Click" />
|
||||||
<Button
|
<Button
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,355,0,0"
|
Margin="10,355,0,0"
|
||||||
@@ -103,8 +103,8 @@
|
|||||||
Content="Commands"
|
Content="Commands"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Height="27"
|
Height="27"
|
||||||
x:Name="btnCommands"
|
x:Name="BtnCommands"
|
||||||
Click="btnCommands_Click" />
|
Click="BtnCommands_Click" />
|
||||||
<Button
|
<Button
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,207,0,0"
|
Margin="10,207,0,0"
|
||||||
@@ -112,8 +112,8 @@
|
|||||||
Content="ToolTip User Control"
|
Content="ToolTip User Control"
|
||||||
Height="27"
|
Height="27"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
x:Name="btnToolTipControl"
|
x:Name="BtnToolTipControl"
|
||||||
Click="btnToolTipControl_Click" />
|
Click="BtnToolTipControl_Click" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="255.31,50,0,0"
|
Margin="255.31,50,0,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
@@ -136,8 +136,8 @@
|
|||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Height="27"
|
Height="27"
|
||||||
Content="Open Sample Window"
|
Content="Open Sample Window"
|
||||||
x:Name="btnMainSample"
|
x:Name="BtnMainSample"
|
||||||
Click="btnMainSample_Click"
|
Click="BtnMainSample_Click"
|
||||||
Width="164"
|
Width="164"
|
||||||
HorizontalAlignment="Left" />
|
HorizontalAlignment="Left" />
|
||||||
<Path
|
<Path
|
||||||
@@ -207,8 +207,8 @@
|
|||||||
Content="Events"
|
Content="Events"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Height="27"
|
Height="27"
|
||||||
x:Name="btnEvents"
|
x:Name="BtnEvents"
|
||||||
Click="btnEvents_Click" Width="164" HorizontalAlignment="Left" />
|
Click="BtnEvents_Click" Width="164" HorizontalAlignment="Left" />
|
||||||
<Button
|
<Button
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,392,0,0"
|
Margin="10,392,0,0"
|
||||||
@@ -216,8 +216,8 @@
|
|||||||
Content="Data Binding"
|
Content="Data Binding"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Height="27"
|
Height="27"
|
||||||
x:Name="btnDataBinding"
|
x:Name="BtnDataBinding"
|
||||||
Click="btnDataBinding_Click" />
|
Click="BtnDataBinding_Click" />
|
||||||
<Button
|
<Button
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,429,0,0"
|
Margin="10,429,0,0"
|
||||||
@@ -225,8 +225,8 @@
|
|||||||
Content="MVVM"
|
Content="MVVM"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Height="27"
|
Height="27"
|
||||||
x:Name="btnMvvm"
|
x:Name="BtnMvvm"
|
||||||
Click="btnMvvm_Click" />
|
Click="BtnMvvm_Click" />
|
||||||
<Image Margin="562.24,-19,-41.24,440" Source="Images/Logo.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" Opacity="0.235">
|
<Image Margin="562.24,-19,-41.24,440" Source="Images/Logo.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" Opacity="0.235">
|
||||||
<Image.RenderTransform>
|
<Image.RenderTransform>
|
||||||
<TransformGroup>
|
<TransformGroup>
|
||||||
130
src/NotifyIconWpf.Sample.ShowCases/Main.xaml.cs
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Windows;
|
||||||
|
using NotifyIconWpf.Sample.ShowCases.Showcase;
|
||||||
|
using NotifyIconWpf.Sample.ShowCases.Tutorials;
|
||||||
|
|
||||||
|
namespace NotifyIconWpf.Sample.ShowCases
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for Main.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class Main : Window
|
||||||
|
{
|
||||||
|
public Main()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets <see cref="Window.WindowStartupLocation"/> and
|
||||||
|
/// <see cref="Window.Owner"/> properties of a dialog that
|
||||||
|
/// is about to be displayed.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="window">The processed window.</param>
|
||||||
|
private void ShowDialog(Window window)
|
||||||
|
{
|
||||||
|
window.Owner = this;
|
||||||
|
window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
||||||
|
window.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string Version
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var executingAssembly = Assembly.GetExecutingAssembly();
|
||||||
|
|
||||||
|
// Use assembly version
|
||||||
|
string version = executingAssembly.GetName().Version.ToString();
|
||||||
|
|
||||||
|
// Use AssemblyFileVersion if available
|
||||||
|
var assemblyFileVersionAttribute = executingAssembly.GetCustomAttribute<AssemblyFileVersionAttribute>();
|
||||||
|
if (!string.IsNullOrEmpty(assemblyFileVersionAttribute?.Version))
|
||||||
|
{
|
||||||
|
var assemblyFileVersion = new Version(assemblyFileVersionAttribute.Version);
|
||||||
|
version = assemblyFileVersion.ToString(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
return version.Replace("+", " - ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string SampleTitle { get; } = $"WPF NotifyIcon {Version} - Samples";
|
||||||
|
|
||||||
|
private void BtnDeclaration_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ShowDialog(new SimpleWindowWithNotifyIcon());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnInlineToolTip_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ShowDialog(new InlineToolTipWindow());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnToolTipControl_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ShowDialog(new UserControlToolTipWindow());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnPopups_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ShowDialog(new InlinePopupWindow());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnContextMenus_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ShowDialog(new InlineContextMenuWindow());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnBalloons_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ShowDialog(new BalloonSampleWindow());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnCommands_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ShowDialog(new CommandWindow());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnEvents_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ShowDialog(new EventVisualizerWindow());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnDataBinding_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ShowDialog(new DataBoundToolTipWindow());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnMvvm_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ShowDialog(new MvvmSampleWindow());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnMainSample_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var sampleWindow = new ShowcaseWindow
|
||||||
|
{
|
||||||
|
Owner = this,
|
||||||
|
WindowStartupLocation = WindowStartupLocation.CenterScreen
|
||||||
|
};
|
||||||
|
|
||||||
|
sampleWindow.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void OnNavigationRequest(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
|
||||||
|
{
|
||||||
|
Process.Start(new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = e.Uri.ToString(),
|
||||||
|
// UseShellExecute is default to false on .NET Core while true on .NET Framework.
|
||||||
|
// Only this value is set to true, the url link can be opened.
|
||||||
|
UseShellExecute = true
|
||||||
|
});
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
|
<GenerateResourceUsePreserializedResources Condition="'$(TargetFramework)' != 'net45'">true</GenerateResourceUsePreserializedResources>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\NotifyIconWpf\NotifyIconWpf.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup Condition="'$(TargetFramework)' != 'net45'">
|
||||||
|
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" PrivateAssets="All" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile DependentUpon="%(Filename)" SubType="Code" Update="**\obj\**\*.g$(DefaultLanguageSourceExtension)" />
|
||||||
|
<Compile DependentUpon="%(Filename)" SubType="Designer" Update="**\*.xaml$(DefaultLanguageSourceExtension)" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<UserControl x:Class="Samples.FancyBalloon"
|
<UserControl x:Class="NotifyIconWpf.Sample.ShowCases.Showcase.FancyBalloon"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
@@ -5,7 +5,7 @@ using System.Windows.Controls.Primitives;
|
|||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Hardcodet.Wpf.TaskbarNotification;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
|
|
||||||
namespace Samples
|
namespace NotifyIconWpf.Sample.ShowCases.Showcase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for FancyBalloon.xaml
|
/// Interaction logic for FancyBalloon.xaml
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
x:Class="Samples.FancyPopup"
|
x:Class="NotifyIconWpf.Sample.ShowCases.Showcase.FancyPopup"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace Samples
|
namespace NotifyIconWpf.Sample.ShowCases.Showcase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for FancyPopup.xaml
|
/// Interaction logic for FancyPopup.xaml
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
x:Class="Samples.FancyToolTip"
|
x:Class="NotifyIconWpf.Sample.ShowCases.Showcase.FancyToolTip"
|
||||||
x:Name="me"
|
x:Name="me"
|
||||||
Width="285"
|
Width="285"
|
||||||
Height="136">
|
Height="136">
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples
|
namespace NotifyIconWpf.Sample.ShowCases.Showcase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for FancyToolTip.xaml
|
/// Interaction logic for FancyToolTip.xaml
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary 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"
|
||||||
xmlns:Commands="clr-namespace:Samples.Commands"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar">
|
xmlns:commands="clr-namespace:NotifyIconWpf.Sample.ShowCases.Commands">
|
||||||
<LinearGradientBrush x:Key="MenuBackground"
|
<LinearGradientBrush x:Key="MenuBackground"
|
||||||
EndPoint="0.5,1"
|
EndPoint="0.5,1"
|
||||||
StartPoint="0.5,0">
|
StartPoint="0.5,0">
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
|
||||||
<MenuItem Header="Show Showcase Window"
|
<MenuItem Header="Show Showcase Window"
|
||||||
Command="{Commands:ShowSampleWindowCommand}"
|
Command="{commands:ShowSampleWindowCommand}"
|
||||||
CommandParameter="{Binding}">
|
CommandParameter="{Binding}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16"
|
<Image Width="16"
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
<Separator />
|
<Separator />
|
||||||
|
|
||||||
<MenuItem Header="Hide Showcase Window"
|
<MenuItem Header="Hide Showcase Window"
|
||||||
Command="{Commands:HideSampleWindowCommand}"
|
Command="{commands:HideSampleWindowCommand}"
|
||||||
CommandParameter="{Binding}">
|
CommandParameter="{Binding}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16"
|
<Image Width="16"
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.ShowcaseWindow"
|
x:Class="NotifyIconWpf.Sample.ShowCases.Showcase.ShowcaseWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
@@ -10,8 +10,8 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
xmlns:local="clr-namespace:Samples"
|
xmlns:commands="clr-namespace:NotifyIconWpf.Sample.ShowCases.Commands"
|
||||||
xmlns:Commands="clr-namespace:Samples.Commands"
|
xmlns:showcase="clr-namespace:NotifyIconWpf.Sample.ShowCases.Showcase"
|
||||||
MinWidth="750"
|
MinWidth="750"
|
||||||
MinHeight="800"
|
MinHeight="800"
|
||||||
ResizeMode="NoResize">
|
ResizeMode="NoResize">
|
||||||
@@ -68,17 +68,17 @@
|
|||||||
Visibility="{Binding Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=iconVisibility, Mode=Default}"
|
Visibility="{Binding Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=iconVisibility, Mode=Default}"
|
||||||
MenuActivation="{Binding Path=SelectedItem, ElementName=lstMenuTrigger, Mode=Default}"
|
MenuActivation="{Binding Path=SelectedItem, ElementName=lstMenuTrigger, Mode=Default}"
|
||||||
PopupActivation="{Binding Path=SelectedItem, ElementName=lstPopupTrigger, Mode=Default}"
|
PopupActivation="{Binding Path=SelectedItem, ElementName=lstPopupTrigger, Mode=Default}"
|
||||||
DoubleClickCommand="{Commands:ShowSampleWindowCommand}"
|
DoubleClickCommand="{commands:ShowSampleWindowCommand}"
|
||||||
DoubleClickCommandParameter="{Binding RelativeSource={RelativeSource Self}}">
|
DoubleClickCommandParameter="{Binding RelativeSource={RelativeSource Self}}">
|
||||||
|
|
||||||
<tb:TaskbarIcon.TrayPopup>
|
<tb:TaskbarIcon.TrayPopup>
|
||||||
<!-- the control will be put into a popup with an explicit DataContext -->
|
<!-- the control will be put into a popup with an explicit DataContext -->
|
||||||
<local:FancyPopup />
|
<showcase:FancyPopup />
|
||||||
</tb:TaskbarIcon.TrayPopup>
|
</tb:TaskbarIcon.TrayPopup>
|
||||||
|
|
||||||
<tb:TaskbarIcon.TrayToolTip>
|
<tb:TaskbarIcon.TrayToolTip>
|
||||||
<!-- the control will be put into a tooltip with an explicit DataContext -->
|
<!-- the control will be put into a tooltip with an explicit DataContext -->
|
||||||
<local:FancyToolTip
|
<showcase:FancyToolTip
|
||||||
Opacity="0.85"
|
Opacity="0.85"
|
||||||
InfoText="{Binding Path=ToolTipText}" />
|
InfoText="{Binding Path=ToolTipText}" />
|
||||||
</tb:TaskbarIcon.TrayToolTip>
|
</tb:TaskbarIcon.TrayToolTip>
|
||||||
@@ -4,7 +4,7 @@ using System.Windows.Controls.Primitives;
|
|||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using Hardcodet.Wpf.TaskbarNotification;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
|
|
||||||
namespace Samples
|
namespace NotifyIconWpf.Sample.ShowCases.Showcase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for ShowcaseWindow.xaml
|
/// Interaction logic for ShowcaseWindow.xaml
|
||||||
@@ -77,7 +77,13 @@ namespace Samples
|
|||||||
|
|
||||||
private void OnNavigationRequest(object sender, RequestNavigateEventArgs e)
|
private void OnNavigationRequest(object sender, RequestNavigateEventArgs e)
|
||||||
{
|
{
|
||||||
Process.Start(e.Uri.ToString());
|
Process.Start(new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = e.Uri.ToString(),
|
||||||
|
// UseShellExecute is default to false on .NET Core while true on .NET Framework.
|
||||||
|
// Only this value is set to true, the url link can be opened.
|
||||||
|
UseShellExecute = true
|
||||||
|
});
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
x:Class="Samples.WelcomeBalloon"
|
x:Class="NotifyIconWpf.Sample.ShowCases.Showcase.WelcomeBalloon"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace Samples
|
namespace NotifyIconWpf.Sample.ShowCases.Showcase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for WelcomeBalloon.xaml
|
/// Interaction logic for WelcomeBalloon.xaml
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Tutorials.SimpleWindowWithNotifyIcon"
|
x:Class="NotifyIconWpf.Sample.ShowCases.Tutorials.SimpleWindowWithNotifyIcon"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples.Tutorials
|
namespace NotifyIconWpf.Sample.ShowCases.Tutorials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for SimpleWindowWithNotifyIcon.xaml
|
/// Interaction logic for SimpleWindowWithNotifyIcon.xaml
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Tutorials.ToolTips.InlineToolTipWindow"
|
x:Class="NotifyIconWpf.Sample.ShowCases.Tutorials.InlineToolTipWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples.Tutorials.ToolTips
|
namespace NotifyIconWpf.Sample.ShowCases.Tutorials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for Window1.xaml
|
/// Interaction logic for Window1.xaml
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
x:Class="Samples.Tutorials.ToolTips.SimpleUserControl"
|
x:Class="NotifyIconWpf.Sample.ShowCases.Tutorials.SimpleUserControl"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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">
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace Samples.Tutorials.ToolTips
|
namespace NotifyIconWpf.Sample.ShowCases.Tutorials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for SimpleUserControl.xaml
|
/// Interaction logic for SimpleUserControl.xaml
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Tutorials.ToolTips.UserControlToolTipWindow"
|
x:Class="NotifyIconWpf.Sample.ShowCases.Tutorials.UserControlToolTipWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
xmlns:local="clr-namespace:Samples.Tutorials.ToolTips"
|
xmlns:tutorials="clr-namespace:NotifyIconWpf.Sample.ShowCases.Tutorials"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="300">
|
Width="300">
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<!-- assign user control as ToolTip -->
|
<!-- assign user control as ToolTip -->
|
||||||
<tb:TaskbarIcon.TrayToolTip>
|
<tb:TaskbarIcon.TrayToolTip>
|
||||||
<local:SimpleUserControl />
|
<tutorials:SimpleUserControl />
|
||||||
</tb:TaskbarIcon.TrayToolTip>
|
</tb:TaskbarIcon.TrayToolTip>
|
||||||
|
|
||||||
</tb:TaskbarIcon>
|
</tb:TaskbarIcon>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples.Tutorials.ToolTips
|
namespace NotifyIconWpf.Sample.ShowCases.Tutorials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for UserControlToolTipWindow.xaml
|
/// Interaction logic for UserControlToolTipWindow.xaml
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Tutorials.Popups.InlinePopupWindow"
|
x:Class="NotifyIconWpf.Sample.ShowCases.Tutorials.InlinePopupWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
xmlns:commands="clr-namespace:Samples.Commands"
|
xmlns:commands="clr-namespace:NotifyIconWpf.Sample.ShowCases.Commands"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="300">
|
Width="300">
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples.Tutorials.Popups
|
namespace NotifyIconWpf.Sample.ShowCases.Tutorials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for InlinePopupWindow.xaml
|
/// Interaction logic for InlinePopupWindow.xaml
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<Window x:Class="Samples.Tutorials.ContextMenus.InlineContextMenuWindow"
|
<Window x:Class="NotifyIconWpf.Sample.ShowCases.Tutorials.InlineContextMenuWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
xmlns:commands="clr-namespace:Samples.Commands"
|
xmlns:commands="clr-namespace:NotifyIconWpf.Sample.ShowCases.Commands"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="300">
|
Width="300">
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples.Tutorials.ContextMenus
|
namespace NotifyIconWpf.Sample.ShowCases.Tutorials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for InlineContextMenuWindow.xaml
|
/// Interaction logic for InlineContextMenuWindow.xaml
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Tutorials.Balloons.BalloonSampleWindow"
|
x:Class="NotifyIconWpf.Sample.ShowCases.Tutorials.BalloonSampleWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls.Primitives;
|
using System.Windows.Controls.Primitives;
|
||||||
|
using NotifyIconWpf.Sample.ShowCases.Showcase;
|
||||||
|
|
||||||
namespace Samples.Tutorials.Balloons
|
namespace NotifyIconWpf.Sample.ShowCases.Tutorials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for BalloonSampleWindow.xaml
|
/// Interaction logic for BalloonSampleWindow.xaml
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Tutorials.Commands.CommandWindow"
|
x:Class="NotifyIconWpf.Sample.ShowCases.Tutorials.CommandWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
xmlns:local="clr-namespace:Samples.Tutorials.Commands"
|
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="300"
|
Width="300"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:tutorials="clr-namespace:NotifyIconWpf.Sample.ShowCases.Tutorials"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|
||||||
<!-- declare the command as a local resource -->
|
<!-- declare the command as a local resource -->
|
||||||
<Grid.Resources>
|
<Grid.Resources>
|
||||||
<local:ShowMessageCommand
|
<tutorials:ShowMessageCommand
|
||||||
x:Key="MessageCommand" />
|
x:Key="MessageCommand" />
|
||||||
</Grid.Resources>
|
</Grid.Resources>
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples.Tutorials.Commands
|
namespace NotifyIconWpf.Sample.ShowCases.Tutorials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for CommandWindow.xaml
|
/// Interaction logic for CommandWindow.xaml
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Samples.Tutorials.Commands
|
namespace NotifyIconWpf.Sample.ShowCases.Tutorials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A simple command that displays the command parameter as
|
/// A simple command that displays the command parameter as
|
||||||
@@ -20,6 +20,10 @@ namespace Samples.Tutorials.Commands
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public event EventHandler CanExecuteChanged;
|
public event EventHandler CanExecuteChanged
|
||||||
|
{
|
||||||
|
add => CommandManager.RequerySuggested += value;
|
||||||
|
remove => CommandManager.RequerySuggested -= value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Tutorials.Events.EventVisualizerWindow"
|
x:Class="NotifyIconWpf.Sample.ShowCases.Tutorials.EventVisualizerWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples.Tutorials.Events
|
namespace NotifyIconWpf.Sample.ShowCases.Tutorials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for EventVisualizerWindow.xaml
|
/// Interaction logic for EventVisualizerWindow.xaml
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<Window x:Class="Samples.Tutorials.DataBinding.DataBoundToolTipWindow"
|
<Window x:Class="NotifyIconWpf.Sample.ShowCases.Tutorials.DataBoundToolTipWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
<!-- the ToolTipText property is bound to the TextBox below -->
|
<!-- the ToolTipText property is bound to the TextBox below -->
|
||||||
<tb:TaskbarIcon x:Name="MyNotifyIcon1"
|
<tb:TaskbarIcon x:Name="MyNotifyIcon1"
|
||||||
IconSource="/Icons/Error.ico"
|
IconSource="/Icons/Error.ico"
|
||||||
ToolTipText="{Binding ElementName=txtToolTip, Path=Text}">
|
ToolTipText="{Binding ElementName=TxtToolTip, Path=Text}">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
The TextBlock bound to the ToolTipText property of the NotifyIcon
|
The TextBlock bound to the ToolTipText property of the NotifyIcon
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
<tb:TaskbarIcon x:Name="MyNotifyIcon2"
|
<tb:TaskbarIcon x:Name="MyNotifyIcon2"
|
||||||
DataContext="WPF FTW "
|
DataContext="WPF FTW "
|
||||||
IconSource="/Icons/Inactive.ico"
|
IconSource="/Icons/Inactive.ico"
|
||||||
ToolTipText="{Binding ElementName=txtToolTip, Path=Text}">
|
ToolTipText="{Binding ElementName=TxtToolTip, Path=Text}">
|
||||||
|
|
||||||
<tb:TaskbarIcon.TrayToolTip>
|
<tb:TaskbarIcon.TrayToolTip>
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
<TextBox Margin="26,0,24,10"
|
<TextBox Margin="26,0,24,10"
|
||||||
Text="hello world"
|
Text="hello world"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
x:Name="txtToolTip"
|
x:Name="TxtToolTip"
|
||||||
Height="25"
|
Height="25"
|
||||||
VerticalAlignment="Bottom" />
|
VerticalAlignment="Bottom" />
|
||||||
<TextBlock Margin="26,0,125,45"
|
<TextBlock Margin="26,0,125,45"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples.Tutorials.DataBinding
|
namespace NotifyIconWpf.Sample.ShowCases.Tutorials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for DataBoundToolTipWindow.xaml
|
/// Interaction logic for DataBoundToolTipWindow.xaml
|
||||||
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
@@ -3,7 +3,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
x:Class="Samples.Tutorials.MvvmSample.ClockPopup"
|
x:Class="NotifyIconWpf.Sample.ShowCases.Tutorials.ClockPopup"
|
||||||
x:Name="UserControl"
|
x:Name="UserControl"
|
||||||
Height="141"
|
Height="141"
|
||||||
Width="304">
|
Width="304">
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace Samples.Tutorials.MvvmSample
|
namespace NotifyIconWpf.Sample.ShowCases.Tutorials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for ClockPopup.xaml
|
/// Interaction logic for ClockPopup.xaml
|
||||||
@@ -3,7 +3,7 @@ using System.ComponentModel;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
|
|
||||||
namespace Samples.Tutorials.MvvmSample
|
namespace NotifyIconWpf.Sample.ShowCases.Tutorials
|
||||||
{
|
{
|
||||||
public class MvvmSampleViewModel : INotifyPropertyChanged
|
public class MvvmSampleViewModel : INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
<Window x:Class="Samples.Tutorials.MvvmSample.MvvmSampleWindow"
|
<Window x:Class="NotifyIconWpf.Sample.ShowCases.Tutorials.MvvmSampleWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:local="clr-namespace:Samples.Tutorials.MvvmSample"
|
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
|
xmlns:tutorials="clr-namespace:NotifyIconWpf.Sample.ShowCases.Tutorials"
|
||||||
Title="MvvmSampleWindow"
|
Title="MvvmSampleWindow"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="300">
|
Width="300">
|
||||||
<Window.DataContext>
|
<Window.DataContext>
|
||||||
<local:MvvmSampleViewModel />
|
<tutorials:MvvmSampleViewModel />
|
||||||
</Window.DataContext>
|
</Window.DataContext>
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
ToolTipText="{Binding Timestamp}">
|
ToolTipText="{Binding Timestamp}">
|
||||||
<tb:TaskbarIcon.TrayPopup >
|
<tb:TaskbarIcon.TrayPopup >
|
||||||
<!-- the popup, here a custom user control, will also get the DataContext of the NotifyIcon -->
|
<!-- the popup, here a custom user control, will also get the DataContext of the NotifyIcon -->
|
||||||
<local:ClockPopup Opacity="0.8" />
|
<tutorials:ClockPopup Opacity="0.8" />
|
||||||
</tb:TaskbarIcon.TrayPopup>
|
</tb:TaskbarIcon.TrayPopup>
|
||||||
</tb:TaskbarIcon>
|
</tb:TaskbarIcon>
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples.Tutorials.MvvmSample
|
namespace NotifyIconWpf.Sample.ShowCases.Tutorials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for MvvmSampleWindow.xaml
|
/// Interaction logic for MvvmSampleWindow.xaml
|
||||||
6
src/NotifyIconWpf.Sample.ShowCases/app.config
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<System.Windows.Forms.ApplicationConfigurationSection>
|
||||||
|
<add key="DpiAwareness" value="PerMonitorV2" />
|
||||||
|
</System.Windows.Forms.ApplicationConfigurationSection>
|
||||||
|
</configuration>
|
||||||
45
src/NotifyIconWpf.Sample.ShowCases/app.manifest
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<!-- Make sure windows Vista and above treat Greenshot as "DPI Aware" See: http://msdn.microsoft.com/en-us/library/ms633543.aspx -->
|
||||||
|
<asmv3:application>
|
||||||
|
<asmv3:windowsSettings>
|
||||||
|
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
|
||||||
|
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2,PerMonitor</dpiAwareness>
|
||||||
|
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
||||||
|
<gdiScaling xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">false</gdiScaling>
|
||||||
|
</asmv3:windowsSettings>
|
||||||
|
</asmv3:application>
|
||||||
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
|
<application>
|
||||||
|
<!-- Windows 10 -->
|
||||||
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||||
|
<maxversiontested Id="10.0.18363.0"/>
|
||||||
|
<!-- Windows 8.1 -->
|
||||||
|
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
|
||||||
|
<!--Windows 8 -->
|
||||||
|
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
|
||||||
|
<!-- Windows 7 -->
|
||||||
|
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
|
||||||
|
</application>
|
||||||
|
</compatibility>
|
||||||
|
<!-- Set UAC level to "asInvoker" and disable registry virtualization -->
|
||||||
|
<asmv2:trustInfo>
|
||||||
|
<asmv2:security>
|
||||||
|
<asmv3:requestedPrivileges>
|
||||||
|
<!--
|
||||||
|
The presence of the "requestedExecutionLevel" node will disable
|
||||||
|
file and registry virtualization on Vista. See:
|
||||||
|
http://msdn.microsoft.com/en-us/library/aa965884%28v=vs.85%29.aspx
|
||||||
|
|
||||||
|
Use the "level" attribute to specify the User Account Control level:
|
||||||
|
asInvoker = Never prompt for elevation
|
||||||
|
requireAdministrator = Always prompt for elevation
|
||||||
|
highestAvailable = Prompt for elevation when started by administrator,
|
||||||
|
but do not prompt for administrator password when started by
|
||||||
|
standard user.
|
||||||
|
-->
|
||||||
|
<asmv3:requestedExecutionLevel level="asInvoker" />
|
||||||
|
</asmv3:requestedPrivileges>
|
||||||
|
</asmv2:security>
|
||||||
|
</asmv2:trustInfo>
|
||||||
|
</assembly>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<Application x:Class="Windowless_Sample.App"
|
<Application x:Class="NotifyIconWpf.Sample.Windowless.App"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
ShutdownMode="OnExplicitShutdown">
|
ShutdownMode="OnExplicitShutdown">
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using Hardcodet.Wpf.TaskbarNotification;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
|
|
||||||
namespace Windowless_Sample
|
namespace NotifyIconWpf.Sample.Windowless
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Simple application. Check the XAML for comments.
|
/// Simple application. Check the XAML for comments.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Windowless_Sample
|
namespace NotifyIconWpf.Sample.Windowless
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Simplistic delegate command for the demo.
|
/// Simplistic delegate command for the demo.
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<Window x:Class="Windowless_Sample.MainWindow"
|
<Window x:Class="NotifyIconWpf.Sample.Windowless.MainWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
Title="MainWindow" Height="350" Width="525">
|
Title="MainWindow" Height="350" Width="525">
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Windowless_Sample
|
namespace NotifyIconWpf.Sample.Windowless
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for MainWindow.xaml
|
/// Interaction logic for MainWindow.xaml
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary 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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
xmlns:local="clr-namespace:Windowless_Sample">
|
xmlns:local="clr-namespace:NotifyIconWpf.Sample.Windowless">
|
||||||
|
|
||||||
<!-- The taskbar context menu - the first row is a dummy to show off simple data binding -->
|
<!-- The taskbar context menu - the first row is a dummy to show off simple data binding -->
|
||||||
<!--
|
<!--
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Windowless_Sample
|
namespace NotifyIconWpf.Sample.Windowless
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides bindable properties and commands for the NotifyIcon. In this sample, the
|
/// Provides bindable properties and commands for the NotifyIcon. In this sample, the
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\NotifyIconWpf\NotifyIconWpf.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile DependentUpon="%(Filename)" SubType="Code" Update="**\obj\**\*.g$(DefaultLanguageSourceExtension)" />
|
||||||
|
<Compile DependentUpon="%(Filename)" SubType="Designer" Update="**\*.xaml$(DefaultLanguageSourceExtension)" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
6
src/NotifyIconWpf.Sample.Windowless/app.config
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<System.Windows.Forms.ApplicationConfigurationSection>
|
||||||
|
<add key="DpiAwareness" value="PerMonitorV2" />
|
||||||
|
</System.Windows.Forms.ApplicationConfigurationSection>
|
||||||
|
</configuration>
|
||||||
45
src/NotifyIconWpf.Sample.Windowless/app.manifest
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<!-- Make sure windows Vista and above treat Greenshot as "DPI Aware" See: http://msdn.microsoft.com/en-us/library/ms633543.aspx -->
|
||||||
|
<asmv3:application>
|
||||||
|
<asmv3:windowsSettings>
|
||||||
|
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
|
||||||
|
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2,PerMonitor</dpiAwareness>
|
||||||
|
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
||||||
|
<gdiScaling xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">false</gdiScaling>
|
||||||
|
</asmv3:windowsSettings>
|
||||||
|
</asmv3:application>
|
||||||
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
|
<application>
|
||||||
|
<!-- Windows 10 -->
|
||||||
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||||
|
<maxversiontested Id="10.0.18363.0"/>
|
||||||
|
<!-- Windows 8.1 -->
|
||||||
|
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
|
||||||
|
<!--Windows 8 -->
|
||||||
|
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
|
||||||
|
<!-- Windows 7 -->
|
||||||
|
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
|
||||||
|
</application>
|
||||||
|
</compatibility>
|
||||||
|
<!-- Set UAC level to "asInvoker" and disable registry virtualization -->
|
||||||
|
<asmv2:trustInfo>
|
||||||
|
<asmv2:security>
|
||||||
|
<asmv3:requestedPrivileges>
|
||||||
|
<!--
|
||||||
|
The presence of the "requestedExecutionLevel" node will disable
|
||||||
|
file and registry virtualization on Vista. See:
|
||||||
|
http://msdn.microsoft.com/en-us/library/aa965884%28v=vs.85%29.aspx
|
||||||
|
|
||||||
|
Use the "level" attribute to specify the User Account Control level:
|
||||||
|
asInvoker = Never prompt for elevation
|
||||||
|
requireAdministrator = Always prompt for elevation
|
||||||
|
highestAvailable = Prompt for elevation when started by administrator,
|
||||||
|
but do not prompt for administrator password when started by
|
||||||
|
standard user.
|
||||||
|
-->
|
||||||
|
<asmv3:requestedExecutionLevel level="asInvoker" />
|
||||||
|
</asmv3:requestedPrivileges>
|
||||||
|
</asmv2:security>
|
||||||
|
</asmv2:trustInfo>
|
||||||
|
</assembly>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
x:Class="Samples.FancyPopup"
|
x:Class="NotifyIconWpf.Sample.WindowsForms.FancyPopup"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples
|
namespace NotifyIconWpf.Sample.WindowsForms
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for FancyPopup.xaml
|
/// Interaction logic for FancyPopup.xaml
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace WindowsFormsSample
|
namespace NotifyIconWpf.Sample.WindowsForms
|
||||||
{
|
{
|
||||||
partial class Form1
|
partial class Form1
|
||||||
{
|
{
|
||||||
@@ -2,10 +2,9 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Hardcodet.Wpf.TaskbarNotification;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
using Samples;
|
using NotifyIconWpf.Sample.WindowsForms.Properties;
|
||||||
using WindowsFormsSample.Properties;
|
|
||||||
|
|
||||||
namespace WindowsFormsSample
|
namespace NotifyIconWpf.Sample.WindowsForms
|
||||||
{
|
{
|
||||||
public partial class Form1 : Form
|
public partial class Form1 : Form
|
||||||
{
|
{
|
||||||
@@ -19,12 +18,14 @@ namespace WindowsFormsSample
|
|||||||
protected override void OnLoad(EventArgs e)
|
protected override void OnLoad(EventArgs e)
|
||||||
{
|
{
|
||||||
base.OnLoad(e);
|
base.OnLoad(e);
|
||||||
notifyIcon = new TaskbarIcon();
|
notifyIcon = new TaskbarIcon
|
||||||
notifyIcon.Icon = Resources.Led;
|
{
|
||||||
notifyIcon.ToolTipText = "Left-click to open popup";
|
Icon = Resources.Led,
|
||||||
notifyIcon.Visibility = Visibility.Visible;
|
ToolTipText = "Left-click to open popup",
|
||||||
|
Visibility = Visibility.Visible,
|
||||||
|
TrayPopup = new FancyPopup()
|
||||||
|
};
|
||||||
|
|
||||||
notifyIcon.TrayPopup = new FancyPopup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClosed(EventArgs e)
|
protected override void OnClosed(EventArgs e)
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
@@ -1,28 +1,19 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
<TargetFrameworks>net462;net472;netcoreapp3.1;net5.0-windows</TargetFrameworks>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
<StartupObject>WindowsFormsSample.Program</StartupObject>
|
<GenerateResourceUsePreserializedResources Condition="'$(TargetFramework)' != 'net45'">true</GenerateResourceUsePreserializedResources>
|
||||||
<AssemblyTitle>WindowsFormsSample</AssemblyTitle>
|
|
||||||
<Product>WindowsFormsSample</Product>
|
|
||||||
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\NotifyIconWpf\NotifyIconWpf.csproj" />
|
<ProjectReference Include="..\NotifyIconWpf\NotifyIconWpf.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' != 'net45'">
|
<ItemGroup Condition="'$(TargetFramework)' != 'net45'">
|
||||||
<PackageReference Include="System.Resources.Extensions" Version="4.7.0" PrivateAssets="All"/>
|
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
|
|
||||||
<Reference Include="PresentationCore" />
|
|
||||||
<Reference Include="PresentationFramework" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="System.Deployment" />
|
|
||||||
<Reference Include="System.Xaml" />
|
|
||||||
<Reference Include="System.Windows.Forms" />
|
|
||||||
<Reference Include="UIAutomationProvider" />
|
|
||||||
<Reference Include="WindowsBase" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Update="Form1.cs">
|
<Compile Update="Form1.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
@@ -30,36 +21,26 @@
|
|||||||
<Compile Update="Form1.Designer.cs">
|
<Compile Update="Form1.Designer.cs">
|
||||||
<DependentUpon>Form1.cs</DependentUpon>
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Update="Properties\Resources.Designer.cs">
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<EmbeddedResource Update="Form1.resx">
|
<EmbeddedResource Update="Form1.resx">
|
||||||
<DependentUpon>Form1.cs</DependentUpon>
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Update="Properties\Resources.resx">
|
<EmbeddedResource Update="Properties\Resources.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<Compile Update="Properties\Resources.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
|
||||||
<DesignTime>True</DesignTime>
|
|
||||||
</Compile>
|
|
||||||
<Compile Update="Properties\Settings.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile DependentUpon="%(Filename)" Update="**\*.xaml.cs" />
|
<Compile DependentUpon="%(Filename)" Update="**\*.xaml.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile DependentUpon="%(Filename)" SubType="Code" Update="**\obj\**\*.g$(DefaultLanguageSourceExtension)" />
|
<Compile DependentUpon="%(Filename)" SubType="Code" Update="**\obj\**\*.g$(DefaultLanguageSourceExtension)" />
|
||||||
<Compile DependentUpon="%(Filename)" SubType="Designer" Update="**\*.xaml$(DefaultLanguageSourceExtension)" />
|
<Compile DependentUpon="%(Filename)" SubType="Designer" Update="**\*.xaml$(DefaultLanguageSourceExtension)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<None Update="Properties\Settings.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace WindowsFormsSample
|
namespace NotifyIconWpf.Sample.WindowsForms
|
||||||
{
|
{
|
||||||
internal static class Program
|
internal static class Program
|
||||||
{
|
{
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:4.0.30319.18408
|
// Runtime Version:4.0.30319.42000
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace WindowsFormsSample.Properties {
|
namespace NotifyIconWpf.Sample.WindowsForms.Properties {
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ namespace WindowsFormsSample.Properties {
|
|||||||
// class via a tool like ResGen or Visual Studio.
|
// class via a tool like ResGen or Visual Studio.
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
// with the /str option, or rebuild your VS project.
|
// with the /str option, or rebuild your VS project.
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Resources {
|
internal class Resources {
|
||||||
@@ -39,7 +39,7 @@ namespace WindowsFormsSample.Properties {
|
|||||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
get {
|
get {
|
||||||
if (object.ReferenceEquals(resourceMan, null)) {
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsFormsSample.Properties.Resources", typeof(Resources).Assembly);
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NotifyIconWpf.Sample.WindowsForms.Properties.Resources", typeof(Resources).Assembly);
|
||||||
resourceMan = temp;
|
resourceMan = temp;
|
||||||
}
|
}
|
||||||
return resourceMan;
|
return resourceMan;
|
||||||
@@ -112,13 +112,13 @@
|
|||||||
<value>2.0</value>
|
<value>2.0</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="reader">
|
<resheader name="reader">
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
<data name="Led" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="Led" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\icon\led.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Icon\Led.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
6
src/NotifyIconWpf.Sample.WindowsForms/app.config
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<System.Windows.Forms.ApplicationConfigurationSection>
|
||||||
|
<add key="DpiAwareness" value="PerMonitorV2" />
|
||||||
|
</System.Windows.Forms.ApplicationConfigurationSection>
|
||||||
|
</configuration>
|
||||||
45
src/NotifyIconWpf.Sample.WindowsForms/app.manifest
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<!-- Make sure windows Vista and above treat Greenshot as "DPI Aware" See: http://msdn.microsoft.com/en-us/library/ms633543.aspx -->
|
||||||
|
<asmv3:application>
|
||||||
|
<asmv3:windowsSettings>
|
||||||
|
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
|
||||||
|
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2,PerMonitor</dpiAwareness>
|
||||||
|
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
||||||
|
<gdiScaling xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">false</gdiScaling>
|
||||||
|
</asmv3:windowsSettings>
|
||||||
|
</asmv3:application>
|
||||||
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
|
<application>
|
||||||
|
<!-- Windows 10 -->
|
||||||
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||||
|
<maxversiontested Id="10.0.18363.0"/>
|
||||||
|
<!-- Windows 8.1 -->
|
||||||
|
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
|
||||||
|
<!--Windows 8 -->
|
||||||
|
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
|
||||||
|
<!-- Windows 7 -->
|
||||||
|
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
|
||||||
|
</application>
|
||||||
|
</compatibility>
|
||||||
|
<!-- Set UAC level to "asInvoker" and disable registry virtualization -->
|
||||||
|
<asmv2:trustInfo>
|
||||||
|
<asmv2:security>
|
||||||
|
<asmv3:requestedPrivileges>
|
||||||
|
<!--
|
||||||
|
The presence of the "requestedExecutionLevel" node will disable
|
||||||
|
file and registry virtualization on Vista. See:
|
||||||
|
http://msdn.microsoft.com/en-us/library/aa965884%28v=vs.85%29.aspx
|
||||||
|
|
||||||
|
Use the "level" attribute to specify the User Account Control level:
|
||||||
|
asInvoker = Never prompt for elevation
|
||||||
|
requireAdministrator = Always prompt for elevation
|
||||||
|
highestAvailable = Prompt for elevation when started by administrator,
|
||||||
|
but do not prompt for administrator password when started by
|
||||||
|
standard user.
|
||||||
|
-->
|
||||||
|
<asmv3:requestedExecutionLevel level="asInvoker" />
|
||||||
|
</asmv3:requestedPrivileges>
|
||||||
|
</asmv2:security>
|
||||||
|
</asmv2:trustInfo>
|
||||||
|
</assembly>
|
||||||
@@ -14,11 +14,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NotifyIconWpf", "NotifyIconWpf\NotifyIconWpf.csproj", "{7AC63864-7638-41C4-969C-D3197EF2BED9}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NotifyIconWpf", "NotifyIconWpf\NotifyIconWpf.csproj", "{7AC63864-7638-41C4-969C-D3197EF2BED9}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample Project", "Sample Project\Sample Project.csproj", "{71C74F29-F1C2-49C5-969F-C25AC4CDFCCC}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NotifyIconWpf.Sample.ShowCases", "NotifyIconWpf.Sample.ShowCases\NotifyIconWpf.Sample.ShowCases.csproj", "{71C74F29-F1C2-49C5-969F-C25AC4CDFCCC}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsFormsSample", "WindowsFormsSample\WindowsFormsSample.csproj", "{F6DC0A6D-D1CE-4AD2-92ED-08FFF0AD4FA8}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NotifyIconWpf.Sample.WindowsForms", "NotifyIconWpf.Sample.WindowsForms\NotifyIconWpf.Sample.WindowsForms.csproj", "{F6DC0A6D-D1CE-4AD2-92ED-08FFF0AD4FA8}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Windowless Sample", "Windowless Sample\Windowless Sample.csproj", "{964EBFBE-A600-49B2-BDD8-422B46F1D544}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NotifyIconWpf.Sample.Windowless", "NotifyIconWpf.Sample.Windowless\NotifyIconWpf.Sample.Windowless.csproj", "{964EBFBE-A600-49B2-BDD8-422B46F1D544}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
|||||||
BIN
src/NotifyIconWpf.snk
Normal file
@@ -1,5 +1,5 @@
|
|||||||
// hardcodet.net NotifyIcon for WPF
|
// hardcodet.net NotifyIcon for WPF
|
||||||
// Copyright (c) 2009 - 2013 Philipp Sumi
|
// Copyright (c) 2009 - 2020 Philipp Sumi
|
||||||
// Contact and Information: http://www.hardcodet.net
|
// Contact and Information: http://www.hardcodet.net
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
|
|||||||
@@ -1,3 +1,27 @@
|
|||||||
|
// hardcodet.net NotifyIcon for WPF
|
||||||
|
// Copyright (c) 2009 - 2020 Philipp Sumi
|
||||||
|
// Contact and Information: http://www.hardcodet.net
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the Code Project Open License (CPOL);
|
||||||
|
// either version 1.0 of the License, or (at your option) any later
|
||||||
|
// version.
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be
|
||||||
|
// included in all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
|
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||||
|
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
// OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
// THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE
|
||||||
|
|
||||||
|
using System.Diagnostics.Contracts;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
|
|
||||||
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||||
@@ -7,29 +31,55 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class SystemInfo
|
public static class SystemInfo
|
||||||
{
|
{
|
||||||
private static readonly System.Windows.Point DpiFactors;
|
/// <summary>
|
||||||
|
/// Make sure the initial value is calculated at the first access
|
||||||
|
/// </summary>
|
||||||
static SystemInfo()
|
static SystemInfo()
|
||||||
|
{
|
||||||
|
UpdateDpiFactors();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This calculates the current DPI values and sets this into the DpiFactorX/DpiFactorY values
|
||||||
|
/// </summary>
|
||||||
|
internal static void UpdateDpiFactors()
|
||||||
{
|
{
|
||||||
using (var source = new HwndSource(new HwndSourceParameters()))
|
using (var source = new HwndSource(new HwndSourceParameters()))
|
||||||
{
|
{
|
||||||
if (source.CompositionTarget?.TransformToDevice != null)
|
if (source.CompositionTarget?.TransformToDevice != null)
|
||||||
{
|
{
|
||||||
DpiFactors = new System.Windows.Point(source.CompositionTarget.TransformToDevice.M11, source.CompositionTarget.TransformToDevice.M22);
|
DpiFactorX = source.CompositionTarget.TransformToDevice.M11;
|
||||||
|
DpiFactorY = source.CompositionTarget.TransformToDevice.M22;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DpiFactors = new System.Windows.Point(1, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DpiFactorX = DpiFactorY = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the DPI X Factor
|
/// Returns the DPI X Factor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static double DpiFactorX => DpiFactors.X;
|
public static double DpiFactorX { get; private set; } = 1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the DPI Y Factor
|
/// Returns the DPI Y Factor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static double DpiFactorY => DpiFactors.Y;
|
public static double DpiFactorY { get; private set; } = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Scale the supplied point to the current DPI settings
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="point"></param>
|
||||||
|
/// <returns>Point</returns>
|
||||||
|
[Pure]
|
||||||
|
public static Point ScaleWithDpi(this Point point)
|
||||||
|
{
|
||||||
|
return new Point
|
||||||
|
{
|
||||||
|
X = (int)(point.X / DpiFactorX),
|
||||||
|
Y = (int)(point.Y / DpiFactorY)
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,13 +51,6 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="point">Point</param>
|
/// <param name="point">Point</param>
|
||||||
/// <returns>Point</returns>
|
/// <returns>Point</returns>
|
||||||
public static Point GetDeviceCoordinates(Point point)
|
public static Point GetDeviceCoordinates(Point point) => point.ScaleWithDpi();
|
||||||
{
|
|
||||||
return new Point
|
|
||||||
{
|
|
||||||
X = (int)(point.X / SystemInfo.DpiFactorX),
|
|
||||||
Y = (int)(point.Y / SystemInfo.DpiFactorY)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,6 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public delegate IntPtr WindowProcedureHandler(IntPtr hWnd, uint uMsg, IntPtr wParam, IntPtr lParam);
|
public delegate IntPtr WindowProcedureHandler(IntPtr hWnd, uint uMsg, IntPtr wParam, IntPtr lParam);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Win API WNDCLASS struct - represents a single window.
|
/// Win API WNDCLASS struct - represents a single window.
|
||||||
/// Used to receive window messages.
|
/// Used to receive window messages.
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
// hardcodet.net NotifyIcon for WPF
|
// hardcodet.net NotifyIcon for WPF
|
||||||
// Copyright (c) 2009 - 2013 Philipp Sumi
|
// Copyright (c) 2009 - 2020 Philipp Sumi
|
||||||
// Contact and Information: http://www.hardcodet.net
|
// Contact and Information: http://www.hardcodet.net
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the Code Project Open License (CPOL);
|
// modify it under the terms of the Code Project Open License (CPOL);
|
||||||
// either version 1.0 of the License, or (at your option) any later
|
// either version 1.0 of the License, or (at your option) any later
|
||||||
// version.
|
// version.
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be
|
// The above copyright notice and this permission notice shall be
|
||||||
// included in all copies or substantial portions of the Software.
|
// included in all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
@@ -70,7 +70,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handle for the message window.
|
/// Handle for the message window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal IntPtr MessageWindowHandle { get; private set; }
|
internal IntPtr MessageWindowHandle { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -223,9 +223,21 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
|||||||
/// <param name="lParam">Provides information about the event.</param>
|
/// <param name="lParam">Provides information about the event.</param>
|
||||||
private void ProcessWindowMessage(uint msg, IntPtr wParam, IntPtr lParam)
|
private void ProcessWindowMessage(uint msg, IntPtr wParam, IntPtr lParam)
|
||||||
{
|
{
|
||||||
if (msg != CallbackMessageId) return;
|
// Check if it was a callback message
|
||||||
|
if (msg != CallbackMessageId)
|
||||||
|
{
|
||||||
|
// It was not a callback message, but make sure it's not something else we need to process
|
||||||
|
switch ((WindowsMessages) msg)
|
||||||
|
{
|
||||||
|
case WindowsMessages.WM_DPICHANGED:
|
||||||
|
Debug.WriteLine("DPI Change");
|
||||||
|
SystemInfo.UpdateDpiFactors();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var message = (WindowsMessages) lParam.ToInt32();
|
var message = (WindowsMessages)lParam.ToInt32();
|
||||||
Debug.WriteLine("Got message " + message);
|
Debug.WriteLine("Got message " + message);
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
@@ -338,7 +350,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
|||||||
|
|
||||||
// This object will be cleaned up by the Dispose method.
|
// This object will be cleaned up by the Dispose method.
|
||||||
// Therefore, you should call GC.SuppressFinalize to
|
// Therefore, you should call GC.SuppressFinalize to
|
||||||
// take this object off the finalization queue
|
// take this object off the finalization queue
|
||||||
// and prevent finalization code for this object
|
// and prevent finalization code for this object
|
||||||
// from executing a second time.
|
// from executing a second time.
|
||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
// hardcodet.net NotifyIcon for WPF
|
// hardcodet.net NotifyIcon for WPF
|
||||||
// Copyright (c) 2009 - 2013 Philipp Sumi
|
// Copyright (c) 2009 - 2020 Philipp Sumi
|
||||||
// Contact and Information: http://www.hardcodet.net
|
// Contact and Information: http://www.hardcodet.net
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the Code Project Open License (CPOL);
|
// modify it under the terms of the Code Project Open License (CPOL);
|
||||||
// either version 1.0 of the License, or (at your option) any later
|
// either version 1.0 of the License, or (at your option) any later
|
||||||
// version.
|
// version.
|
||||||
//
|
//
|
||||||
// The above copyright notice and this permission notice shall be
|
// The above copyright notice and this permission notice shall be
|
||||||
// included in all copies or substantial portions of the Software.
|
// included in all copies or substantial portions of the Software.
|
||||||
//
|
//
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
@@ -37,8 +37,8 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Notifies a window that the user clicked the right mouse button (right-clicked) in the window.
|
/// Notifies a window that the user clicked the right mouse button (right-clicked) in the window.
|
||||||
/// See <a href="https://docs.microsoft.com/en-us/windows/win32/menurc/wm-contextmenu">WM_CONTEXTMENU message</a>
|
/// See <a href="https://docs.microsoft.com/en-us/windows/win32/menurc/wm-contextmenu">WM_CONTEXTMENU message</a>
|
||||||
///
|
///
|
||||||
/// In case of a notify icon:
|
/// In case of a notify icon:
|
||||||
/// If a user selects a notify icon's shortcut menu with the keyboard, the Shell now sends the associated application a WM_CONTEXTMENU message. Earlier versions send WM_RBUTTONDOWN and WM_RBUTTONUP messages.
|
/// If a user selects a notify icon's shortcut menu with the keyboard, the Shell now sends the associated application a WM_CONTEXTMENU message. Earlier versions send WM_RBUTTONDOWN and WM_RBUTTONUP messages.
|
||||||
/// See <a href="https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shell_notifyiconw">Shell_NotifyIcon function</a>
|
/// See <a href="https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shell_notifyiconw">Shell_NotifyIcon function</a>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -57,7 +57,7 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
|||||||
/// Posted when the user presses the left mouse button while the cursor is in the client area of a window.
|
/// Posted when the user presses the left mouse button while the cursor is in the client area of a window.
|
||||||
/// If the mouse is not captured, the message is posted to the window beneath the cursor.
|
/// If the mouse is not captured, the message is posted to the window beneath the cursor.
|
||||||
/// Otherwise, the message is posted to the window that has captured the mouse.
|
/// Otherwise, the message is posted to the window that has captured the mouse.
|
||||||
///
|
///
|
||||||
/// See <a href="https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-lbuttondown">WM_LBUTTONDOWN message</a>
|
/// See <a href="https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-lbuttondown">WM_LBUTTONDOWN message</a>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
WM_LBUTTONDOWN = 0x0201,
|
WM_LBUTTONDOWN = 0x0201,
|
||||||
@@ -134,6 +134,13 @@ namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
WM_MBUTTONDBLCLK = 0x0209,
|
WM_MBUTTONDBLCLK = 0x0209,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sent when the effective dots per inch (dpi) for a window has changed.
|
||||||
|
/// The DPI is the scale factor for a window.
|
||||||
|
/// There are multiple events that can cause the DPI to change.
|
||||||
|
/// </summary>
|
||||||
|
WM_DPICHANGED = 0x02e0,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used to define private messages for use by private window classes, usually of the form WM_USER+x, where x is an integer value.
|
/// Used to define private messages for use by private window classes, usually of the form WM_USER+x, where x is an integer value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -4,22 +4,12 @@
|
|||||||
<AssemblyName>Hardcodet.NotifyIcon.Wpf</AssemblyName>
|
<AssemblyName>Hardcodet.NotifyIcon.Wpf</AssemblyName>
|
||||||
<AssemblyTitle>NotifyIcon for WPF</AssemblyTitle>
|
<AssemblyTitle>NotifyIcon for WPF</AssemblyTitle>
|
||||||
<Product>NotifyIcon WPF</Product>
|
<Product>NotifyIcon WPF</Product>
|
||||||
<TargetFrameworks>net45;net472;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' != 'net45'">
|
|
||||||
<PackageReference Include="System.Resources.Extensions" Version="4.7.0" PrivateAssets="All" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
|
|
||||||
<Reference Include="System.Xaml" />
|
|
||||||
<Reference Include="WindowsBase" />
|
|
||||||
<Reference Include="PresentationCore" />
|
|
||||||
<Reference Include="PresentationFramework" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Diagrams\TaskbarIcon Overview.cd" />
|
<None Include="Diagrams\TaskbarIcon Overview.cd" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile DependentUpon="%(Filename)" SubType="Code" Update="**\obj\**\*.g$(DefaultLanguageSourceExtension)" />
|
<Compile DependentUpon="%(Filename)" SubType="Code" Update="**\obj\**\*.g$(DefaultLanguageSourceExtension)" />
|
||||||
<Compile DependentUpon="%(Filename)" SubType="Designer" Update="**\*.xaml$(DefaultLanguageSourceExtension)" />
|
<Compile DependentUpon="%(Filename)" SubType="Designer" Update="**\*.xaml$(DefaultLanguageSourceExtension)" />
|
||||||
|
|||||||