mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-02-16 11:08:30 -05:00
ADD Git attributes.
CHG End of line conversion.
This commit is contained in:
63
.gitattributes
vendored
Normal file
63
.gitattributes
vendored
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
###############################################################################
|
||||||
|
# Set default behavior to automatically normalize line endings.
|
||||||
|
###############################################################################
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Set default behavior for command prompt diff.
|
||||||
|
#
|
||||||
|
# This is need for earlier builds of msysgit that does not have it on by
|
||||||
|
# default for csharp files.
|
||||||
|
# Note: This is only used by command line
|
||||||
|
###############################################################################
|
||||||
|
#*.cs diff=csharp
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Set the merge driver for project and solution files
|
||||||
|
#
|
||||||
|
# Merging from the command prompt will add diff markers to the files if there
|
||||||
|
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||||
|
# the diff markers are never inserted). Diff markers may cause the following
|
||||||
|
# file extensions to fail to load in VS. An alternative would be to treat
|
||||||
|
# these files as binary and thus will always conflict and require user
|
||||||
|
# intervention with every merge. To do so, just uncomment the entries below
|
||||||
|
###############################################################################
|
||||||
|
#*.sln merge=binary
|
||||||
|
#*.csproj merge=binary
|
||||||
|
#*.vbproj merge=binary
|
||||||
|
#*.vcxproj merge=binary
|
||||||
|
#*.vcproj merge=binary
|
||||||
|
#*.dbproj merge=binary
|
||||||
|
#*.fsproj merge=binary
|
||||||
|
#*.lsproj merge=binary
|
||||||
|
#*.wixproj merge=binary
|
||||||
|
#*.modelproj merge=binary
|
||||||
|
#*.sqlproj merge=binary
|
||||||
|
#*.wwaproj merge=binary
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# behavior for image files
|
||||||
|
#
|
||||||
|
# image files are treated as binary by default.
|
||||||
|
###############################################################################
|
||||||
|
#*.jpg binary
|
||||||
|
#*.png binary
|
||||||
|
#*.gif binary
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# diff behavior for common document formats
|
||||||
|
#
|
||||||
|
# Convert binary document formats to text before diffing them. This feature
|
||||||
|
# is only available from the command line. Turn it on by uncommenting the
|
||||||
|
# entries below.
|
||||||
|
###############################################################################
|
||||||
|
#*.doc diff=astextplain
|
||||||
|
#*.DOC diff=astextplain
|
||||||
|
#*.docx diff=astextplain
|
||||||
|
#*.DOCX diff=astextplain
|
||||||
|
#*.dot diff=astextplain
|
||||||
|
#*.DOT diff=astextplain
|
||||||
|
#*.pdf diff=astextplain
|
||||||
|
#*.PDF diff=astextplain
|
||||||
|
#*.rtf diff=astextplain
|
||||||
|
#*.RTF diff=astextplain
|
||||||
156
.gitignore
vendored
Normal file
156
.gitignore
vendored
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
|
||||||
|
[Dd]ebug/
|
||||||
|
[Rr]elease/
|
||||||
|
x64/
|
||||||
|
build/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
|
||||||
|
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
|
||||||
|
!packages/*/build/
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*.log
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.log
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
*.ncrunch*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
|
||||||
|
# Installshield output folder
|
||||||
|
[Ee]xpress/
|
||||||
|
|
||||||
|
# DocProject is a documentation generator add-in
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
|
||||||
|
# Click-Once directory
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# Publish Web Output
|
||||||
|
*.Publish.xml
|
||||||
|
|
||||||
|
# NuGet Packages Directory
|
||||||
|
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
|
||||||
|
#packages/
|
||||||
|
|
||||||
|
# Windows Azure Build Output
|
||||||
|
csx
|
||||||
|
*.build.csdef
|
||||||
|
|
||||||
|
# Windows Store app package directory
|
||||||
|
AppPackages/
|
||||||
|
|
||||||
|
# Others
|
||||||
|
sql/
|
||||||
|
*.Cache
|
||||||
|
ClientBin/
|
||||||
|
[Ss]tyle[Cc]op.*
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
|
||||||
|
# RIA/Silverlight projects
|
||||||
|
Generated_Code/
|
||||||
|
|
||||||
|
# Backup & report files from converting an old project file to a newer
|
||||||
|
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
||||||
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
App_Data/*.mdf
|
||||||
|
App_Data/*.ldf
|
||||||
|
|
||||||
|
|
||||||
|
#LightSwitch generated files
|
||||||
|
GeneratedArtifacts/
|
||||||
|
_Pvt_Extensions/
|
||||||
|
ModelManifest.xml
|
||||||
|
|
||||||
|
# =========================
|
||||||
|
# Windows detritus
|
||||||
|
# =========================
|
||||||
|
|
||||||
|
# Windows image file caches
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Mac desktop service store files
|
||||||
|
.DS_Store
|
||||||
@@ -1,42 +1,42 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>Hardcodet.NotifyIcon.Wpf</id>
|
<id>Hardcodet.NotifyIcon.Wpf</id>
|
||||||
<version>1.0.5</version>
|
<version>1.0.5</version>
|
||||||
<title>Hardcodet WPF NotifyIcon</title>
|
<title>Hardcodet WPF NotifyIcon</title>
|
||||||
<authors>Philipp Sumi</authors>
|
<authors>Philipp Sumi</authors>
|
||||||
<owners>Philipp Sumi</owners>
|
<owners>Philipp Sumi</owners>
|
||||||
<licenseUrl>http://www.codeproject.com/info/cpol10.aspx</licenseUrl>
|
<licenseUrl>http://www.codeproject.com/info/cpol10.aspx</licenseUrl>
|
||||||
<projectUrl>http://www.hardcodet.net/projects/wpf-notifyicon</projectUrl>
|
<projectUrl>http://www.hardcodet.net/projects/wpf-notifyicon</projectUrl>
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<description>This is an implementation of a NotifyIcon (aka system tray icon or taskbar icon) for the WPF platform. It does not just rely on the Windows Forms NotifyIcon component, but is a purely independent control which leverages several features of the WPF framework in order to display rich tooltips, popups, context menus, and balloon messages. It can be used directly in code or embedded in any XAML file.
|
<description>This is an implementation of a NotifyIcon (aka system tray icon or taskbar icon) for the WPF platform. It does not just rely on the Windows Forms NotifyIcon component, but is a purely independent control which leverages several features of the WPF framework in order to display rich tooltips, popups, context menus, and balloon messages. It can be used directly in code or embedded in any XAML file.
|
||||||
|
|
||||||
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>
|
||||||
<releaseNotes>Mostly bug fixes and full x64 / Win 8 support. Contains source and binaries for .NET 3.5 - 4.51.</releaseNotes>
|
<releaseNotes>Mostly bug fixes and full x64 / Win 8 support. Contains source and binaries for .NET 3.5 - 4.51.</releaseNotes>
|
||||||
<copyright>Copyright (c) 2013 Philipp Sumi</copyright>
|
<copyright>Copyright (c) 2013 Philipp Sumi</copyright>
|
||||||
<language />
|
<language />
|
||||||
<tags>NotifyIcon WPF Tray Notify ToolTip Popup Balloon Toast</tags>
|
<tags>NotifyIcon WPF Tray Notify ToolTip Popup Balloon Toast</tags>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
<file src="..\Binaries\net35\Hardcodet.Wpf.TaskbarNotification.dll" target="lib\net35\Hardcodet.Wpf.TaskbarNotification.dll" />
|
<file src="..\Binaries\net35\Hardcodet.Wpf.TaskbarNotification.dll" target="lib\net35\Hardcodet.Wpf.TaskbarNotification.dll" />
|
||||||
<file src="..\Binaries\net35\Hardcodet.Wpf.TaskbarNotification.pdb" target="lib\net35\Hardcodet.Wpf.TaskbarNotification.pdb" />
|
<file src="..\Binaries\net35\Hardcodet.Wpf.TaskbarNotification.pdb" target="lib\net35\Hardcodet.Wpf.TaskbarNotification.pdb" />
|
||||||
<file src="..\Binaries\net35\Hardcodet.Wpf.TaskbarNotification.xml" target="lib\net35\Hardcodet.Wpf.TaskbarNotification.xml" />
|
<file src="..\Binaries\net35\Hardcodet.Wpf.TaskbarNotification.xml" target="lib\net35\Hardcodet.Wpf.TaskbarNotification.xml" />
|
||||||
<file src="..\Binaries\net35-client\Hardcodet.Wpf.TaskbarNotification.dll" target="lib\net35-client\Hardcodet.Wpf.TaskbarNotification.dll" />
|
<file src="..\Binaries\net35-client\Hardcodet.Wpf.TaskbarNotification.dll" target="lib\net35-client\Hardcodet.Wpf.TaskbarNotification.dll" />
|
||||||
<file src="..\Binaries\net35-client\Hardcodet.Wpf.TaskbarNotification.pdb" target="lib\net35-client\Hardcodet.Wpf.TaskbarNotification.pdb" />
|
<file src="..\Binaries\net35-client\Hardcodet.Wpf.TaskbarNotification.pdb" target="lib\net35-client\Hardcodet.Wpf.TaskbarNotification.pdb" />
|
||||||
<file src="..\Binaries\net35-client\Hardcodet.Wpf.TaskbarNotification.xml" target="lib\net35-client\Hardcodet.Wpf.TaskbarNotification.xml" />
|
<file src="..\Binaries\net35-client\Hardcodet.Wpf.TaskbarNotification.xml" target="lib\net35-client\Hardcodet.Wpf.TaskbarNotification.xml" />
|
||||||
<file src="..\Binaries\net40\Hardcodet.Wpf.TaskbarNotification.dll" target="lib\net40\Hardcodet.Wpf.TaskbarNotification.dll" />
|
<file src="..\Binaries\net40\Hardcodet.Wpf.TaskbarNotification.dll" target="lib\net40\Hardcodet.Wpf.TaskbarNotification.dll" />
|
||||||
<file src="..\Binaries\net40\Hardcodet.Wpf.TaskbarNotification.pdb" target="lib\net40\Hardcodet.Wpf.TaskbarNotification.pdb" />
|
<file src="..\Binaries\net40\Hardcodet.Wpf.TaskbarNotification.pdb" target="lib\net40\Hardcodet.Wpf.TaskbarNotification.pdb" />
|
||||||
<file src="..\Binaries\net40\Hardcodet.Wpf.TaskbarNotification.xml" target="lib\net40\Hardcodet.Wpf.TaskbarNotification.xml" />
|
<file src="..\Binaries\net40\Hardcodet.Wpf.TaskbarNotification.xml" target="lib\net40\Hardcodet.Wpf.TaskbarNotification.xml" />
|
||||||
<file src="..\Binaries\net40-client\Hardcodet.Wpf.TaskbarNotification.dll" target="lib\net40-client\Hardcodet.Wpf.TaskbarNotification.dll" />
|
<file src="..\Binaries\net40-client\Hardcodet.Wpf.TaskbarNotification.dll" target="lib\net40-client\Hardcodet.Wpf.TaskbarNotification.dll" />
|
||||||
<file src="..\Binaries\net40-client\Hardcodet.Wpf.TaskbarNotification.pdb" target="lib\net40-client\Hardcodet.Wpf.TaskbarNotification.pdb" />
|
<file src="..\Binaries\net40-client\Hardcodet.Wpf.TaskbarNotification.pdb" target="lib\net40-client\Hardcodet.Wpf.TaskbarNotification.pdb" />
|
||||||
<file src="..\Binaries\net40-client\Hardcodet.Wpf.TaskbarNotification.xml" target="lib\net40-client\Hardcodet.Wpf.TaskbarNotification.xml" />
|
<file src="..\Binaries\net40-client\Hardcodet.Wpf.TaskbarNotification.xml" target="lib\net40-client\Hardcodet.Wpf.TaskbarNotification.xml" />
|
||||||
<file src="..\Binaries\net45\Hardcodet.Wpf.TaskbarNotification.dll" target="lib\net45\Hardcodet.Wpf.TaskbarNotification.dll" />
|
<file src="..\Binaries\net45\Hardcodet.Wpf.TaskbarNotification.dll" target="lib\net45\Hardcodet.Wpf.TaskbarNotification.dll" />
|
||||||
<file src="..\Binaries\net45\Hardcodet.Wpf.TaskbarNotification.pdb" target="lib\net45\Hardcodet.Wpf.TaskbarNotification.pdb" />
|
<file src="..\Binaries\net45\Hardcodet.Wpf.TaskbarNotification.pdb" target="lib\net45\Hardcodet.Wpf.TaskbarNotification.pdb" />
|
||||||
<file src="..\Binaries\net45\Hardcodet.Wpf.TaskbarNotification.xml" target="lib\net45\Hardcodet.Wpf.TaskbarNotification.xml" />
|
<file src="..\Binaries\net45\Hardcodet.Wpf.TaskbarNotification.xml" target="lib\net45\Hardcodet.Wpf.TaskbarNotification.xml" />
|
||||||
<file src="..\Binaries\net451\Hardcodet.Wpf.TaskbarNotification.dll" target="lib\net451\Hardcodet.Wpf.TaskbarNotification.dll" />
|
<file src="..\Binaries\net451\Hardcodet.Wpf.TaskbarNotification.dll" target="lib\net451\Hardcodet.Wpf.TaskbarNotification.dll" />
|
||||||
<file src="..\Binaries\net451\Hardcodet.Wpf.TaskbarNotification.pdb" target="lib\net451\Hardcodet.Wpf.TaskbarNotification.pdb" />
|
<file src="..\Binaries\net451\Hardcodet.Wpf.TaskbarNotification.pdb" target="lib\net451\Hardcodet.Wpf.TaskbarNotification.pdb" />
|
||||||
<file src="..\Binaries\net451\Hardcodet.Wpf.TaskbarNotification.xml" target="lib\net451\Hardcodet.Wpf.TaskbarNotification.xml" />
|
<file src="..\Binaries\net451\Hardcodet.Wpf.TaskbarNotification.xml" target="lib\net451\Hardcodet.Wpf.TaskbarNotification.xml" />
|
||||||
<file src="readme.1.0.5.txt" target="readme.txt" />
|
<file src="readme.1.0.5.txt" target="readme.txt" />
|
||||||
</files>
|
</files>
|
||||||
</package>
|
</package>
|
||||||
@@ -1,31 +1,31 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>Hardcodet.Wpf.TaskbarNotification</id>
|
<id>Hardcodet.Wpf.TaskbarNotification</id>
|
||||||
<version>1.0.5</version>
|
<version>1.0.5</version>
|
||||||
<title>Hardcodet.Wpf.TaskbarNotification</title>
|
<title>Hardcodet.Wpf.TaskbarNotification</title>
|
||||||
<authors>Philipp Sumi</authors>
|
<authors>Philipp Sumi</authors>
|
||||||
<owners>Philipp Sumi</owners>
|
<owners>Philipp Sumi</owners>
|
||||||
<licenseUrl>http://www.codeproject.com/info/cpol10.aspx</licenseUrl>
|
<licenseUrl>http://www.codeproject.com/info/cpol10.aspx</licenseUrl>
|
||||||
<projectUrl>http://www.hardcodet.net/projects/wpf-notifyicon</projectUrl>
|
<projectUrl>http://www.hardcodet.net/projects/wpf-notifyicon</projectUrl>
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<description>THIS PACKAGE IS OBSOLETE.
|
<description>THIS PACKAGE IS OBSOLETE.
|
||||||
|
|
||||||
Please switch to the officially maintained NuGet package: Hardcodet.NotifyIcon.WPF
|
Please switch to the officially maintained NuGet package: Hardcodet.NotifyIcon.WPF
|
||||||
|
|
||||||
This is an implementation of a NotifyIcon (aka system tray icon or taskbar icon) for the WPF platform. It does not just rely on the Windows Forms NotifyIcon component, but is a purely independent control which leverages several features of the WPF framework in order to display rich tooltips, popups, context menus, and balloon messages. It can be used directly in code or embedded in any XAML file.
|
This is an implementation of a NotifyIcon (aka system tray icon or taskbar icon) for the WPF platform. It does not just rely on the Windows Forms NotifyIcon component, but is a purely independent control which leverages several features of the WPF framework in order to display rich tooltips, popups, context menus, and balloon messages. It can be used directly in code or embedded in any XAML file.
|
||||||
|
|
||||||
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>This package is obsolete. Please switch to the maintained NuGet package: Hardcodet.NotifyIcon.WPF</summary>
|
<summary>This package is obsolete. Please switch to the maintained NuGet package: Hardcodet.NotifyIcon.WPF</summary>
|
||||||
<releaseNotes>Mostly bug fixes and full x64 / Win 8 support. Contains source and binaries for .NET 3.5 - 4.51.</releaseNotes>
|
<releaseNotes>Mostly bug fixes and full x64 / Win 8 support. Contains source and binaries for .NET 3.5 - 4.51.</releaseNotes>
|
||||||
<copyright>Copyright (c) 2013 Philipp Sumi</copyright>
|
<copyright>Copyright (c) 2013 Philipp Sumi</copyright>
|
||||||
<language />
|
<language />
|
||||||
<tags>NotifyIcon WPF Tray Notify ToolTip Popup Balloon Toast</tags>
|
<tags>NotifyIcon WPF Tray Notify ToolTip Popup Balloon Toast</tags>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="Hardcodet.NotifyIcon.Wpf" version="1.0.5" />
|
<dependency id="Hardcodet.NotifyIcon.Wpf" version="1.0.5" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
<file src="readme.from.legacy.package.txt" target="readme.txt" />
|
<file src="readme.from.legacy.package.txt" target="readme.txt" />
|
||||||
</files>
|
</files>
|
||||||
</package>
|
</package>
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
Hardcodet NotifyIcon for WPF
|
Hardcodet NotifyIcon for WPF
|
||||||
****************************
|
****************************
|
||||||
|
|
||||||
THIS PACKAGE IS OBSOLETE.
|
THIS PACKAGE IS OBSOLETE.
|
||||||
|
|
||||||
This package has a dependency to the official package in order to keep things working for you, but consider switching to the official NuGet package: Hardcodet.NotifyIcon.Wpf
|
This package has a dependency to the official package in order to keep things working for you, but consider switching to the official NuGet package: Hardcodet.NotifyIcon.Wpf
|
||||||
|
|
||||||
For direct NuGet links, source code or samples, please visit the project page:
|
For direct NuGet links, source code or samples, please visit the project page:
|
||||||
http://www.hardcodet.net/projects/wpf-notifyicon
|
http://www.hardcodet.net/projects/wpf-notifyicon
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
Hardcodet NotifyIcon for WPF 1.0.5
|
Hardcodet NotifyIcon for WPF 1.0.5
|
||||||
**********************************
|
**********************************
|
||||||
|
|
||||||
This is an implementation of a NotifyIcon (aka system tray icon or taskbar icon) for the WPF platform. It does not just rely on the Windows Forms NotifyIcon component, but is a purely independent control which leverages several features of the WPF framework in order to display rich tooltips, popups, context menus, and balloon messages. It can be used directly in code or embedded in any XAML file.
|
This is an implementation of a NotifyIcon (aka system tray icon or taskbar icon) for the WPF platform. It does not just rely on the Windows Forms NotifyIcon component, but is a purely independent control which leverages several features of the WPF framework in order to display rich tooltips, popups, context menus, and balloon messages. It can be used directly in code or embedded in any XAML file.
|
||||||
|
|
||||||
This package contains only binaries. For source code and samples, please visit the project page:
|
This package contains only binaries. For source code and samples, please visit the project page:
|
||||||
http://www.hardcodet.net/projects/wpf-notifyicon
|
http://www.hardcodet.net/projects/wpf-notifyicon
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe" NotifyIconWpf\NotifyIconWpf.csproj /p:Configuration=Release;TargetFrameworkVersion=v3.5;TargetFrameworkProfile="";OutputPath=..\..\Binaries\net35 /t:Rebuild
|
"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe" NotifyIconWpf\NotifyIconWpf.csproj /p:Configuration=Release;TargetFrameworkVersion=v3.5;TargetFrameworkProfile="";OutputPath=..\..\Binaries\net35 /t:Rebuild
|
||||||
"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe" NotifyIconWpf\NotifyIconWpf.csproj /p:Configuration=Release;TargetFrameworkVersion=v3.5;TargetFrameworkProfile="Client";OutputPath=..\..\Binaries\net35-client /t:Rebuild
|
"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe" NotifyIconWpf\NotifyIconWpf.csproj /p:Configuration=Release;TargetFrameworkVersion=v3.5;TargetFrameworkProfile="Client";OutputPath=..\..\Binaries\net35-client /t:Rebuild
|
||||||
|
|
||||||
"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe" NotifyIconWpf\NotifyIconWpf.csproj /p:Configuration=Release;TargetFrameworkVersion=v4.0;TargetFrameworkProfile="";OutputPath=..\..\Binaries\net40 /t:Rebuild
|
"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe" NotifyIconWpf\NotifyIconWpf.csproj /p:Configuration=Release;TargetFrameworkVersion=v4.0;TargetFrameworkProfile="";OutputPath=..\..\Binaries\net40 /t:Rebuild
|
||||||
"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe" NotifyIconWpf\NotifyIconWpf.csproj /p:Configuration=Release;TargetFrameworkVersion=v4.0;TargetFrameworkProfile="Client";OutputPath=..\..\Binaries\net40-client /t:Rebuild
|
"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe" NotifyIconWpf\NotifyIconWpf.csproj /p:Configuration=Release;TargetFrameworkVersion=v4.0;TargetFrameworkProfile="Client";OutputPath=..\..\Binaries\net40-client /t:Rebuild
|
||||||
|
|
||||||
"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe" NotifyIconWpf\NotifyIconWpf.csproj /p:Configuration=Release;TargetFrameworkVersion=v4.5;TargetFrameworkProfile="";OutputPath=..\..\Binaries\net45 /t:Rebuild
|
"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe" NotifyIconWpf\NotifyIconWpf.csproj /p:Configuration=Release;TargetFrameworkVersion=v4.5;TargetFrameworkProfile="";OutputPath=..\..\Binaries\net45 /t:Rebuild
|
||||||
|
|
||||||
"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe" NotifyIconWpf\NotifyIconWpf.csproj /p:Configuration=Release;TargetFrameworkVersion=v4.5.1;TargetFrameworkProfile="";OutputPath=..\..\Binaries\net451 /t:Rebuild
|
"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe" NotifyIconWpf\NotifyIconWpf.csproj /p:Configuration=Release;TargetFrameworkVersion=v4.5.1;TargetFrameworkProfile="";OutputPath=..\..\Binaries\net451 /t:Rebuild
|
||||||
|
|||||||
@@ -1,77 +1,77 @@
|
|||||||
hardcodet.net NotifyIcon for WPF - Changelog
|
hardcodet.net NotifyIcon for WPF - Changelog
|
||||||
Copyright (c) 2009-2013 Philipp Sumi
|
Copyright (c) 2009-2013 Philipp Sumi
|
||||||
Contact and Information: http://www.hardcodet.net
|
Contact and Information: http://www.hardcodet.net
|
||||||
|
|
||||||
|
|
||||||
1.0.5 (2013.11.20)
|
1.0.5 (2013.11.20)
|
||||||
*****
|
*****
|
||||||
|
|
||||||
FIX Support for x64 applications targeting .NET 4 x64 or higher (big thanks to Mark Junker for submitting a patch!)
|
FIX Support for x64 applications targeting .NET 4 x64 or higher (big thanks to Mark Junker for submitting a patch!)
|
||||||
CHG Component does no longer throw an exception is no Explorer shell is present,
|
CHG Component does no longer throw an exception is no Explorer shell is present,
|
||||||
but waits for it to be created.
|
but waits for it to be created.
|
||||||
CHG NotifyIcon is not only removed on user-initiated disposal, but also garbage collection.
|
CHG NotifyIcon is not only removed on user-initiated disposal, but also garbage collection.
|
||||||
CHG The attached ParentTaskbarIconProperty is now derived, so data binding to the attached DP
|
CHG The attached ParentTaskbarIconProperty is now derived, so data binding to the attached DP
|
||||||
becomes much simpler
|
becomes much simpler
|
||||||
(e.g. <TextBlock Text="{Binding RelativeSource={RelativeSource Self}, Path=(tb:TaskbarIcon.ParentTaskbarIcon).ToolTipText}" />)
|
(e.g. <TextBlock Text="{Binding RelativeSource={RelativeSource Self}, Path=(tb:TaskbarIcon.ParentTaskbarIcon).ToolTipText}" />)
|
||||||
CHG WinAPI interop now uses Unicode in order to prevent issues with Asian languages. Thanks to JO Hyeong-Ryeol for posting an easy fix!
|
CHG WinAPI interop now uses Unicode in order to prevent issues with Asian languages. Thanks to JO Hyeong-Ryeol for posting an easy fix!
|
||||||
FIX Context menues receiving keyboard events, which allows for TextBoxes in context menus.
|
FIX Context menues receiving keyboard events, which allows for TextBoxes in context menus.
|
||||||
FIX Coordinates calculated properly on operating systems with non-standard DPIs. Thanks Rusi Filipov for bug reporting and testing.
|
FIX Coordinates calculated properly on operating systems with non-standard DPIs. Thanks Rusi Filipov for bug reporting and testing.
|
||||||
FIX Data-bound ToolTipText may have caused ToolTips to remain open in case of property changes.
|
FIX Data-bound ToolTipText may have caused ToolTips to remain open in case of property changes.
|
||||||
|
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
|
|
||||||
1.0.4 (2009.09.21)
|
1.0.4 (2009.09.21)
|
||||||
*****
|
*****
|
||||||
|
|
||||||
FIX If a popup is opened, its window handle is now being set as the foreground.
|
FIX If a popup is opened, its window handle is now being set as the foreground.
|
||||||
This fixes an issue with certain controls being disabled on popups.
|
This fixes an issue with certain controls being disabled on popups.
|
||||||
(thanks Andrew Smith for pointing me in the right direction!).
|
(thanks Andrew Smith for pointing me in the right direction!).
|
||||||
FIX Changed dispatcher access in order to work in WinForms scenarios, too.
|
FIX Changed dispatcher access in order to work in WinForms scenarios, too.
|
||||||
FIX Corrected typo in WindowMessageSink.BalloonToolTipChanged event (thanks Mertsch).
|
FIX Corrected typo in WindowMessageSink.BalloonToolTipChanged event (thanks Mertsch).
|
||||||
Used internally (although event is public), so this shouldn't be a breaking change.
|
Used internally (although event is public), so this shouldn't be a breaking change.
|
||||||
FIX Dispose only deregisters OnExit event listenter if there is actually an
|
FIX Dispose only deregisters OnExit event listenter if there is actually an
|
||||||
application (not the case in WinForms environments).
|
application (not the case in WinForms environments).
|
||||||
|
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
|
|
||||||
1.0.3 (2009.07.02)
|
1.0.3 (2009.07.02)
|
||||||
*****
|
*****
|
||||||
FIX Commands did not work with RoutedCommands which require an explicit target
|
FIX Commands did not work with RoutedCommands which require an explicit target
|
||||||
(thanks Rodolfo Grave).
|
(thanks Rodolfo Grave).
|
||||||
ADD Added command target properties for both left and double click commands.
|
ADD Added command target properties for both left and double click commands.
|
||||||
Allows to explicitly define another control as the target of a routed
|
Allows to explicitly define another control as the target of a routed
|
||||||
command.
|
command.
|
||||||
|
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
|
|
||||||
1.0.2 (2009.05.18)
|
1.0.2 (2009.05.18)
|
||||||
*****
|
*****
|
||||||
FIX Late-bound DataContext did not coerce properly with ContextMenu, thus
|
FIX Late-bound DataContext did not coerce properly with ContextMenu, thus
|
||||||
assigning it the TaskbarIcon rather than the TaskbarIcon's DataContext.
|
assigning it the TaskbarIcon rather than the TaskbarIcon's DataContext.
|
||||||
Thanks Nic Pillinger for discovering the issue.
|
Thanks Nic Pillinger for discovering the issue.
|
||||||
|
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
|
|
||||||
1.0.1 (2009.05.15)
|
1.0.1 (2009.05.15)
|
||||||
*****
|
*****
|
||||||
CHG DataContext is also assigned to ContextMenu (thanks Nic Pillinger),
|
CHG DataContext is also assigned to ContextMenu (thanks Nic Pillinger),
|
||||||
and properly coerced for ToolTips and Popups. Also checks whether
|
and properly coerced for ToolTips and Popups. Also checks whether
|
||||||
target item has a binding on the DataContext
|
target item has a binding on the DataContext
|
||||||
(does not just override if DataContext is null).
|
(does not just override if DataContext is null).
|
||||||
CHG Popup creation no longer calls Popup.CreateRootPopup which tries to
|
CHG Popup creation no longer calls Popup.CreateRootPopup which tries to
|
||||||
bind to dependency properties that do not exist, thus causing debug
|
bind to dependency properties that do not exist, thus causing debug
|
||||||
warnings (thanks to Loic Berthollet).
|
warnings (thanks to Loic Berthollet).
|
||||||
CHG The LeftClickCommand now executes with a delay in order to make sure
|
CHG The LeftClickCommand now executes with a delay in order to make sure
|
||||||
it's not a double-click.
|
it's not a double-click.
|
||||||
FIX Removed debug output in WindowMessageSink.
|
FIX Removed debug output in WindowMessageSink.
|
||||||
|
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
|
|
||||||
1.0.0
|
1.0.0
|
||||||
*****
|
*****
|
||||||
ADD Initial release.
|
ADD Initial release.
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
del /s /ah /f *.suo
|
del /s /ah /f *.suo
|
||||||
del /s /f *.user
|
del /s /f *.user
|
||||||
del /s /f *.cache
|
del /s /f *.cache
|
||||||
del /s /f *.scc
|
del /s /f *.scc
|
||||||
del /s /f *.vssscc
|
del /s /f *.vssscc
|
||||||
del /s /f *.vspscc
|
del /s /f *.vspscc
|
||||||
del /s /f *.keep
|
del /s /f *.keep
|
||||||
del /s /ah /f vssver2.scc
|
del /s /ah /f vssver2.scc
|
||||||
|
|
||||||
rd /s /q bin obj ClientBin _Resharper.* _Upgrade*
|
rd /s /q bin obj ClientBin _Resharper.* _Upgrade*
|
||||||
|
|
||||||
del dirs.txt
|
del dirs.txt
|
||||||
dir /s /b /ad bin > dirs.txt
|
dir /s /b /ad bin > dirs.txt
|
||||||
dir /s /b /ad obj >> dirs.txt
|
dir /s /b /ad obj >> dirs.txt
|
||||||
dir /s /b /ad ClientBin >> dirs.txt
|
dir /s /b /ad ClientBin >> dirs.txt
|
||||||
dir /s /b /ad _Resharper.* >> dirs.txt
|
dir /s /b /ad _Resharper.* >> dirs.txt
|
||||||
dir /s /b /ad _Upgrade* >> dirs.txt
|
dir /s /b /ad _Upgrade* >> dirs.txt
|
||||||
|
|
||||||
for /f "delims=;" %%i in (dirs.txt) DO rd /s /q "%%i"
|
for /f "delims=;" %%i in (dirs.txt) DO rd /s /q "%%i"
|
||||||
del dirs.txt
|
del dirs.txt
|
||||||
|
|||||||
@@ -1,45 +1,45 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 2013
|
# Visual Studio 2013
|
||||||
VisualStudioVersion = 12.0.21005.1
|
VisualStudioVersion = 12.0.21005.1
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C37AE34D-A8C4-4AEC-995C-3C763300934E}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C37AE34D-A8C4-4AEC-995C-3C763300934E}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
Changelog.txt = Changelog.txt
|
Changelog.txt = Changelog.txt
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotifyIconWpf", "NotifyIconWpf\NotifyIconWpf.csproj", "{7AC63864-7638-41C4-969C-D3197EF2BED9}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotifyIconWpf", "NotifyIconWpf\NotifyIconWpf.csproj", "{7AC63864-7638-41C4-969C-D3197EF2BED9}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample Project", "Sample Project\Sample Project.csproj", "{71C74F29-F1C2-49C5-969F-C25AC4CDFCCC}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample Project", "Sample Project\Sample Project.csproj", "{71C74F29-F1C2-49C5-969F-C25AC4CDFCCC}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsSample", "WindowsFormsSample\WindowsFormsSample.csproj", "{F6DC0A6D-D1CE-4AD2-92ED-08FFF0AD4FA8}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsSample", "WindowsFormsSample\WindowsFormsSample.csproj", "{F6DC0A6D-D1CE-4AD2-92ED-08FFF0AD4FA8}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Windowless Sample", "Windowless Sample\Windowless Sample.csproj", "{964EBFBE-A600-49B2-BDD8-422B46F1D544}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Windowless Sample", "Windowless Sample\Windowless Sample.csproj", "{964EBFBE-A600-49B2-BDD8-422B46F1D544}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{7AC63864-7638-41C4-969C-D3197EF2BED9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{7AC63864-7638-41C4-969C-D3197EF2BED9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{7AC63864-7638-41C4-969C-D3197EF2BED9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{7AC63864-7638-41C4-969C-D3197EF2BED9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{7AC63864-7638-41C4-969C-D3197EF2BED9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{7AC63864-7638-41C4-969C-D3197EF2BED9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{7AC63864-7638-41C4-969C-D3197EF2BED9}.Release|Any CPU.Build.0 = Release|Any CPU
|
{7AC63864-7638-41C4-969C-D3197EF2BED9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{71C74F29-F1C2-49C5-969F-C25AC4CDFCCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{71C74F29-F1C2-49C5-969F-C25AC4CDFCCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{71C74F29-F1C2-49C5-969F-C25AC4CDFCCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{71C74F29-F1C2-49C5-969F-C25AC4CDFCCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{71C74F29-F1C2-49C5-969F-C25AC4CDFCCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{71C74F29-F1C2-49C5-969F-C25AC4CDFCCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{71C74F29-F1C2-49C5-969F-C25AC4CDFCCC}.Release|Any CPU.Build.0 = Release|Any CPU
|
{71C74F29-F1C2-49C5-969F-C25AC4CDFCCC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{F6DC0A6D-D1CE-4AD2-92ED-08FFF0AD4FA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{F6DC0A6D-D1CE-4AD2-92ED-08FFF0AD4FA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{F6DC0A6D-D1CE-4AD2-92ED-08FFF0AD4FA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{F6DC0A6D-D1CE-4AD2-92ED-08FFF0AD4FA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{F6DC0A6D-D1CE-4AD2-92ED-08FFF0AD4FA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{F6DC0A6D-D1CE-4AD2-92ED-08FFF0AD4FA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{F6DC0A6D-D1CE-4AD2-92ED-08FFF0AD4FA8}.Release|Any CPU.Build.0 = Release|Any CPU
|
{F6DC0A6D-D1CE-4AD2-92ED-08FFF0AD4FA8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{964EBFBE-A600-49B2-BDD8-422B46F1D544}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{964EBFBE-A600-49B2-BDD8-422B46F1D544}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{964EBFBE-A600-49B2-BDD8-422B46F1D544}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{964EBFBE-A600-49B2-BDD8-422B46F1D544}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{964EBFBE-A600-49B2-BDD8-422B46F1D544}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{964EBFBE-A600-49B2-BDD8-422B46F1D544}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{964EBFBE-A600-49B2-BDD8-422B46F1D544}.Release|Any CPU.Build.0 = Release|Any CPU
|
{964EBFBE-A600-49B2-BDD8-422B46F1D544}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
// hardcodet.net NotifyIcon for WPF
|
// hardcodet.net NotifyIcon for WPF
|
||||||
// Copyright (c) 2009 - 2013 Philipp Sumi
|
// Copyright (c) 2009 - 2013 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
|
||||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
// OTHER DEALINGS IN THE SOFTWARE.
|
// OTHER DEALINGS IN THE SOFTWARE.
|
||||||
//
|
//
|
||||||
// THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE
|
// THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE
|
||||||
|
|
||||||
|
|
||||||
namespace Hardcodet.Wpf.TaskbarNotification
|
namespace Hardcodet.Wpf.TaskbarNotification
|
||||||
{
|
{
|
||||||
///<summary>
|
///<summary>
|
||||||
/// Supported icons for the tray's balloon messages.
|
/// Supported icons for the tray's balloon messages.
|
||||||
///</summary>
|
///</summary>
|
||||||
public enum BalloonIcon
|
public enum BalloonIcon
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The balloon message is displayed without an icon.
|
/// The balloon message is displayed without an icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
None,
|
None,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An information is displayed.
|
/// An information is displayed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Info,
|
Info,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A warning is displayed.
|
/// A warning is displayed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Warning,
|
Warning,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An error is displayed.
|
/// An error is displayed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Error
|
Error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,30 +1,30 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ClassDiagram MajorVersion="1" MinorVersion="1">
|
<ClassDiagram MajorVersion="1" MinorVersion="1">
|
||||||
<Class Name="Hardcodet.Wpf.TaskbarNotification.TaskbarIcon">
|
<Class Name="Hardcodet.Wpf.TaskbarNotification.TaskbarIcon">
|
||||||
<Position X="1.75" Y="0.5" Width="3.5" />
|
<Position X="1.75" Y="0.5" Width="3.5" />
|
||||||
<Compartments>
|
<Compartments>
|
||||||
<Compartment Name="Fields" Collapsed="true" />
|
<Compartment Name="Fields" Collapsed="true" />
|
||||||
<Compartment Name="Methods" Collapsed="true" />
|
<Compartment Name="Methods" Collapsed="true" />
|
||||||
</Compartments>
|
</Compartments>
|
||||||
<TypeIdentifier>
|
<TypeIdentifier>
|
||||||
<HashCode>N6qdVIeUdLmQtSUbiJhEGdYRjvJYXlhbEVBDKuPRO5s=</HashCode>
|
<HashCode>N6qdVIeUdLmQtSUbiJhEGdYRjvJYXlhbEVBDKuPRO5s=</HashCode>
|
||||||
<FileName>TaskbarIcon.cs</FileName>
|
<FileName>TaskbarIcon.cs</FileName>
|
||||||
</TypeIdentifier>
|
</TypeIdentifier>
|
||||||
<Lollipop Position="0.2" />
|
<Lollipop Position="0.2" />
|
||||||
</Class>
|
</Class>
|
||||||
<Enum Name="Hardcodet.Wpf.TaskbarNotification.PopupActivationMode">
|
<Enum Name="Hardcodet.Wpf.TaskbarNotification.PopupActivationMode">
|
||||||
<Position X="6.75" Y="0.5" Width="2" />
|
<Position X="6.75" Y="0.5" Width="2" />
|
||||||
<TypeIdentifier>
|
<TypeIdentifier>
|
||||||
<HashCode>ABAEAAAAAAAAAAABAAAAAAAAAAAAAAAAAIAKAIAAAAA=</HashCode>
|
<HashCode>ABAEAAAAAAAAAAABAAAAAAAAAAAAAAAAAIAKAIAAAAA=</HashCode>
|
||||||
<FileName>PopupActivationMode.cs</FileName>
|
<FileName>PopupActivationMode.cs</FileName>
|
||||||
</TypeIdentifier>
|
</TypeIdentifier>
|
||||||
</Enum>
|
</Enum>
|
||||||
<Enum Name="Hardcodet.Wpf.TaskbarNotification.BalloonIcon">
|
<Enum Name="Hardcodet.Wpf.TaskbarNotification.BalloonIcon">
|
||||||
<Position X="9.25" Y="0.5" Width="1.5" />
|
<Position X="9.25" Y="0.5" Width="1.5" />
|
||||||
<TypeIdentifier>
|
<TypeIdentifier>
|
||||||
<HashCode>AAAAAAAAAAAAAQAAAAAAABAAAAAAAAAAAAAAAEEAAAA=</HashCode>
|
<HashCode>AAAAAAAAAAAAAQAAAAAAABAAAAAAAAAAAAAAAEEAAAA=</HashCode>
|
||||||
<FileName>BalloonIcon.cs</FileName>
|
<FileName>BalloonIcon.cs</FileName>
|
||||||
</TypeIdentifier>
|
</TypeIdentifier>
|
||||||
</Enum>
|
</Enum>
|
||||||
<Font Name="Segoe UI" Size="9" />
|
<Font Name="Segoe UI" Size="9" />
|
||||||
</ClassDiagram>
|
</ClassDiagram>
|
||||||
@@ -1,61 +1,61 @@
|
|||||||
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Flags that define the icon that is shown on a balloon
|
/// Flags that define the icon that is shown on a balloon
|
||||||
/// tooltip.
|
/// tooltip.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum BalloonFlags
|
public enum BalloonFlags
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// No icon is displayed.
|
/// No icon is displayed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
None = 0x00,
|
None = 0x00,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An information icon is displayed.
|
/// An information icon is displayed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Info = 0x01,
|
Info = 0x01,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A warning icon is displayed.
|
/// A warning icon is displayed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Warning = 0x02,
|
Warning = 0x02,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An error icon is displayed.
|
/// An error icon is displayed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Error = 0x03,
|
Error = 0x03,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Windows XP Service Pack 2 (SP2) and later.
|
/// Windows XP Service Pack 2 (SP2) and later.
|
||||||
/// Use a custom icon as the title icon.
|
/// Use a custom icon as the title icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
User = 0x04,
|
User = 0x04,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Windows XP (Shell32.dll version 6.0) and later.
|
/// Windows XP (Shell32.dll version 6.0) and later.
|
||||||
/// Do not play the associated sound. Applies only to balloon ToolTips.
|
/// Do not play the associated sound. Applies only to balloon ToolTips.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
NoSound = 0x10,
|
NoSound = 0x10,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Windows Vista (Shell32.dll version 6.0.6) and later. The large version
|
/// Windows Vista (Shell32.dll version 6.0.6) and later. The large version
|
||||||
/// of the icon should be used as the balloon icon. This corresponds to the
|
/// of the icon should be used as the balloon icon. This corresponds to the
|
||||||
/// icon with dimensions SM_CXICON x SM_CYICON. If this flag is not set,
|
/// icon with dimensions SM_CXICON x SM_CYICON. If this flag is not set,
|
||||||
/// the icon with dimensions XM_CXSMICON x SM_CYSMICON is used.<br/>
|
/// the icon with dimensions XM_CXSMICON x SM_CYSMICON is used.<br/>
|
||||||
/// - This flag can be used with all stock icons.<br/>
|
/// - This flag can be used with all stock icons.<br/>
|
||||||
/// - Applications that use older customized icons (NIIF_USER with hIcon) must
|
/// - Applications that use older customized icons (NIIF_USER with hIcon) must
|
||||||
/// provide a new SM_CXICON x SM_CYICON version in the tray icon (hIcon). These
|
/// provide a new SM_CXICON x SM_CYICON version in the tray icon (hIcon). These
|
||||||
/// icons are scaled down when they are displayed in the System Tray or
|
/// icons are scaled down when they are displayed in the System Tray or
|
||||||
/// System Control Area (SCA).<br/>
|
/// System Control Area (SCA).<br/>
|
||||||
/// - New customized icons (NIIF_USER with hBalloonIcon) must supply an
|
/// - New customized icons (NIIF_USER with hBalloonIcon) must supply an
|
||||||
/// SM_CXICON x SM_CYICON version in the supplied icon (hBalloonIcon).
|
/// SM_CXICON x SM_CYICON version in the supplied icon (hBalloonIcon).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
LargeIcon = 0x20,
|
LargeIcon = 0x20,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Windows 7 and later.
|
/// Windows 7 and later.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
RespectQuietTime = 0x80
|
RespectQuietTime = 0x80
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,70 +1,70 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates which members of a <see cref="NotifyIconData"/> structure
|
/// Indicates which members of a <see cref="NotifyIconData"/> structure
|
||||||
/// were set, and thus contain valid data or provide additional information
|
/// were set, and thus contain valid data or provide additional information
|
||||||
/// to the ToolTip as to how it should display.
|
/// to the ToolTip as to how it should display.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum IconDataMembers
|
public enum IconDataMembers
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The message ID is set.
|
/// The message ID is set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Message = 0x01,
|
Message = 0x01,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The notification icon is set.
|
/// The notification icon is set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Icon = 0x02,
|
Icon = 0x02,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The tooltip is set.
|
/// The tooltip is set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Tip = 0x04,
|
Tip = 0x04,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// State information (<see cref="IconState"/>) is set. This
|
/// State information (<see cref="IconState"/>) is set. This
|
||||||
/// applies to both <see cref="NotifyIconData.IconState"/> and
|
/// applies to both <see cref="NotifyIconData.IconState"/> and
|
||||||
/// <see cref="NotifyIconData.StateMask"/>.
|
/// <see cref="NotifyIconData.StateMask"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
State = 0x08,
|
State = 0x08,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The balloon ToolTip is set. Accordingly, the following
|
/// The balloon ToolTip is set. Accordingly, the following
|
||||||
/// members are set: <see cref="NotifyIconData.BalloonText"/>,
|
/// members are set: <see cref="NotifyIconData.BalloonText"/>,
|
||||||
/// <see cref="NotifyIconData.BalloonTitle"/>, <see cref="NotifyIconData.BalloonFlags"/>,
|
/// <see cref="NotifyIconData.BalloonTitle"/>, <see cref="NotifyIconData.BalloonFlags"/>,
|
||||||
/// and <see cref="NotifyIconData.VersionOrTimeout"/>.
|
/// and <see cref="NotifyIconData.VersionOrTimeout"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Info = 0x10,
|
Info = 0x10,
|
||||||
|
|
||||||
// Internal identifier is set. Reserved, thus commented out.
|
// Internal identifier is set. Reserved, thus commented out.
|
||||||
//Guid = 0x20,
|
//Guid = 0x20,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Windows Vista (Shell32.dll version 6.0.6) and later. If the ToolTip
|
/// Windows Vista (Shell32.dll version 6.0.6) and later. If the ToolTip
|
||||||
/// cannot be displayed immediately, discard it.<br/>
|
/// cannot be displayed immediately, discard it.<br/>
|
||||||
/// Use this flag for ToolTips that represent real-time information which
|
/// Use this flag for ToolTips that represent real-time information which
|
||||||
/// would be meaningless or misleading if displayed at a later time.
|
/// would be meaningless or misleading if displayed at a later time.
|
||||||
/// For example, a message that states "Your telephone is ringing."<br/>
|
/// For example, a message that states "Your telephone is ringing."<br/>
|
||||||
/// This modifies and must be combined with the <see cref="Info"/> flag.
|
/// This modifies and must be combined with the <see cref="Info"/> flag.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Realtime = 0x40,
|
Realtime = 0x40,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Windows Vista (Shell32.dll version 6.0.6) and later.
|
/// Windows Vista (Shell32.dll version 6.0.6) and later.
|
||||||
/// Use the standard ToolTip. Normally, when uVersion is set
|
/// Use the standard ToolTip. Normally, when uVersion is set
|
||||||
/// to NOTIFYICON_VERSION_4, the standard ToolTip is replaced
|
/// to NOTIFYICON_VERSION_4, the standard ToolTip is replaced
|
||||||
/// by the application-drawn pop-up user interface (UI).
|
/// by the application-drawn pop-up user interface (UI).
|
||||||
/// If the application wants to show the standard tooltip
|
/// If the application wants to show the standard tooltip
|
||||||
/// in that case, regardless of whether the on-hover UI is showing,
|
/// in that case, regardless of whether the on-hover UI is showing,
|
||||||
/// it can specify NIF_SHOWTIP to indicate the standard tooltip
|
/// it can specify NIF_SHOWTIP to indicate the standard tooltip
|
||||||
/// should still be shown.<br/>
|
/// should still be shown.<br/>
|
||||||
/// Note that the NIF_SHOWTIP flag is effective until the next call
|
/// Note that the NIF_SHOWTIP flag is effective until the next call
|
||||||
/// to Shell_NotifyIcon.
|
/// to Shell_NotifyIcon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
UseLegacyToolTips = 0x80
|
UseLegacyToolTips = 0x80
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The state of the icon - can be set to
|
/// The state of the icon - can be set to
|
||||||
/// hide the icon.
|
/// hide the icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum IconState
|
public enum IconState
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The icon is visible.
|
/// The icon is visible.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Visible = 0x00,
|
Visible = 0x00,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Hide the icon.
|
/// Hide the icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Hidden = 0x01,
|
Hidden = 0x01,
|
||||||
|
|
||||||
// The icon is shared - currently not supported, thus commented out.
|
// The icon is shared - currently not supported, thus commented out.
|
||||||
//Shared = 0x02
|
//Shared = 0x02
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,54 +1,54 @@
|
|||||||
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event flags for clicked events.
|
/// Event flags for clicked events.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum MouseEvent
|
public enum MouseEvent
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The mouse was moved withing the
|
/// The mouse was moved withing the
|
||||||
/// taskbar icon's area.
|
/// taskbar icon's area.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
MouseMove,
|
MouseMove,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The right mouse button was clicked.
|
/// The right mouse button was clicked.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IconRightMouseDown,
|
IconRightMouseDown,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The left mouse button was clicked.
|
/// The left mouse button was clicked.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IconLeftMouseDown,
|
IconLeftMouseDown,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The right mouse button was released.
|
/// The right mouse button was released.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IconRightMouseUp,
|
IconRightMouseUp,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The left mouse button was released.
|
/// The left mouse button was released.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IconLeftMouseUp,
|
IconLeftMouseUp,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The middle mouse button was clicked.
|
/// The middle mouse button was clicked.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IconMiddleMouseDown,
|
IconMiddleMouseDown,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The middle mouse button was released.
|
/// The middle mouse button was released.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IconMiddleMouseUp,
|
IconMiddleMouseUp,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The taskbar icon was double clicked.
|
/// The taskbar icon was double clicked.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IconDoubleClick,
|
IconDoubleClick,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The balloon tip was clicked.
|
/// The balloon tip was clicked.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
BalloonToolTipClicked
|
BalloonToolTipClicked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,41 +1,41 @@
|
|||||||
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Main operations performed on the
|
/// Main operations performed on the
|
||||||
/// <see cref="WinApi.Shell_NotifyIcon"/> function.
|
/// <see cref="WinApi.Shell_NotifyIcon"/> function.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum NotifyCommand
|
public enum NotifyCommand
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The taskbar icon is being created.
|
/// The taskbar icon is being created.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Add = 0x00,
|
Add = 0x00,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The settings of the taskbar icon are being updated.
|
/// The settings of the taskbar icon are being updated.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Modify = 0x01,
|
Modify = 0x01,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The taskbar icon is deleted.
|
/// The taskbar icon is deleted.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Delete = 0x02,
|
Delete = 0x02,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Focus is returned to the taskbar icon. Currently not in use.
|
/// Focus is returned to the taskbar icon. Currently not in use.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
SetFocus = 0x03,
|
SetFocus = 0x03,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shell32.dll version 5.0 and later only. Instructs the taskbar
|
/// Shell32.dll version 5.0 and later only. Instructs the taskbar
|
||||||
/// to behave according to the version number specified in the
|
/// to behave according to the version number specified in the
|
||||||
/// uVersion member of the structure pointed to by lpdata.
|
/// uVersion member of the structure pointed to by lpdata.
|
||||||
/// This message allows you to specify whether you want the version
|
/// This message allows you to specify whether you want the version
|
||||||
/// 5.0 behavior found on Microsoft Windows 2000 systems, or the
|
/// 5.0 behavior found on Microsoft Windows 2000 systems, or the
|
||||||
/// behavior found on earlier Shell versions. The default value for
|
/// behavior found on earlier Shell versions. The default value for
|
||||||
/// uVersion is zero, indicating that the original Windows 95 notify
|
/// uVersion is zero, indicating that the original Windows 95 notify
|
||||||
/// icon behavior should be used.
|
/// icon behavior should be used.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
SetVersion = 0x04
|
SetVersion = 0x04
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,165 +1,165 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A struct that is submitted in order to configure
|
/// A struct that is submitted in order to configure
|
||||||
/// the taskbar icon. Provides various members that
|
/// the taskbar icon. Provides various members that
|
||||||
/// can be configured partially, according to the
|
/// can be configured partially, according to the
|
||||||
/// values of the <see cref="IconDataMembers"/>
|
/// values of the <see cref="IconDataMembers"/>
|
||||||
/// that were defined.
|
/// that were defined.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||||
public struct NotifyIconData
|
public struct NotifyIconData
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Size of this structure, in bytes.
|
/// Size of this structure, in bytes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint cbSize;
|
public uint cbSize;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handle to the window that receives notification messages associated with an icon in the
|
/// Handle to the window that receives notification messages associated with an icon in the
|
||||||
/// taskbar status area. The Shell uses hWnd and uID to identify which icon to operate on
|
/// taskbar status area. The Shell uses hWnd and uID to identify which icon to operate on
|
||||||
/// when Shell_NotifyIcon is invoked.
|
/// when Shell_NotifyIcon is invoked.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IntPtr WindowHandle;
|
public IntPtr WindowHandle;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Application-defined identifier of the taskbar icon. The Shell uses hWnd and uID to identify
|
/// Application-defined identifier of the taskbar icon. The Shell uses hWnd and uID to identify
|
||||||
/// which icon to operate on when Shell_NotifyIcon is invoked. You can have multiple icons
|
/// which icon to operate on when Shell_NotifyIcon is invoked. You can have multiple icons
|
||||||
/// associated with a single hWnd by assigning each a different uID. This feature, however
|
/// associated with a single hWnd by assigning each a different uID. This feature, however
|
||||||
/// is currently not used.
|
/// is currently not used.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint TaskbarIconId;
|
public uint TaskbarIconId;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Flags that indicate which of the other members contain valid data. This member can be
|
/// Flags that indicate which of the other members contain valid data. This member can be
|
||||||
/// a combination of the NIF_XXX constants.
|
/// a combination of the NIF_XXX constants.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IconDataMembers ValidMembers;
|
public IconDataMembers ValidMembers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Application-defined message identifier. The system uses this identifier to send
|
/// Application-defined message identifier. The system uses this identifier to send
|
||||||
/// notifications to the window identified in hWnd.
|
/// notifications to the window identified in hWnd.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint CallbackMessageId;
|
public uint CallbackMessageId;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A handle to the icon that should be displayed. Just
|
/// A handle to the icon that should be displayed. Just
|
||||||
/// <c>Icon.Handle</c>.
|
/// <c>Icon.Handle</c>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IntPtr IconHandle;
|
public IntPtr IconHandle;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// String with the text for a standard ToolTip. It can have a maximum of 64 characters including
|
/// String with the text for a standard ToolTip. It can have a maximum of 64 characters including
|
||||||
/// the terminating NULL. For Version 5.0 and later, szTip can have a maximum of
|
/// the terminating NULL. For Version 5.0 and later, szTip can have a maximum of
|
||||||
/// 128 characters, including the terminating NULL.
|
/// 128 characters, including the terminating NULL.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string ToolTipText;
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string ToolTipText;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// State of the icon. Remember to also set the <see cref="StateMask"/>.
|
/// State of the icon. Remember to also set the <see cref="StateMask"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IconState IconState;
|
public IconState IconState;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A value that specifies which bits of the state member are retrieved or modified.
|
/// A value that specifies which bits of the state member are retrieved or modified.
|
||||||
/// For example, setting this member to <see cref="Interop.IconState.Hidden"/>
|
/// For example, setting this member to <see cref="Interop.IconState.Hidden"/>
|
||||||
/// causes only the item's hidden
|
/// causes only the item's hidden
|
||||||
/// state to be retrieved.
|
/// state to be retrieved.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IconState StateMask;
|
public IconState StateMask;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// String with the text for a balloon ToolTip. It can have a maximum of 255 characters.
|
/// String with the text for a balloon ToolTip. It can have a maximum of 255 characters.
|
||||||
/// To remove the ToolTip, set the NIF_INFO flag in uFlags and set szInfo to an empty string.
|
/// To remove the ToolTip, set the NIF_INFO flag in uFlags and set szInfo to an empty string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string BalloonText;
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string BalloonText;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Mainly used to set the version when <see cref="WinApi.Shell_NotifyIcon"/> is invoked
|
/// Mainly used to set the version when <see cref="WinApi.Shell_NotifyIcon"/> is invoked
|
||||||
/// with <see cref="NotifyCommand.SetVersion"/>. However, for legacy operations,
|
/// with <see cref="NotifyCommand.SetVersion"/>. However, for legacy operations,
|
||||||
/// the same member is also used to set timouts for balloon ToolTips.
|
/// the same member is also used to set timouts for balloon ToolTips.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint VersionOrTimeout;
|
public uint VersionOrTimeout;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// String containing a title for a balloon ToolTip. This title appears in boldface
|
/// String containing a title for a balloon ToolTip. This title appears in boldface
|
||||||
/// above the text. It can have a maximum of 63 characters.
|
/// above the text. It can have a maximum of 63 characters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string BalloonTitle;
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string BalloonTitle;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds an icon to a balloon ToolTip, which is placed to the left of the title. If the
|
/// Adds an icon to a balloon ToolTip, which is placed to the left of the title. If the
|
||||||
/// <see cref="BalloonTitle"/> member is zero-length, the icon is not shown.
|
/// <see cref="BalloonTitle"/> member is zero-length, the icon is not shown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public BalloonFlags BalloonFlags;
|
public BalloonFlags BalloonFlags;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Windows XP (Shell32.dll version 6.0) and later.<br/>
|
/// Windows XP (Shell32.dll version 6.0) and later.<br/>
|
||||||
/// - Windows 7 and later: A registered GUID that identifies the icon.
|
/// - Windows 7 and later: A registered GUID that identifies the icon.
|
||||||
/// This value overrides uID and is the recommended method of identifying the icon.<br/>
|
/// This value overrides uID and is the recommended method of identifying the icon.<br/>
|
||||||
/// - Windows XP through Windows Vista: Reserved.
|
/// - Windows XP through Windows Vista: Reserved.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid TaskbarIconGuid;
|
public Guid TaskbarIconGuid;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Windows Vista (Shell32.dll version 6.0.6) and later. The handle of a customized
|
/// Windows Vista (Shell32.dll version 6.0.6) and later. The handle of a customized
|
||||||
/// balloon icon provided by the application that should be used independently
|
/// balloon icon provided by the application that should be used independently
|
||||||
/// of the tray icon. If this member is non-NULL and the <see cref="Interop.BalloonFlags.User"/>
|
/// of the tray icon. If this member is non-NULL and the <see cref="Interop.BalloonFlags.User"/>
|
||||||
/// flag is set, this icon is used as the balloon icon.<br/>
|
/// flag is set, this icon is used as the balloon icon.<br/>
|
||||||
/// If this member is NULL, the legacy behavior is carried out.
|
/// If this member is NULL, the legacy behavior is carried out.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IntPtr CustomBalloonIconHandle;
|
public IntPtr CustomBalloonIconHandle;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a default data structure that provides
|
/// Creates a default data structure that provides
|
||||||
/// a hidden taskbar icon without the icon being set.
|
/// a hidden taskbar icon without the icon being set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="handle"></param>
|
/// <param name="handle"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static NotifyIconData CreateDefault(IntPtr handle)
|
public static NotifyIconData CreateDefault(IntPtr handle)
|
||||||
{
|
{
|
||||||
var data = new NotifyIconData();
|
var data = new NotifyIconData();
|
||||||
|
|
||||||
if (Environment.OSVersion.Version.Major >= 6)
|
if (Environment.OSVersion.Version.Major >= 6)
|
||||||
{
|
{
|
||||||
//use the current size
|
//use the current size
|
||||||
data.cbSize = (uint) Marshal.SizeOf(data);
|
data.cbSize = (uint) Marshal.SizeOf(data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//we need to set another size on xp/2003- otherwise certain
|
//we need to set another size on xp/2003- otherwise certain
|
||||||
//features (e.g. balloon tooltips) don't work.
|
//features (e.g. balloon tooltips) don't work.
|
||||||
data.cbSize = 952; // NOTIFYICONDATAW_V3_SIZE
|
data.cbSize = 952; // NOTIFYICONDATAW_V3_SIZE
|
||||||
|
|
||||||
//set to fixed timeout
|
//set to fixed timeout
|
||||||
data.VersionOrTimeout = 10;
|
data.VersionOrTimeout = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
data.WindowHandle = handle;
|
data.WindowHandle = handle;
|
||||||
data.TaskbarIconId = 0x0;
|
data.TaskbarIconId = 0x0;
|
||||||
data.CallbackMessageId = WindowMessageSink.CallbackMessageId;
|
data.CallbackMessageId = WindowMessageSink.CallbackMessageId;
|
||||||
data.VersionOrTimeout = (uint) NotifyIconVersion.Win95;
|
data.VersionOrTimeout = (uint) NotifyIconVersion.Win95;
|
||||||
|
|
||||||
data.IconHandle = IntPtr.Zero;
|
data.IconHandle = IntPtr.Zero;
|
||||||
|
|
||||||
//hide initially
|
//hide initially
|
||||||
data.IconState = IconState.Hidden;
|
data.IconState = IconState.Hidden;
|
||||||
data.StateMask = IconState.Hidden;
|
data.StateMask = IconState.Hidden;
|
||||||
|
|
||||||
//set flags
|
//set flags
|
||||||
data.ValidMembers = IconDataMembers.Message
|
data.ValidMembers = IconDataMembers.Message
|
||||||
| IconDataMembers.Icon
|
| IconDataMembers.Icon
|
||||||
| IconDataMembers.Tip;
|
| IconDataMembers.Tip;
|
||||||
|
|
||||||
//reset strings
|
//reset strings
|
||||||
data.ToolTipText = data.BalloonText = data.BalloonTitle = String.Empty;
|
data.ToolTipText = data.BalloonText = data.BalloonTitle = String.Empty;
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,27 +1,27 @@
|
|||||||
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The notify icon version that is used. The higher
|
/// The notify icon version that is used. The higher
|
||||||
/// the version, the more capabilities are available.
|
/// the version, the more capabilities are available.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum NotifyIconVersion
|
public enum NotifyIconVersion
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default behavior (legacy Win95). Expects
|
/// Default behavior (legacy Win95). Expects
|
||||||
/// a <see cref="NotifyIconData"/> size of 488.
|
/// a <see cref="NotifyIconData"/> size of 488.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Win95 = 0x0,
|
Win95 = 0x0,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Behavior representing Win2000 an higher. Expects
|
/// Behavior representing Win2000 an higher. Expects
|
||||||
/// a <see cref="NotifyIconData"/> size of 504.
|
/// a <see cref="NotifyIconData"/> size of 504.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Win2000 = 0x3,
|
Win2000 = 0x3,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Extended tooltip support, which is available
|
/// Extended tooltip support, which is available
|
||||||
/// for Vista and later.
|
/// for Vista and later.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Vista = 0x4
|
Vista = 0x4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Win API struct providing coordinates for a single point.
|
/// Win API struct providing coordinates for a single point.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public struct Point
|
public struct Point
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// X coordinate.
|
/// X coordinate.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int X;
|
public int X;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Y coordinate.
|
/// Y coordinate.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Y;
|
public int Y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,164 +1,164 @@
|
|||||||
// Some interop code taken from Mike Marshall's AnyForm
|
// Some interop code taken from Mike Marshall's AnyForm
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
|
||||||
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resolves the current tray position.
|
/// Resolves the current tray position.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class TrayInfo
|
public static class TrayInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the position of the system tray.
|
/// Gets the position of the system tray.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Tray coordinates.</returns>
|
/// <returns>Tray coordinates.</returns>
|
||||||
public static Point GetTrayLocation()
|
public static Point GetTrayLocation()
|
||||||
{
|
{
|
||||||
var info = new AppBarInfo();
|
var info = new AppBarInfo();
|
||||||
info.GetSystemTaskBarPosition();
|
info.GetSystemTaskBarPosition();
|
||||||
|
|
||||||
Rectangle rcWorkArea = info.WorkArea;
|
Rectangle rcWorkArea = info.WorkArea;
|
||||||
|
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
if (info.Edge == AppBarInfo.ScreenEdge.Left)
|
if (info.Edge == AppBarInfo.ScreenEdge.Left)
|
||||||
{
|
{
|
||||||
x = rcWorkArea.Left + 2;
|
x = rcWorkArea.Left + 2;
|
||||||
y = rcWorkArea.Bottom;
|
y = rcWorkArea.Bottom;
|
||||||
}
|
}
|
||||||
else if (info.Edge == AppBarInfo.ScreenEdge.Bottom)
|
else if (info.Edge == AppBarInfo.ScreenEdge.Bottom)
|
||||||
{
|
{
|
||||||
x = rcWorkArea.Right;
|
x = rcWorkArea.Right;
|
||||||
y = rcWorkArea.Bottom;
|
y = rcWorkArea.Bottom;
|
||||||
}
|
}
|
||||||
else if (info.Edge == AppBarInfo.ScreenEdge.Top)
|
else if (info.Edge == AppBarInfo.ScreenEdge.Top)
|
||||||
{
|
{
|
||||||
x = rcWorkArea.Right;
|
x = rcWorkArea.Right;
|
||||||
y = rcWorkArea.Top;
|
y = rcWorkArea.Top;
|
||||||
}
|
}
|
||||||
else if (info.Edge == AppBarInfo.ScreenEdge.Right)
|
else if (info.Edge == AppBarInfo.ScreenEdge.Right)
|
||||||
{
|
{
|
||||||
x = rcWorkArea.Right;
|
x = rcWorkArea.Right;
|
||||||
y = rcWorkArea.Bottom;
|
y = rcWorkArea.Bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Point {X = x, Y = y};
|
return new Point {X = x, Y = y};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
internal class AppBarInfo
|
internal class AppBarInfo
|
||||||
{
|
{
|
||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
private static extern IntPtr FindWindow(String lpClassName, String lpWindowName);
|
private static extern IntPtr FindWindow(String lpClassName, String lpWindowName);
|
||||||
|
|
||||||
[DllImport("shell32.dll")]
|
[DllImport("shell32.dll")]
|
||||||
private static extern UInt32 SHAppBarMessage(UInt32 dwMessage, ref APPBARDATA data);
|
private static extern UInt32 SHAppBarMessage(UInt32 dwMessage, ref APPBARDATA data);
|
||||||
|
|
||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
private static extern Int32 SystemParametersInfo(UInt32 uiAction, UInt32 uiParam,
|
private static extern Int32 SystemParametersInfo(UInt32 uiAction, UInt32 uiParam,
|
||||||
IntPtr pvParam, UInt32 fWinIni);
|
IntPtr pvParam, UInt32 fWinIni);
|
||||||
|
|
||||||
|
|
||||||
private const int ABE_BOTTOM = 3;
|
private const int ABE_BOTTOM = 3;
|
||||||
private const int ABE_LEFT = 0;
|
private const int ABE_LEFT = 0;
|
||||||
private const int ABE_RIGHT = 2;
|
private const int ABE_RIGHT = 2;
|
||||||
private const int ABE_TOP = 1;
|
private const int ABE_TOP = 1;
|
||||||
|
|
||||||
private const int ABM_GETTASKBARPOS = 0x00000005;
|
private const int ABM_GETTASKBARPOS = 0x00000005;
|
||||||
|
|
||||||
// SystemParametersInfo constants
|
// SystemParametersInfo constants
|
||||||
private const UInt32 SPI_GETWORKAREA = 0x0030;
|
private const UInt32 SPI_GETWORKAREA = 0x0030;
|
||||||
|
|
||||||
private APPBARDATA m_data;
|
private APPBARDATA m_data;
|
||||||
|
|
||||||
public ScreenEdge Edge
|
public ScreenEdge Edge
|
||||||
{
|
{
|
||||||
get { return (ScreenEdge) m_data.uEdge; }
|
get { return (ScreenEdge) m_data.uEdge; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Rectangle WorkArea
|
public Rectangle WorkArea
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
Int32 bResult = 0;
|
Int32 bResult = 0;
|
||||||
var rc = new RECT();
|
var rc = new RECT();
|
||||||
IntPtr rawRect = Marshal.AllocHGlobal(Marshal.SizeOf(rc));
|
IntPtr rawRect = Marshal.AllocHGlobal(Marshal.SizeOf(rc));
|
||||||
bResult = SystemParametersInfo(SPI_GETWORKAREA, 0, rawRect, 0);
|
bResult = SystemParametersInfo(SPI_GETWORKAREA, 0, rawRect, 0);
|
||||||
rc = (RECT) Marshal.PtrToStructure(rawRect, rc.GetType());
|
rc = (RECT) Marshal.PtrToStructure(rawRect, rc.GetType());
|
||||||
|
|
||||||
if (bResult == 1)
|
if (bResult == 1)
|
||||||
{
|
{
|
||||||
Marshal.FreeHGlobal(rawRect);
|
Marshal.FreeHGlobal(rawRect);
|
||||||
return new Rectangle(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
|
return new Rectangle(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Rectangle(0, 0, 0, 0);
|
return new Rectangle(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void GetPosition(string strClassName, string strWindowName)
|
public void GetPosition(string strClassName, string strWindowName)
|
||||||
{
|
{
|
||||||
m_data = new APPBARDATA();
|
m_data = new APPBARDATA();
|
||||||
m_data.cbSize = (UInt32) Marshal.SizeOf(m_data.GetType());
|
m_data.cbSize = (UInt32) Marshal.SizeOf(m_data.GetType());
|
||||||
|
|
||||||
IntPtr hWnd = FindWindow(strClassName, strWindowName);
|
IntPtr hWnd = FindWindow(strClassName, strWindowName);
|
||||||
|
|
||||||
if (hWnd != IntPtr.Zero)
|
if (hWnd != IntPtr.Zero)
|
||||||
{
|
{
|
||||||
UInt32 uResult = SHAppBarMessage(ABM_GETTASKBARPOS, ref m_data);
|
UInt32 uResult = SHAppBarMessage(ABM_GETTASKBARPOS, ref m_data);
|
||||||
|
|
||||||
if (uResult != 1)
|
if (uResult != 1)
|
||||||
{
|
{
|
||||||
throw new Exception("Failed to communicate with the given AppBar");
|
throw new Exception("Failed to communicate with the given AppBar");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new Exception("Failed to find an AppBar that matched the given criteria");
|
throw new Exception("Failed to find an AppBar that matched the given criteria");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void GetSystemTaskBarPosition()
|
public void GetSystemTaskBarPosition()
|
||||||
{
|
{
|
||||||
GetPosition("Shell_TrayWnd", null);
|
GetPosition("Shell_TrayWnd", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public enum ScreenEdge
|
public enum ScreenEdge
|
||||||
{
|
{
|
||||||
Undefined = -1,
|
Undefined = -1,
|
||||||
Left = ABE_LEFT,
|
Left = ABE_LEFT,
|
||||||
Top = ABE_TOP,
|
Top = ABE_TOP,
|
||||||
Right = ABE_RIGHT,
|
Right = ABE_RIGHT,
|
||||||
Bottom = ABE_BOTTOM
|
Bottom = ABE_BOTTOM
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
private struct APPBARDATA
|
private struct APPBARDATA
|
||||||
{
|
{
|
||||||
public UInt32 cbSize;
|
public UInt32 cbSize;
|
||||||
public IntPtr hWnd;
|
public IntPtr hWnd;
|
||||||
public UInt32 uCallbackMessage;
|
public UInt32 uCallbackMessage;
|
||||||
public UInt32 uEdge;
|
public UInt32 uEdge;
|
||||||
public RECT rc;
|
public RECT rc;
|
||||||
public Int32 lParam;
|
public Int32 lParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
private struct RECT
|
private struct RECT
|
||||||
{
|
{
|
||||||
public Int32 left;
|
public Int32 left;
|
||||||
public Int32 top;
|
public Int32 top;
|
||||||
public Int32 right;
|
public Int32 right;
|
||||||
public Int32 bottom;
|
public Int32 bottom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,89 +1,89 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Win32 API imports.
|
/// Win32 API imports.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static class WinApi
|
internal static class WinApi
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates, updates or deletes the taskbar icon.
|
/// Creates, updates or deletes the taskbar icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DllImport("shell32.Dll", CharSet = CharSet.Unicode)]
|
[DllImport("shell32.Dll", CharSet = CharSet.Unicode)]
|
||||||
public static extern bool Shell_NotifyIcon(NotifyCommand cmd, [In] ref NotifyIconData data);
|
public static extern bool Shell_NotifyIcon(NotifyCommand cmd, [In] ref NotifyIconData data);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the helper window that receives messages from the taskar icon.
|
/// Creates the helper window that receives messages from the taskar icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DllImport("USER32.DLL", EntryPoint = "CreateWindowExW", SetLastError = true)]
|
[DllImport("USER32.DLL", EntryPoint = "CreateWindowExW", SetLastError = true)]
|
||||||
public static extern IntPtr CreateWindowEx(int dwExStyle, [MarshalAs(UnmanagedType.LPWStr)] string lpClassName,
|
public static extern IntPtr CreateWindowEx(int dwExStyle, [MarshalAs(UnmanagedType.LPWStr)] string lpClassName,
|
||||||
[MarshalAs(UnmanagedType.LPWStr)] string lpWindowName, int dwStyle, int x, int y,
|
[MarshalAs(UnmanagedType.LPWStr)] string lpWindowName, int dwStyle, int x, int y,
|
||||||
int nWidth, int nHeight, IntPtr hWndParent, IntPtr hMenu, IntPtr hInstance,
|
int nWidth, int nHeight, IntPtr hWndParent, IntPtr hMenu, IntPtr hInstance,
|
||||||
IntPtr lpParam);
|
IntPtr lpParam);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Processes a default windows procedure.
|
/// Processes a default windows procedure.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DllImport("USER32.DLL")]
|
[DllImport("USER32.DLL")]
|
||||||
public static extern IntPtr DefWindowProc(IntPtr hWnd, uint msg, IntPtr wparam, IntPtr lparam);
|
public static extern IntPtr DefWindowProc(IntPtr hWnd, uint msg, IntPtr wparam, IntPtr lparam);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Registers the helper window class.
|
/// Registers the helper window class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DllImport("USER32.DLL", EntryPoint = "RegisterClassW", SetLastError = true)]
|
[DllImport("USER32.DLL", EntryPoint = "RegisterClassW", SetLastError = true)]
|
||||||
public static extern short RegisterClass(ref WindowClass lpWndClass);
|
public static extern short RegisterClass(ref WindowClass lpWndClass);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Registers a listener for a window message.
|
/// Registers a listener for a window message.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="lpString"></param>
|
/// <param name="lpString"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[DllImport("User32.Dll", EntryPoint = "RegisterWindowMessageW")]
|
[DllImport("User32.Dll", EntryPoint = "RegisterWindowMessageW")]
|
||||||
public static extern uint RegisterWindowMessage([MarshalAs(UnmanagedType.LPWStr)] string lpString);
|
public static extern uint RegisterWindowMessage([MarshalAs(UnmanagedType.LPWStr)] string lpString);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used to destroy the hidden helper window that receives messages from the
|
/// Used to destroy the hidden helper window that receives messages from the
|
||||||
/// taskbar icon.
|
/// taskbar icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="hWnd"></param>
|
/// <param name="hWnd"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[DllImport("USER32.DLL", SetLastError = true)]
|
[DllImport("USER32.DLL", SetLastError = true)]
|
||||||
public static extern bool DestroyWindow(IntPtr hWnd);
|
public static extern bool DestroyWindow(IntPtr hWnd);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gives focus to a given window.
|
/// Gives focus to a given window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="hWnd"></param>
|
/// <param name="hWnd"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[DllImport("USER32.DLL")]
|
[DllImport("USER32.DLL")]
|
||||||
public static extern bool SetForegroundWindow(IntPtr hWnd);
|
public static extern bool SetForegroundWindow(IntPtr hWnd);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the maximum number of milliseconds that can elapse between a
|
/// Gets the maximum number of milliseconds that can elapse between a
|
||||||
/// first click and a second click for the OS to consider the
|
/// first click and a second click for the OS to consider the
|
||||||
/// mouse action a double-click.
|
/// mouse action a double-click.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The maximum amount of time, in milliseconds, that can
|
/// <returns>The maximum amount of time, in milliseconds, that can
|
||||||
/// elapse between a first click and a second click for the OS to
|
/// elapse between a first click and a second click for the OS to
|
||||||
/// consider the mouse action a double-click.</returns>
|
/// consider the mouse action a double-click.</returns>
|
||||||
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
|
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
|
||||||
public static extern int GetDoubleClickTime();
|
public static extern int GetDoubleClickTime();
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the screen coordinates of the current mouse position.
|
/// Gets the screen coordinates of the current mouse position.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DllImport("USER32.DLL", SetLastError = true)]
|
[DllImport("USER32.DLL", SetLastError = true)]
|
||||||
public static extern bool GetPhysicalCursorPos(ref Point lpPoint);
|
public static extern bool GetPhysicalCursorPos(ref Point lpPoint);
|
||||||
|
|
||||||
|
|
||||||
[DllImport("USER32.DLL", SetLastError = true)]
|
[DllImport("USER32.DLL", SetLastError = true)]
|
||||||
public static extern bool GetCursorPos(ref Point lpPoint);
|
public static extern bool GetCursorPos(ref Point lpPoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,35 +1,35 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Callback delegate which is used by the Windows API to
|
/// Callback delegate which is used by the Windows API to
|
||||||
/// submit window messages.
|
/// submit window messages.
|
||||||
/// </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.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public struct WindowClass
|
public struct WindowClass
|
||||||
{
|
{
|
||||||
#pragma warning disable 1591
|
#pragma warning disable 1591
|
||||||
|
|
||||||
public uint style;
|
public uint style;
|
||||||
public WindowProcedureHandler lpfnWndProc;
|
public WindowProcedureHandler lpfnWndProc;
|
||||||
public int cbClsExtra;
|
public int cbClsExtra;
|
||||||
public int cbWndExtra;
|
public int cbWndExtra;
|
||||||
public IntPtr hInstance;
|
public IntPtr hInstance;
|
||||||
public IntPtr hIcon;
|
public IntPtr hIcon;
|
||||||
public IntPtr hCursor;
|
public IntPtr hCursor;
|
||||||
public IntPtr hbrBackground;
|
public IntPtr hbrBackground;
|
||||||
[MarshalAs(UnmanagedType.LPWStr)] public string lpszMenuName;
|
[MarshalAs(UnmanagedType.LPWStr)] public string lpszMenuName;
|
||||||
[MarshalAs(UnmanagedType.LPWStr)] public string lpszClassName;
|
[MarshalAs(UnmanagedType.LPWStr)] public string lpszClassName;
|
||||||
|
|
||||||
#pragma warning restore 1591
|
#pragma warning restore 1591
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,367 +1,367 @@
|
|||||||
// hardcodet.net NotifyIcon for WPF
|
// hardcodet.net NotifyIcon for WPF
|
||||||
// Copyright (c) 2009 - 2013 Philipp Sumi
|
// Copyright (c) 2009 - 2013 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
|
||||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
// OTHER DEALINGS IN THE SOFTWARE.
|
// OTHER DEALINGS IN THE SOFTWARE.
|
||||||
//
|
//
|
||||||
// THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE
|
// THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE
|
||||||
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
namespace Hardcodet.Wpf.TaskbarNotification.Interop
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Receives messages from the taskbar icon through
|
/// Receives messages from the taskbar icon through
|
||||||
/// window messages of an underlying helper window.
|
/// window messages of an underlying helper window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class WindowMessageSink : IDisposable
|
public class WindowMessageSink : IDisposable
|
||||||
{
|
{
|
||||||
#region members
|
#region members
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The ID of messages that are received from the the
|
/// The ID of messages that are received from the the
|
||||||
/// taskbar icon.
|
/// taskbar icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const int CallbackMessageId = 0x400;
|
public const int CallbackMessageId = 0x400;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The ID of the message that is being received if the
|
/// The ID of the message that is being received if the
|
||||||
/// taskbar is (re)started.
|
/// taskbar is (re)started.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private uint taskbarRestartMessageId;
|
private uint taskbarRestartMessageId;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used to track whether a mouse-up event is just
|
/// Used to track whether a mouse-up event is just
|
||||||
/// the aftermath of a double-click and therefore needs
|
/// the aftermath of a double-click and therefore needs
|
||||||
/// to be suppressed.
|
/// to be suppressed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private bool isDoubleClick;
|
private bool isDoubleClick;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A delegate that processes messages of the hidden
|
/// A delegate that processes messages of the hidden
|
||||||
/// native window that receives window messages. Storing
|
/// native window that receives window messages. Storing
|
||||||
/// this reference makes sure we don't loose our reference
|
/// this reference makes sure we don't loose our reference
|
||||||
/// to the message window.
|
/// to the message window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private WindowProcedureHandler messageHandler;
|
private WindowProcedureHandler messageHandler;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Window class ID.
|
/// Window class ID.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal string WindowId { get; private set; }
|
internal string WindowId { get; private set; }
|
||||||
|
|
||||||
/// <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>
|
||||||
/// The version of the underlying icon. Defines how
|
/// The version of the underlying icon. Defines how
|
||||||
/// incoming messages are interpreted.
|
/// incoming messages are interpreted.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public NotifyIconVersion Version { get; set; }
|
public NotifyIconVersion Version { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region events
|
#region events
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The custom tooltip should be closed or hidden.
|
/// The custom tooltip should be closed or hidden.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<bool> ChangeToolTipStateRequest;
|
public event Action<bool> ChangeToolTipStateRequest;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fired in case the user clicked or moved within
|
/// Fired in case the user clicked or moved within
|
||||||
/// the taskbar icon area.
|
/// the taskbar icon area.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<MouseEvent> MouseEventReceived;
|
public event Action<MouseEvent> MouseEventReceived;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fired if a balloon ToolTip was either displayed
|
/// Fired if a balloon ToolTip was either displayed
|
||||||
/// or closed (indicated by the boolean flag).
|
/// or closed (indicated by the boolean flag).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<bool> BalloonToolTipChanged;
|
public event Action<bool> BalloonToolTipChanged;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fired if the taskbar was created or restarted. Requires the taskbar
|
/// Fired if the taskbar was created or restarted. Requires the taskbar
|
||||||
/// icon to be reset.
|
/// icon to be reset.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action TaskbarCreated;
|
public event Action TaskbarCreated;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region construction
|
#region construction
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new message sink that receives message from
|
/// Creates a new message sink that receives message from
|
||||||
/// a given taskbar icon.
|
/// a given taskbar icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="version"></param>
|
/// <param name="version"></param>
|
||||||
public WindowMessageSink(NotifyIconVersion version)
|
public WindowMessageSink(NotifyIconVersion version)
|
||||||
{
|
{
|
||||||
Version = version;
|
Version = version;
|
||||||
CreateMessageWindow();
|
CreateMessageWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private WindowMessageSink()
|
private WindowMessageSink()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a dummy instance that provides an empty
|
/// Creates a dummy instance that provides an empty
|
||||||
/// pointer rather than a real window handler.<br/>
|
/// pointer rather than a real window handler.<br/>
|
||||||
/// Used at design time.
|
/// Used at design time.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
internal static WindowMessageSink CreateEmpty()
|
internal static WindowMessageSink CreateEmpty()
|
||||||
{
|
{
|
||||||
return new WindowMessageSink
|
return new WindowMessageSink
|
||||||
{
|
{
|
||||||
MessageWindowHandle = IntPtr.Zero,
|
MessageWindowHandle = IntPtr.Zero,
|
||||||
Version = NotifyIconVersion.Vista
|
Version = NotifyIconVersion.Vista
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region CreateMessageWindow
|
#region CreateMessageWindow
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the helper message window that is used
|
/// Creates the helper message window that is used
|
||||||
/// to receive messages from the taskbar icon.
|
/// to receive messages from the taskbar icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void CreateMessageWindow()
|
private void CreateMessageWindow()
|
||||||
{
|
{
|
||||||
//generate a unique ID for the window
|
//generate a unique ID for the window
|
||||||
WindowId = "WPFTaskbarIcon_" + DateTime.Now.Ticks;
|
WindowId = "WPFTaskbarIcon_" + DateTime.Now.Ticks;
|
||||||
|
|
||||||
//register window message handler
|
//register window message handler
|
||||||
messageHandler = OnWindowMessageReceived;
|
messageHandler = OnWindowMessageReceived;
|
||||||
|
|
||||||
// Create a simple window class which is reference through
|
// Create a simple window class which is reference through
|
||||||
//the messageHandler delegate
|
//the messageHandler delegate
|
||||||
WindowClass wc;
|
WindowClass wc;
|
||||||
|
|
||||||
wc.style = 0;
|
wc.style = 0;
|
||||||
wc.lpfnWndProc = messageHandler;
|
wc.lpfnWndProc = messageHandler;
|
||||||
wc.cbClsExtra = 0;
|
wc.cbClsExtra = 0;
|
||||||
wc.cbWndExtra = 0;
|
wc.cbWndExtra = 0;
|
||||||
wc.hInstance = IntPtr.Zero;
|
wc.hInstance = IntPtr.Zero;
|
||||||
wc.hIcon = IntPtr.Zero;
|
wc.hIcon = IntPtr.Zero;
|
||||||
wc.hCursor = IntPtr.Zero;
|
wc.hCursor = IntPtr.Zero;
|
||||||
wc.hbrBackground = IntPtr.Zero;
|
wc.hbrBackground = IntPtr.Zero;
|
||||||
wc.lpszMenuName = "";
|
wc.lpszMenuName = "";
|
||||||
wc.lpszClassName = WindowId;
|
wc.lpszClassName = WindowId;
|
||||||
|
|
||||||
// Register the window class
|
// Register the window class
|
||||||
WinApi.RegisterClass(ref wc);
|
WinApi.RegisterClass(ref wc);
|
||||||
|
|
||||||
// Get the message used to indicate the taskbar has been restarted
|
// Get the message used to indicate the taskbar has been restarted
|
||||||
// This is used to re-add icons when the taskbar restarts
|
// This is used to re-add icons when the taskbar restarts
|
||||||
taskbarRestartMessageId = WinApi.RegisterWindowMessage("TaskbarCreated");
|
taskbarRestartMessageId = WinApi.RegisterWindowMessage("TaskbarCreated");
|
||||||
|
|
||||||
// Create the message window
|
// Create the message window
|
||||||
MessageWindowHandle = WinApi.CreateWindowEx(0, WindowId, "", 0, 0, 0, 1, 1, IntPtr.Zero, IntPtr.Zero,
|
MessageWindowHandle = WinApi.CreateWindowEx(0, WindowId, "", 0, 0, 0, 1, 1, IntPtr.Zero, IntPtr.Zero,
|
||||||
IntPtr.Zero, IntPtr.Zero);
|
IntPtr.Zero, IntPtr.Zero);
|
||||||
|
|
||||||
if (MessageWindowHandle == IntPtr.Zero)
|
if (MessageWindowHandle == IntPtr.Zero)
|
||||||
{
|
{
|
||||||
#if SILVERLIGHT
|
#if SILVERLIGHT
|
||||||
throw new Exception("Message window handle was not a valid pointer.");
|
throw new Exception("Message window handle was not a valid pointer.");
|
||||||
#else
|
#else
|
||||||
throw new Win32Exception("Message window handle was not a valid pointer");
|
throw new Win32Exception("Message window handle was not a valid pointer");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Handle Window Messages
|
#region Handle Window Messages
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Callback method that receives messages from the taskbar area.
|
/// Callback method that receives messages from the taskbar area.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private IntPtr OnWindowMessageReceived(IntPtr hwnd, uint messageId, IntPtr wparam, IntPtr lparam)
|
private IntPtr OnWindowMessageReceived(IntPtr hwnd, uint messageId, IntPtr wparam, IntPtr lparam)
|
||||||
{
|
{
|
||||||
if (messageId == taskbarRestartMessageId)
|
if (messageId == taskbarRestartMessageId)
|
||||||
{
|
{
|
||||||
//recreate the icon if the taskbar was restarted (e.g. due to Win Explorer shutdown)
|
//recreate the icon if the taskbar was restarted (e.g. due to Win Explorer shutdown)
|
||||||
TaskbarCreated();
|
TaskbarCreated();
|
||||||
}
|
}
|
||||||
|
|
||||||
//forward message
|
//forward message
|
||||||
ProcessWindowMessage(messageId, wparam, lparam);
|
ProcessWindowMessage(messageId, wparam, lparam);
|
||||||
|
|
||||||
// Pass the message to the default window procedure
|
// Pass the message to the default window procedure
|
||||||
return WinApi.DefWindowProc(hwnd, messageId, wparam, lparam);
|
return WinApi.DefWindowProc(hwnd, messageId, wparam, lparam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Processes incoming system messages.
|
/// Processes incoming system messages.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="msg">Callback ID.</param>
|
/// <param name="msg">Callback ID.</param>
|
||||||
/// <param name="wParam">If the version is <see cref="NotifyIconVersion.Vista"/>
|
/// <param name="wParam">If the version is <see cref="NotifyIconVersion.Vista"/>
|
||||||
/// or higher, this parameter can be used to resolve mouse coordinates.
|
/// or higher, this parameter can be used to resolve mouse coordinates.
|
||||||
/// Currently not in use.</param>
|
/// Currently not in use.</param>
|
||||||
/// <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;
|
if (msg != CallbackMessageId) return;
|
||||||
|
|
||||||
switch (lParam.ToInt32())
|
switch (lParam.ToInt32())
|
||||||
{
|
{
|
||||||
case 0x200:
|
case 0x200:
|
||||||
MouseEventReceived(MouseEvent.MouseMove);
|
MouseEventReceived(MouseEvent.MouseMove);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x201:
|
case 0x201:
|
||||||
MouseEventReceived(MouseEvent.IconLeftMouseDown);
|
MouseEventReceived(MouseEvent.IconLeftMouseDown);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x202:
|
case 0x202:
|
||||||
if (!isDoubleClick)
|
if (!isDoubleClick)
|
||||||
{
|
{
|
||||||
MouseEventReceived(MouseEvent.IconLeftMouseUp);
|
MouseEventReceived(MouseEvent.IconLeftMouseUp);
|
||||||
}
|
}
|
||||||
isDoubleClick = false;
|
isDoubleClick = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x203:
|
case 0x203:
|
||||||
isDoubleClick = true;
|
isDoubleClick = true;
|
||||||
MouseEventReceived(MouseEvent.IconDoubleClick);
|
MouseEventReceived(MouseEvent.IconDoubleClick);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x204:
|
case 0x204:
|
||||||
MouseEventReceived(MouseEvent.IconRightMouseDown);
|
MouseEventReceived(MouseEvent.IconRightMouseDown);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x205:
|
case 0x205:
|
||||||
MouseEventReceived(MouseEvent.IconRightMouseUp);
|
MouseEventReceived(MouseEvent.IconRightMouseUp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x206:
|
case 0x206:
|
||||||
//double click with right mouse button - do not trigger event
|
//double click with right mouse button - do not trigger event
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x207:
|
case 0x207:
|
||||||
MouseEventReceived(MouseEvent.IconMiddleMouseDown);
|
MouseEventReceived(MouseEvent.IconMiddleMouseDown);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 520:
|
case 520:
|
||||||
MouseEventReceived(MouseEvent.IconMiddleMouseUp);
|
MouseEventReceived(MouseEvent.IconMiddleMouseUp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x209:
|
case 0x209:
|
||||||
//double click with middle mouse button - do not trigger event
|
//double click with middle mouse button - do not trigger event
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x402:
|
case 0x402:
|
||||||
BalloonToolTipChanged(true);
|
BalloonToolTipChanged(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x403:
|
case 0x403:
|
||||||
case 0x404:
|
case 0x404:
|
||||||
BalloonToolTipChanged(false);
|
BalloonToolTipChanged(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x405:
|
case 0x405:
|
||||||
MouseEventReceived(MouseEvent.BalloonToolTipClicked);
|
MouseEventReceived(MouseEvent.BalloonToolTipClicked);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x406:
|
case 0x406:
|
||||||
ChangeToolTipStateRequest(true);
|
ChangeToolTipStateRequest(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x407:
|
case 0x407:
|
||||||
ChangeToolTipStateRequest(false);
|
ChangeToolTipStateRequest(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Debug.WriteLine("Unhandled NotifyIcon message ID: " + lParam);
|
Debug.WriteLine("Unhandled NotifyIcon message ID: " + lParam);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Dispose
|
#region Dispose
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set to true as soon as <c>Dispose</c> has been invoked.
|
/// Set to true as soon as <c>Dispose</c> has been invoked.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsDisposed { get; private set; }
|
public bool IsDisposed { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Disposes the object.
|
/// Disposes the object.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>This method is not virtual by design. Derived classes
|
/// <remarks>This method is not virtual by design. Derived classes
|
||||||
/// should override <see cref="Dispose(bool)"/>.
|
/// should override <see cref="Dispose(bool)"/>.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
Dispose(true);
|
Dispose(true);
|
||||||
|
|
||||||
// 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.SupressFinalize to
|
// Therefore, you should call GC.SupressFinalize 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This destructor will run only if the <see cref="Dispose()"/>
|
/// This destructor will run only if the <see cref="Dispose()"/>
|
||||||
/// method does not get called. This gives this base class the
|
/// method does not get called. This gives this base class the
|
||||||
/// opportunity to finalize.
|
/// opportunity to finalize.
|
||||||
/// <para>
|
/// <para>
|
||||||
/// Important: Do not provide destructors in types derived from
|
/// Important: Do not provide destructors in types derived from
|
||||||
/// this class.
|
/// this class.
|
||||||
/// </para>
|
/// </para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
~WindowMessageSink()
|
~WindowMessageSink()
|
||||||
{
|
{
|
||||||
Dispose(false);
|
Dispose(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes the windows hook that receives window
|
/// Removes the windows hook that receives window
|
||||||
/// messages and closes the underlying helper window.
|
/// messages and closes the underlying helper window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void Dispose(bool disposing)
|
private void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
//don't do anything if the component is already disposed
|
//don't do anything if the component is already disposed
|
||||||
if (IsDisposed) return;
|
if (IsDisposed) return;
|
||||||
IsDisposed = true;
|
IsDisposed = true;
|
||||||
|
|
||||||
//always destroy the unmanaged handle (even if called from the GC)
|
//always destroy the unmanaged handle (even if called from the GC)
|
||||||
WinApi.DestroyWindow(MessageWindowHandle);
|
WinApi.DestroyWindow(MessageWindowHandle);
|
||||||
messageHandler = null;
|
messageHandler = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,83 +1,83 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProductVersion>9.0.30729</ProductVersion>
|
<ProductVersion>9.0.30729</ProductVersion>
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
<ProjectGuid>{7AC63864-7638-41C4-969C-D3197EF2BED9}</ProjectGuid>
|
<ProjectGuid>{7AC63864-7638-41C4-969C-D3197EF2BED9}</ProjectGuid>
|
||||||
<OutputType>library</OutputType>
|
<OutputType>library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>Hardcodet.Wpf.TaskbarNotification</RootNamespace>
|
<RootNamespace>Hardcodet.Wpf.TaskbarNotification</RootNamespace>
|
||||||
<AssemblyName>Hardcodet.Wpf.TaskbarNotification</AssemblyName>
|
<AssemblyName>Hardcodet.Wpf.TaskbarNotification</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<DocumentationFile>bin\Release\Hardcodet.Wpf.TaskbarNotification.xml</DocumentationFile>
|
<DocumentationFile>bin\Release\Hardcodet.Wpf.TaskbarNotification.xml</DocumentationFile>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Xaml" />
|
<Reference Include="System.Xaml" />
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="BalloonIcon.cs" />
|
<Compile Include="BalloonIcon.cs" />
|
||||||
<Compile Include="Interop\TrayInfo.cs">
|
<Compile Include="Interop\TrayInfo.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Interop\Point.cs" />
|
<Compile Include="Interop\Point.cs" />
|
||||||
<Compile Include="Interop\WindowClass.cs" />
|
<Compile Include="Interop\WindowClass.cs" />
|
||||||
<Compile Include="PopupActivationMode.cs" />
|
<Compile Include="PopupActivationMode.cs" />
|
||||||
<Compile Include="RoutedEventHelper.cs" />
|
<Compile Include="RoutedEventHelper.cs" />
|
||||||
<Compile Include="Interop\WinApi.cs" />
|
<Compile Include="Interop\WinApi.cs" />
|
||||||
<Compile Include="Interop\MouseEvent.cs" />
|
<Compile Include="Interop\MouseEvent.cs" />
|
||||||
<Compile Include="Interop\NotifyCommand.cs" />
|
<Compile Include="Interop\NotifyCommand.cs" />
|
||||||
<Compile Include="Interop\NotifyIconData.cs" />
|
<Compile Include="Interop\NotifyIconData.cs" />
|
||||||
<Compile Include="Interop\IconDataMembers.cs" />
|
<Compile Include="Interop\IconDataMembers.cs" />
|
||||||
<Compile Include="Interop\IconState.cs" />
|
<Compile Include="Interop\IconState.cs" />
|
||||||
<Compile Include="Interop\NotifyIconVersion.cs" />
|
<Compile Include="Interop\NotifyIconVersion.cs" />
|
||||||
<Compile Include="Interop\BalloonFlags.cs" />
|
<Compile Include="Interop\BalloonFlags.cs" />
|
||||||
<Compile Include="Interop\WindowMessageSink.cs" />
|
<Compile Include="Interop\WindowMessageSink.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="TaskbarIcon.cs" />
|
<Compile Include="TaskbarIcon.cs" />
|
||||||
<Compile Include="TaskbarIcon.Declarations.cs" />
|
<Compile Include="TaskbarIcon.Declarations.cs" />
|
||||||
<Compile Include="Util.cs" />
|
<Compile Include="Util.cs" />
|
||||||
<None Include="Diagrams\TaskbarIcon Overview.cd" />
|
<None Include="Diagrams\TaskbarIcon Overview.cd" />
|
||||||
<AppDesigner Include="Properties\" />
|
<AppDesigner Include="Properties\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
<Target Name="BeforeBuild">
|
<Target Name="BeforeBuild">
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="AfterBuild">
|
<Target Name="AfterBuild">
|
||||||
</Target>
|
</Target>
|
||||||
-->
|
-->
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,75 +1,75 @@
|
|||||||
// hardcodet.net NotifyIcon for WPF
|
// hardcodet.net NotifyIcon for WPF
|
||||||
// Copyright (c) 2009 - 2013 Philipp Sumi
|
// Copyright (c) 2009 - 2013 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
|
||||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
// OTHER DEALINGS IN THE SOFTWARE.
|
// OTHER DEALINGS IN THE SOFTWARE.
|
||||||
//
|
//
|
||||||
// THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE
|
// THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE
|
||||||
|
|
||||||
|
|
||||||
namespace Hardcodet.Wpf.TaskbarNotification
|
namespace Hardcodet.Wpf.TaskbarNotification
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines flags that define when a popup
|
/// Defines flags that define when a popup
|
||||||
/// is being displyed.
|
/// is being displyed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum PopupActivationMode
|
public enum PopupActivationMode
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The item is displayed if the user clicks the
|
/// The item is displayed if the user clicks the
|
||||||
/// tray icon with the left mouse button.
|
/// tray icon with the left mouse button.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
LeftClick,
|
LeftClick,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The item is displayed if the user clicks the
|
/// The item is displayed if the user clicks the
|
||||||
/// tray icon with the right mouse button.
|
/// tray icon with the right mouse button.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
RightClick,
|
RightClick,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The item is displayed if the user double-clicks the
|
/// The item is displayed if the user double-clicks the
|
||||||
/// tray icon.
|
/// tray icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
DoubleClick,
|
DoubleClick,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The item is displayed if the user clicks the
|
/// The item is displayed if the user clicks the
|
||||||
/// tray icon with the left or the right mouse button.
|
/// tray icon with the left or the right mouse button.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
LeftOrRightClick,
|
LeftOrRightClick,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The item is displayed if the user clicks the
|
/// The item is displayed if the user clicks the
|
||||||
/// tray icon with the left mouse button or if a
|
/// tray icon with the left mouse button or if a
|
||||||
/// double-click is being performed.
|
/// double-click is being performed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
LeftOrDoubleClick,
|
LeftOrDoubleClick,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The item is displayed if the user clicks the
|
/// The item is displayed if the user clicks the
|
||||||
/// tray icon with the middle mouse button.
|
/// tray icon with the middle mouse button.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
MiddleClick,
|
MiddleClick,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The item is displayed whenever a click occurs.
|
/// The item is displayed whenever a click occurs.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
All
|
All
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,64 +1,64 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Markup;
|
using System.Windows.Markup;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
|
|
||||||
[assembly: AssemblyTitle("NotifyIcon for WPF")]
|
[assembly: AssemblyTitle("NotifyIcon for WPF")]
|
||||||
[assembly: AssemblyDescription("NotifyIcon implementation for the WPF platform.")]
|
[assembly: AssemblyDescription("NotifyIcon implementation for the WPF platform.")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("hardcodet.net")]
|
[assembly: AssemblyCompany("hardcodet.net")]
|
||||||
[assembly: AssemblyProduct("NotifyIcon WPF")]
|
[assembly: AssemblyProduct("NotifyIcon WPF")]
|
||||||
[assembly: AssemblyCopyright("Copyright © Philipp Sumi 2013")]
|
[assembly: AssemblyCopyright("Copyright © Philipp Sumi 2013")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
|
||||||
[assembly: AssemblyVersion("1.0.5.0")]
|
[assembly: AssemblyVersion("1.0.5.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.5.0")]
|
[assembly: AssemblyFileVersion("1.0.5.0")]
|
||||||
|
|
||||||
|
|
||||||
//provides simplified declaration in XAML
|
//provides simplified declaration in XAML
|
||||||
[assembly: XmlnsPrefix("http://www.hardcodet.net/taskbar", "tb")]
|
[assembly: XmlnsPrefix("http://www.hardcodet.net/taskbar", "tb")]
|
||||||
[assembly: XmlnsDefinition("http://www.hardcodet.net/taskbar", "Hardcodet.Wpf.TaskbarNotification")]
|
[assembly: XmlnsDefinition("http://www.hardcodet.net/taskbar", "Hardcodet.Wpf.TaskbarNotification")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
// to COM components. If you need to access a type in this assembly from
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
//In order to begin building localizable applications, set
|
//In order to begin building localizable applications, set
|
||||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||||
//inside a <PropertyGroup>. For example, if you are using US english
|
//inside a <PropertyGroup>. For example, if you are using US english
|
||||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||||
//the line below to match the UICulture setting in the project file.
|
//the line below to match the UICulture setting in the project file.
|
||||||
|
|
||||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||||
|
|
||||||
[assembly: ThemeInfo(
|
[assembly: ThemeInfo(
|
||||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||||
//(used if a resource is not found in the page,
|
//(used if a resource is not found in the page,
|
||||||
// or application resource dictionaries)
|
// or application resource dictionaries)
|
||||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||||
//(used if a resource is not found in the page,
|
//(used if a resource is not found in the page,
|
||||||
// app, or any theme specific resource dictionaries)
|
// app, or any theme specific resource dictionaries)
|
||||||
)]
|
)]
|
||||||
|
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
|
||||||
|
|||||||
@@ -1,81 +1,81 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Hardcodet.Wpf.TaskbarNotification
|
namespace Hardcodet.Wpf.TaskbarNotification
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper class used by routed events of the
|
/// Helper class used by routed events of the
|
||||||
/// <see cref="TaskbarIcon"/> class.
|
/// <see cref="TaskbarIcon"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static class RoutedEventHelper
|
internal static class RoutedEventHelper
|
||||||
{
|
{
|
||||||
#region RoutedEvent Helper Methods
|
#region RoutedEvent Helper Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A static helper method to raise a routed event on a target UIElement or ContentElement.
|
/// A static helper method to raise a routed event on a target UIElement or ContentElement.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="target">UIElement or ContentElement on which to raise the event</param>
|
/// <param name="target">UIElement or ContentElement on which to raise the event</param>
|
||||||
/// <param name="args">RoutedEventArgs to use when raising the event</param>
|
/// <param name="args">RoutedEventArgs to use when raising the event</param>
|
||||||
internal static void RaiseEvent(DependencyObject target, RoutedEventArgs args)
|
internal static void RaiseEvent(DependencyObject target, RoutedEventArgs args)
|
||||||
{
|
{
|
||||||
if (target is UIElement)
|
if (target is UIElement)
|
||||||
{
|
{
|
||||||
(target as UIElement).RaiseEvent(args);
|
(target as UIElement).RaiseEvent(args);
|
||||||
}
|
}
|
||||||
else if (target is ContentElement)
|
else if (target is ContentElement)
|
||||||
{
|
{
|
||||||
(target as ContentElement).RaiseEvent(args);
|
(target as ContentElement).RaiseEvent(args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A static helper method that adds a handler for a routed event
|
/// A static helper method that adds a handler for a routed event
|
||||||
/// to a target UIElement or ContentElement.
|
/// to a target UIElement or ContentElement.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="element">UIElement or ContentElement that listens to the event</param>
|
/// <param name="element">UIElement or ContentElement that listens to the event</param>
|
||||||
/// <param name="routedEvent">Event that will be handled</param>
|
/// <param name="routedEvent">Event that will be handled</param>
|
||||||
/// <param name="handler">Event handler to be added</param>
|
/// <param name="handler">Event handler to be added</param>
|
||||||
internal static void AddHandler(DependencyObject element, RoutedEvent routedEvent, Delegate handler)
|
internal static void AddHandler(DependencyObject element, RoutedEvent routedEvent, Delegate handler)
|
||||||
{
|
{
|
||||||
UIElement uie = element as UIElement;
|
UIElement uie = element as UIElement;
|
||||||
if (uie != null)
|
if (uie != null)
|
||||||
{
|
{
|
||||||
uie.AddHandler(routedEvent, handler);
|
uie.AddHandler(routedEvent, handler);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ContentElement ce = element as ContentElement;
|
ContentElement ce = element as ContentElement;
|
||||||
if (ce != null)
|
if (ce != null)
|
||||||
{
|
{
|
||||||
ce.AddHandler(routedEvent, handler);
|
ce.AddHandler(routedEvent, handler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A static helper method that removes a handler for a routed event
|
/// A static helper method that removes a handler for a routed event
|
||||||
/// from a target UIElement or ContentElement.
|
/// from a target UIElement or ContentElement.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="element">UIElement or ContentElement that listens to the event</param>
|
/// <param name="element">UIElement or ContentElement that listens to the event</param>
|
||||||
/// <param name="routedEvent">Event that will no longer be handled</param>
|
/// <param name="routedEvent">Event that will no longer be handled</param>
|
||||||
/// <param name="handler">Event handler to be removed</param>
|
/// <param name="handler">Event handler to be removed</param>
|
||||||
internal static void RemoveHandler(DependencyObject element, RoutedEvent routedEvent, Delegate handler)
|
internal static void RemoveHandler(DependencyObject element, RoutedEvent routedEvent, Delegate handler)
|
||||||
{
|
{
|
||||||
UIElement uie = element as UIElement;
|
UIElement uie = element as UIElement;
|
||||||
if (uie != null)
|
if (uie != null)
|
||||||
{
|
{
|
||||||
uie.RemoveHandler(routedEvent, handler);
|
uie.RemoveHandler(routedEvent, handler);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ContentElement ce = element as ContentElement;
|
ContentElement ce = element as ContentElement;
|
||||||
if (ce != null)
|
if (ce != null)
|
||||||
{
|
{
|
||||||
ce.RemoveHandler(routedEvent, handler);
|
ce.RemoveHandler(routedEvent, handler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,309 +1,309 @@
|
|||||||
// hardcodet.net NotifyIcon for WPF
|
// hardcodet.net NotifyIcon for WPF
|
||||||
// Copyright (c) 2009 - 2013 Philipp Sumi
|
// Copyright (c) 2009 - 2013 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
|
||||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
// OTHER DEALINGS IN THE SOFTWARE.
|
// OTHER DEALINGS IN THE SOFTWARE.
|
||||||
//
|
//
|
||||||
// THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE
|
// THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE
|
||||||
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Resources;
|
using System.Windows.Resources;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using Hardcodet.Wpf.TaskbarNotification.Interop;
|
using Hardcodet.Wpf.TaskbarNotification.Interop;
|
||||||
|
|
||||||
namespace Hardcodet.Wpf.TaskbarNotification
|
namespace Hardcodet.Wpf.TaskbarNotification
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Util and extension methods.
|
/// Util and extension methods.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static class Util
|
internal static class Util
|
||||||
{
|
{
|
||||||
public static readonly object SyncRoot = new object();
|
public static readonly object SyncRoot = new object();
|
||||||
|
|
||||||
#region IsDesignMode
|
#region IsDesignMode
|
||||||
|
|
||||||
private static readonly bool isDesignMode;
|
private static readonly bool isDesignMode;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks whether the application is currently in design mode.
|
/// Checks whether the application is currently in design mode.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsDesignMode
|
public static bool IsDesignMode
|
||||||
{
|
{
|
||||||
get { return isDesignMode; }
|
get { return isDesignMode; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region construction
|
#region construction
|
||||||
|
|
||||||
static Util()
|
static Util()
|
||||||
{
|
{
|
||||||
isDesignMode =
|
isDesignMode =
|
||||||
(bool)
|
(bool)
|
||||||
DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty,
|
DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty,
|
||||||
typeof (FrameworkElement))
|
typeof (FrameworkElement))
|
||||||
.Metadata.DefaultValue;
|
.Metadata.DefaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region CreateHelperWindow
|
#region CreateHelperWindow
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an transparent window without dimension that
|
/// Creates an transparent window without dimension that
|
||||||
/// can be used to temporarily obtain focus and/or
|
/// can be used to temporarily obtain focus and/or
|
||||||
/// be used as a window message sink.
|
/// be used as a window message sink.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Empty window.</returns>
|
/// <returns>Empty window.</returns>
|
||||||
public static Window CreateHelperWindow()
|
public static Window CreateHelperWindow()
|
||||||
{
|
{
|
||||||
return new Window
|
return new Window
|
||||||
{
|
{
|
||||||
Width = 0,
|
Width = 0,
|
||||||
Height = 0,
|
Height = 0,
|
||||||
ShowInTaskbar = false,
|
ShowInTaskbar = false,
|
||||||
WindowStyle = WindowStyle.None,
|
WindowStyle = WindowStyle.None,
|
||||||
AllowsTransparency = true,
|
AllowsTransparency = true,
|
||||||
Opacity = 0
|
Opacity = 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region WriteIconData
|
#region WriteIconData
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the taskbar icons with data provided by a given
|
/// Updates the taskbar icons with data provided by a given
|
||||||
/// <see cref="NotifyIconData"/> instance.
|
/// <see cref="NotifyIconData"/> instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="data">Configuration settings for the NotifyIcon.</param>
|
/// <param name="data">Configuration settings for the NotifyIcon.</param>
|
||||||
/// <param name="command">Operation on the icon (e.g. delete the icon).</param>
|
/// <param name="command">Operation on the icon (e.g. delete the icon).</param>
|
||||||
/// <returns>True if the data was successfully written.</returns>
|
/// <returns>True if the data was successfully written.</returns>
|
||||||
/// <remarks>See Shell_NotifyIcon documentation on MSDN for details.</remarks>
|
/// <remarks>See Shell_NotifyIcon documentation on MSDN for details.</remarks>
|
||||||
public static bool WriteIconData(ref NotifyIconData data, NotifyCommand command)
|
public static bool WriteIconData(ref NotifyIconData data, NotifyCommand command)
|
||||||
{
|
{
|
||||||
return WriteIconData(ref data, command, data.ValidMembers);
|
return WriteIconData(ref data, command, data.ValidMembers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the taskbar icons with data provided by a given
|
/// Updates the taskbar icons with data provided by a given
|
||||||
/// <see cref="NotifyIconData"/> instance.
|
/// <see cref="NotifyIconData"/> instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="data">Configuration settings for the NotifyIcon.</param>
|
/// <param name="data">Configuration settings for the NotifyIcon.</param>
|
||||||
/// <param name="command">Operation on the icon (e.g. delete the icon).</param>
|
/// <param name="command">Operation on the icon (e.g. delete the icon).</param>
|
||||||
/// <param name="flags">Defines which members of the <paramref name="data"/>
|
/// <param name="flags">Defines which members of the <paramref name="data"/>
|
||||||
/// structure are set.</param>
|
/// structure are set.</param>
|
||||||
/// <returns>True if the data was successfully written.</returns>
|
/// <returns>True if the data was successfully written.</returns>
|
||||||
/// <remarks>See Shell_NotifyIcon documentation on MSDN for details.</remarks>
|
/// <remarks>See Shell_NotifyIcon documentation on MSDN for details.</remarks>
|
||||||
public static bool WriteIconData(ref NotifyIconData data, NotifyCommand command, IconDataMembers flags)
|
public static bool WriteIconData(ref NotifyIconData data, NotifyCommand command, IconDataMembers flags)
|
||||||
{
|
{
|
||||||
//do nothing if in design mode
|
//do nothing if in design mode
|
||||||
if (IsDesignMode) return true;
|
if (IsDesignMode) return true;
|
||||||
|
|
||||||
data.ValidMembers = flags;
|
data.ValidMembers = flags;
|
||||||
lock (SyncRoot)
|
lock (SyncRoot)
|
||||||
{
|
{
|
||||||
return WinApi.Shell_NotifyIcon(command, ref data);
|
return WinApi.Shell_NotifyIcon(command, ref data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region GetBalloonFlag
|
#region GetBalloonFlag
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a <see cref="BalloonFlags"/> enum value that
|
/// Gets a <see cref="BalloonFlags"/> enum value that
|
||||||
/// matches a given <see cref="BalloonIcon"/>.
|
/// matches a given <see cref="BalloonIcon"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static BalloonFlags GetBalloonFlag(this BalloonIcon icon)
|
public static BalloonFlags GetBalloonFlag(this BalloonIcon icon)
|
||||||
{
|
{
|
||||||
switch (icon)
|
switch (icon)
|
||||||
{
|
{
|
||||||
case BalloonIcon.None:
|
case BalloonIcon.None:
|
||||||
return BalloonFlags.None;
|
return BalloonFlags.None;
|
||||||
case BalloonIcon.Info:
|
case BalloonIcon.Info:
|
||||||
return BalloonFlags.Info;
|
return BalloonFlags.Info;
|
||||||
case BalloonIcon.Warning:
|
case BalloonIcon.Warning:
|
||||||
return BalloonFlags.Warning;
|
return BalloonFlags.Warning;
|
||||||
case BalloonIcon.Error:
|
case BalloonIcon.Error:
|
||||||
return BalloonFlags.Error;
|
return BalloonFlags.Error;
|
||||||
default:
|
default:
|
||||||
throw new ArgumentOutOfRangeException("icon");
|
throw new ArgumentOutOfRangeException("icon");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ImageSource to Icon
|
#region ImageSource to Icon
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reads a given image resource into a WinForms icon.
|
/// Reads a given image resource into a WinForms icon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="imageSource">Image source pointing to
|
/// <param name="imageSource">Image source pointing to
|
||||||
/// an icon file (*.ico).</param>
|
/// an icon file (*.ico).</param>
|
||||||
/// <returns>An icon object that can be used with the
|
/// <returns>An icon object that can be used with the
|
||||||
/// taskbar area.</returns>
|
/// taskbar area.</returns>
|
||||||
public static Icon ToIcon(this ImageSource imageSource)
|
public static Icon ToIcon(this ImageSource imageSource)
|
||||||
{
|
{
|
||||||
if (imageSource == null) return null;
|
if (imageSource == null) return null;
|
||||||
|
|
||||||
Uri uri = new Uri(imageSource.ToString());
|
Uri uri = new Uri(imageSource.ToString());
|
||||||
StreamResourceInfo streamInfo = Application.GetResourceStream(uri);
|
StreamResourceInfo streamInfo = Application.GetResourceStream(uri);
|
||||||
|
|
||||||
if (streamInfo == null)
|
if (streamInfo == null)
|
||||||
{
|
{
|
||||||
string msg = "The supplied image source '{0}' could not be resolved.";
|
string msg = "The supplied image source '{0}' could not be resolved.";
|
||||||
msg = String.Format(msg, imageSource);
|
msg = String.Format(msg, imageSource);
|
||||||
throw new ArgumentException(msg);
|
throw new ArgumentException(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Icon(streamInfo.Stream);
|
return new Icon(streamInfo.Stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region evaluate listings
|
#region evaluate listings
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks a list of candidates for equality to a given
|
/// Checks a list of candidates for equality to a given
|
||||||
/// reference value.
|
/// reference value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T"></typeparam>
|
/// <typeparam name="T"></typeparam>
|
||||||
/// <param name="value">The evaluated value.</param>
|
/// <param name="value">The evaluated value.</param>
|
||||||
/// <param name="candidates">A liste of possible values that are
|
/// <param name="candidates">A liste of possible values that are
|
||||||
/// regarded valid.</param>
|
/// regarded valid.</param>
|
||||||
/// <returns>True if one of the submitted <paramref name="candidates"/>
|
/// <returns>True if one of the submitted <paramref name="candidates"/>
|
||||||
/// matches the evaluated value. If the <paramref name="candidates"/>
|
/// matches the evaluated value. If the <paramref name="candidates"/>
|
||||||
/// parameter itself is null, too, the method returns false as well,
|
/// parameter itself is null, too, the method returns false as well,
|
||||||
/// which allows to check with null values, too.</returns>
|
/// which allows to check with null values, too.</returns>
|
||||||
/// <exception cref="ArgumentNullException">If <paramref name="candidates"/>
|
/// <exception cref="ArgumentNullException">If <paramref name="candidates"/>
|
||||||
/// is a null reference.</exception>
|
/// is a null reference.</exception>
|
||||||
public static bool Is<T>(this T value, params T[] candidates)
|
public static bool Is<T>(this T value, params T[] candidates)
|
||||||
{
|
{
|
||||||
if (candidates == null) return false;
|
if (candidates == null) return false;
|
||||||
|
|
||||||
foreach (var t in candidates)
|
foreach (var t in candidates)
|
||||||
{
|
{
|
||||||
if (value.Equals(t)) return true;
|
if (value.Equals(t)) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region match MouseEvent to PopupActivation
|
#region match MouseEvent to PopupActivation
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if a given <see cref="PopupActivationMode"/> is a match for
|
/// Checks if a given <see cref="PopupActivationMode"/> is a match for
|
||||||
/// an effectively pressed mouse button.
|
/// an effectively pressed mouse button.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsMatch(this MouseEvent me, PopupActivationMode activationMode)
|
public static bool IsMatch(this MouseEvent me, PopupActivationMode activationMode)
|
||||||
{
|
{
|
||||||
switch (activationMode)
|
switch (activationMode)
|
||||||
{
|
{
|
||||||
case PopupActivationMode.LeftClick:
|
case PopupActivationMode.LeftClick:
|
||||||
return me == MouseEvent.IconLeftMouseUp;
|
return me == MouseEvent.IconLeftMouseUp;
|
||||||
case PopupActivationMode.RightClick:
|
case PopupActivationMode.RightClick:
|
||||||
return me == MouseEvent.IconRightMouseUp;
|
return me == MouseEvent.IconRightMouseUp;
|
||||||
case PopupActivationMode.LeftOrRightClick:
|
case PopupActivationMode.LeftOrRightClick:
|
||||||
return me.Is(MouseEvent.IconLeftMouseUp, MouseEvent.IconRightMouseUp);
|
return me.Is(MouseEvent.IconLeftMouseUp, MouseEvent.IconRightMouseUp);
|
||||||
case PopupActivationMode.LeftOrDoubleClick:
|
case PopupActivationMode.LeftOrDoubleClick:
|
||||||
return me.Is(MouseEvent.IconLeftMouseUp, MouseEvent.IconDoubleClick);
|
return me.Is(MouseEvent.IconLeftMouseUp, MouseEvent.IconDoubleClick);
|
||||||
case PopupActivationMode.DoubleClick:
|
case PopupActivationMode.DoubleClick:
|
||||||
return me.Is(MouseEvent.IconDoubleClick);
|
return me.Is(MouseEvent.IconDoubleClick);
|
||||||
case PopupActivationMode.MiddleClick:
|
case PopupActivationMode.MiddleClick:
|
||||||
return me == MouseEvent.IconMiddleMouseUp;
|
return me == MouseEvent.IconMiddleMouseUp;
|
||||||
case PopupActivationMode.All:
|
case PopupActivationMode.All:
|
||||||
//return true for everything except mouse movements
|
//return true for everything except mouse movements
|
||||||
return me != MouseEvent.MouseMove;
|
return me != MouseEvent.MouseMove;
|
||||||
default:
|
default:
|
||||||
throw new ArgumentOutOfRangeException("activationMode");
|
throw new ArgumentOutOfRangeException("activationMode");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region execute command
|
#region execute command
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Executes a given command if its <see cref="ICommand.CanExecute"/> method
|
/// Executes a given command if its <see cref="ICommand.CanExecute"/> method
|
||||||
/// indicates it can run.
|
/// indicates it can run.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="command">The command to be executed, or a null reference.</param>
|
/// <param name="command">The command to be executed, or a null reference.</param>
|
||||||
/// <param name="commandParameter">An optional parameter that is associated with
|
/// <param name="commandParameter">An optional parameter that is associated with
|
||||||
/// the command.</param>
|
/// the command.</param>
|
||||||
/// <param name="target">The target element on which to raise the command.</param>
|
/// <param name="target">The target element on which to raise the command.</param>
|
||||||
public static void ExecuteIfEnabled(this ICommand command, object commandParameter, IInputElement target)
|
public static void ExecuteIfEnabled(this ICommand command, object commandParameter, IInputElement target)
|
||||||
{
|
{
|
||||||
if (command == null) return;
|
if (command == null) return;
|
||||||
|
|
||||||
RoutedCommand rc = command as RoutedCommand;
|
RoutedCommand rc = command as RoutedCommand;
|
||||||
if (rc != null)
|
if (rc != null)
|
||||||
{
|
{
|
||||||
//routed commands work on a target
|
//routed commands work on a target
|
||||||
if (rc.CanExecute(commandParameter, target)) rc.Execute(commandParameter, target);
|
if (rc.CanExecute(commandParameter, target)) rc.Execute(commandParameter, target);
|
||||||
}
|
}
|
||||||
else if (command.CanExecute(commandParameter))
|
else if (command.CanExecute(commandParameter))
|
||||||
{
|
{
|
||||||
command.Execute(commandParameter);
|
command.Execute(commandParameter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a dispatcher for multi-threaded scenarios
|
/// Returns a dispatcher for multi-threaded scenarios
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
internal static Dispatcher GetDispatcher(this DispatcherObject source)
|
internal static Dispatcher GetDispatcher(this DispatcherObject source)
|
||||||
{
|
{
|
||||||
//use the application's dispatcher by default
|
//use the application's dispatcher by default
|
||||||
if (Application.Current != null) return Application.Current.Dispatcher;
|
if (Application.Current != null) return Application.Current.Dispatcher;
|
||||||
|
|
||||||
//fallback for WinForms environments
|
//fallback for WinForms environments
|
||||||
if (source.Dispatcher != null) return source.Dispatcher;
|
if (source.Dispatcher != null) return source.Dispatcher;
|
||||||
|
|
||||||
//ultimatively use the thread's dispatcher
|
//ultimatively use the thread's dispatcher
|
||||||
return Dispatcher.CurrentDispatcher;
|
return Dispatcher.CurrentDispatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks whether the <see cref="FrameworkElement.DataContextProperty"/>
|
/// Checks whether the <see cref="FrameworkElement.DataContextProperty"/>
|
||||||
/// is bound or not.
|
/// is bound or not.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="element">The element to be checked.</param>
|
/// <param name="element">The element to be checked.</param>
|
||||||
/// <returns>True if the data context property is being managed by a
|
/// <returns>True if the data context property is being managed by a
|
||||||
/// binding expression.</returns>
|
/// binding expression.</returns>
|
||||||
/// <exception cref="ArgumentNullException">If <paramref name="element"/>
|
/// <exception cref="ArgumentNullException">If <paramref name="element"/>
|
||||||
/// is a null reference.</exception>
|
/// is a null reference.</exception>
|
||||||
public static bool IsDataContextDataBound(this FrameworkElement element)
|
public static bool IsDataContextDataBound(this FrameworkElement element)
|
||||||
{
|
{
|
||||||
if (element == null) throw new ArgumentNullException("element");
|
if (element == null) throw new ArgumentNullException("element");
|
||||||
return element.GetBindingExpression(FrameworkElement.DataContextProperty) != null;
|
return element.GetBindingExpression(FrameworkElement.DataContextProperty) != null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
<Application x:Class="Samples.App"
|
<Application x:Class="Samples.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">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
|
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="Showcase/NotifyIconResources.xaml" />
|
<ResourceDictionary Source="Showcase/NotifyIconResources.xaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
</Application>
|
</Application>
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using Hardcodet.Wpf.TaskbarNotification;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
|
|
||||||
namespace Samples
|
namespace Samples
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for App.xaml
|
/// Interaction logic for App.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,24 +1,24 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Samples.Commands
|
namespace Samples.Commands
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Closes the current window.
|
/// Closes the current window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CloseWindowCommand : CommandBase<CloseWindowCommand>
|
public class CloseWindowCommand : CommandBase<CloseWindowCommand>
|
||||||
{
|
{
|
||||||
public override void Execute(object parameter)
|
public override void Execute(object parameter)
|
||||||
{
|
{
|
||||||
GetTaskbarWindow(parameter).Close();
|
GetTaskbarWindow(parameter).Close();
|
||||||
CommandManager.InvalidateRequerySuggested();
|
CommandManager.InvalidateRequerySuggested();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override bool CanExecute(object parameter)
|
public override bool CanExecute(object parameter)
|
||||||
{
|
{
|
||||||
Window win = GetTaskbarWindow(parameter);
|
Window win = GetTaskbarWindow(parameter);
|
||||||
return win != null;
|
return win != null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,157 +1,157 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Markup;
|
using System.Windows.Markup;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using Hardcodet.Wpf.TaskbarNotification;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
|
|
||||||
namespace Samples.Commands
|
namespace Samples.Commands
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Basic implementation of the <see cref="ICommand"/>
|
/// Basic implementation of the <see cref="ICommand"/>
|
||||||
/// interface, which is also accessible as a markup
|
/// interface, which is also accessible as a markup
|
||||||
/// extension.
|
/// extension.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class CommandBase<T> : MarkupExtension, ICommand
|
public abstract class CommandBase<T> : MarkupExtension, ICommand
|
||||||
where T : class, ICommand, new()
|
where T : class, ICommand, new()
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A singleton instance.
|
/// A singleton instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static T command;
|
private static T command;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a shared command instance.
|
/// Gets a shared command instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||||
{
|
{
|
||||||
if (command == null) command = new T();
|
if (command == null) command = new T();
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fires when changes occur that affect whether
|
/// Fires when changes occur that affect whether
|
||||||
/// or not the command should execute.
|
/// or not the command should execute.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event EventHandler CanExecuteChanged
|
public event EventHandler CanExecuteChanged
|
||||||
{
|
{
|
||||||
add { CommandManager.RequerySuggested += value; }
|
add { CommandManager.RequerySuggested += value; }
|
||||||
remove { CommandManager.RequerySuggested -= value; }
|
remove { CommandManager.RequerySuggested -= value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines the method to be called when the command is invoked.
|
/// Defines the method to be called when the command is invoked.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="parameter">Data used by the command.
|
/// <param name="parameter">Data used by the command.
|
||||||
/// If the command does not require data to be passed,
|
/// If the command does not require data to be passed,
|
||||||
/// this object can be set to null.
|
/// this object can be set to null.
|
||||||
/// </param>
|
/// </param>
|
||||||
public abstract void Execute(object parameter);
|
public abstract void Execute(object parameter);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines the method that determines whether the command
|
/// Defines the method that determines whether the command
|
||||||
/// can execute in its current state.
|
/// can execute in its current state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// This default implementation always returns true.
|
/// This default implementation always returns true.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
/// <param name="parameter">Data used by the command.
|
/// <param name="parameter">Data used by the command.
|
||||||
/// If the command does not require data to be passed,
|
/// If the command does not require data to be passed,
|
||||||
/// this object can be set to null.
|
/// this object can be set to null.
|
||||||
/// </param>
|
/// </param>
|
||||||
public virtual bool CanExecute(object parameter)
|
public virtual bool CanExecute(object parameter)
|
||||||
{
|
{
|
||||||
return IsDesignMode ? false : true;
|
return IsDesignMode ? false : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static bool IsDesignMode
|
public static bool IsDesignMode
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (bool)
|
return (bool)
|
||||||
DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty,
|
DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty,
|
||||||
typeof (FrameworkElement))
|
typeof (FrameworkElement))
|
||||||
.Metadata.DefaultValue;
|
.Metadata.DefaultValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resolves the window that owns the TaskbarIcon class.
|
/// Resolves the window that owns the TaskbarIcon class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="commandParameter"></param>
|
/// <param name="commandParameter"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected Window GetTaskbarWindow(object commandParameter)
|
protected Window GetTaskbarWindow(object commandParameter)
|
||||||
{
|
{
|
||||||
if (IsDesignMode) return null;
|
if (IsDesignMode) return null;
|
||||||
|
|
||||||
//get the showcase window off the taskbaricon
|
//get the showcase window off the taskbaricon
|
||||||
var tb = commandParameter as TaskbarIcon;
|
var tb = commandParameter as TaskbarIcon;
|
||||||
return tb == null ? null : TryFindParent<Window>(tb);
|
return tb == null ? null : TryFindParent<Window>(tb);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region TryFindParent helper
|
#region TryFindParent helper
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finds a parent of a given item on the visual tree.
|
/// Finds a parent of a given item on the visual tree.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T">The type of the queried item.</typeparam>
|
/// <typeparam name="T">The type of the queried item.</typeparam>
|
||||||
/// <param name="child">A direct or indirect child of the
|
/// <param name="child">A direct or indirect child of the
|
||||||
/// queried item.</param>
|
/// queried item.</param>
|
||||||
/// <returns>The first parent item that matches the submitted
|
/// <returns>The first parent item that matches the submitted
|
||||||
/// type parameter. If not matching item can be found, a null
|
/// type parameter. If not matching item can be found, a null
|
||||||
/// reference is being returned.</returns>
|
/// reference is being returned.</returns>
|
||||||
public static T TryFindParent<T>(DependencyObject child)
|
public static T TryFindParent<T>(DependencyObject child)
|
||||||
where T : DependencyObject
|
where T : DependencyObject
|
||||||
{
|
{
|
||||||
//get parent item
|
//get parent item
|
||||||
DependencyObject parentObject = GetParentObject(child);
|
DependencyObject parentObject = GetParentObject(child);
|
||||||
|
|
||||||
//we've reached the end of the tree
|
//we've reached the end of the tree
|
||||||
if (parentObject == null) return null;
|
if (parentObject == null) return null;
|
||||||
|
|
||||||
//check if the parent matches the type we're looking for
|
//check if the parent matches the type we're looking for
|
||||||
T parent = parentObject as T;
|
T parent = parentObject as T;
|
||||||
if (parent != null)
|
if (parent != null)
|
||||||
{
|
{
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//use recursion to proceed with next level
|
//use recursion to proceed with next level
|
||||||
return TryFindParent<T>(parentObject);
|
return TryFindParent<T>(parentObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This method is an alternative to WPF's
|
/// This method is an alternative to WPF's
|
||||||
/// <see cref="VisualTreeHelper.GetParent"/> method, which also
|
/// <see cref="VisualTreeHelper.GetParent"/> method, which also
|
||||||
/// supports content elements. Keep in mind that for content element,
|
/// supports content elements. Keep in mind that for content element,
|
||||||
/// this method falls back to the logical tree of the element!
|
/// this method falls back to the logical tree of the element!
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="child">The item to be processed.</param>
|
/// <param name="child">The item to be processed.</param>
|
||||||
/// <returns>The submitted item's parent, if available. Otherwise
|
/// <returns>The submitted item's parent, if available. Otherwise
|
||||||
/// null.</returns>
|
/// null.</returns>
|
||||||
public static DependencyObject GetParentObject(DependencyObject child)
|
public static DependencyObject GetParentObject(DependencyObject child)
|
||||||
{
|
{
|
||||||
if (child == null) return null;
|
if (child == null) return null;
|
||||||
ContentElement contentElement = child as ContentElement;
|
ContentElement contentElement = child as ContentElement;
|
||||||
|
|
||||||
if (contentElement != null)
|
if (contentElement != null)
|
||||||
{
|
{
|
||||||
DependencyObject parent = ContentOperations.GetParent(contentElement);
|
DependencyObject parent = ContentOperations.GetParent(contentElement);
|
||||||
if (parent != null) return parent;
|
if (parent != null) return parent;
|
||||||
|
|
||||||
FrameworkContentElement fce = contentElement as FrameworkContentElement;
|
FrameworkContentElement fce = contentElement as FrameworkContentElement;
|
||||||
return fce != null ? fce.Parent : null;
|
return fce != null ? fce.Parent : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if it's not a ContentElement, rely on VisualTreeHelper
|
//if it's not a ContentElement, rely on VisualTreeHelper
|
||||||
return VisualTreeHelper.GetParent(child);
|
return VisualTreeHelper.GetParent(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,24 +1,24 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Samples.Commands
|
namespace Samples.Commands
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Hides the main window.
|
/// Hides the main window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class HideSampleWindowCommand : CommandBase<HideSampleWindowCommand>
|
public class HideSampleWindowCommand : CommandBase<HideSampleWindowCommand>
|
||||||
{
|
{
|
||||||
public override void Execute(object parameter)
|
public override void Execute(object parameter)
|
||||||
{
|
{
|
||||||
GetTaskbarWindow(parameter).Hide();
|
GetTaskbarWindow(parameter).Hide();
|
||||||
CommandManager.InvalidateRequerySuggested();
|
CommandManager.InvalidateRequerySuggested();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override bool CanExecute(object parameter)
|
public override bool CanExecute(object parameter)
|
||||||
{
|
{
|
||||||
Window win = GetTaskbarWindow(parameter);
|
Window win = GetTaskbarWindow(parameter);
|
||||||
return win != null && win.IsVisible;
|
return win != null && win.IsVisible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,24 +1,24 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Samples.Commands
|
namespace Samples.Commands
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows the main window.
|
/// Shows the main window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ShowSampleWindowCommand : CommandBase<ShowSampleWindowCommand>
|
public class ShowSampleWindowCommand : CommandBase<ShowSampleWindowCommand>
|
||||||
{
|
{
|
||||||
public override void Execute(object parameter)
|
public override void Execute(object parameter)
|
||||||
{
|
{
|
||||||
GetTaskbarWindow(parameter).Show();
|
GetTaskbarWindow(parameter).Show();
|
||||||
CommandManager.InvalidateRequerySuggested();
|
CommandManager.InvalidateRequerySuggested();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override bool CanExecute(object parameter)
|
public override bool CanExecute(object parameter)
|
||||||
{
|
{
|
||||||
Window win = GetTaskbarWindow(parameter);
|
Window win = GetTaskbarWindow(parameter);
|
||||||
return win != null && !win.IsVisible;
|
return win != null && !win.IsVisible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,242 +1,242 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Main"
|
x:Class="Samples.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"
|
||||||
Height="626"
|
Height="626"
|
||||||
Width="703"
|
Width="703"
|
||||||
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" ResizeMode="NoResize">
|
mc:Ignorable="d" ResizeMode="NoResize">
|
||||||
<Grid
|
<Grid
|
||||||
Hyperlink.RequestNavigate="OnNavigationRequest">
|
Hyperlink.RequestNavigate="OnNavigationRequest">
|
||||||
<Grid.Background>
|
<Grid.Background>
|
||||||
<LinearGradientBrush
|
<LinearGradientBrush
|
||||||
EndPoint="0.673,0.95"
|
EndPoint="0.673,0.95"
|
||||||
StartPoint="0.274,0.137">
|
StartPoint="0.274,0.137">
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFFFFFF"
|
Color="#FFFFFFFF"
|
||||||
Offset="0" />
|
Offset="0" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFB4C6D8"
|
Color="#FFB4C6D8"
|
||||||
Offset="0.982" />
|
Offset="0.982" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Grid.Background>
|
</Grid.Background>
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,10,0,0"
|
Margin="10,10,0,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
FontSize="14"
|
FontSize="14"
|
||||||
FontStyle="Italic"
|
FontStyle="Italic"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
TextWrapping="Wrap" Text="WPF NotifyIcon 1.0.5 - Samples"/>
|
TextWrapping="Wrap" Text="WPF NotifyIcon 1.0.5 - Samples"/>
|
||||||
<Button
|
<Button
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,133,0,0"
|
Margin="10,133,0,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
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"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
TextWrapping="Wrap">
|
TextWrapping="Wrap">
|
||||||
<Run
|
<Run
|
||||||
Text="Tutorials:" />
|
Text="Tutorials:" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,75.96,0,0"
|
Margin="10,75.96,0,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Width="224.31"
|
Width="224.31"
|
||||||
Height="47.04"
|
Height="47.04"
|
||||||
d:LayoutOverrides="HorizontalAlignment">
|
d:LayoutOverrides="HorizontalAlignment">
|
||||||
<Run
|
<Run
|
||||||
Text="Tutorials follow the contents of the CodeProject article. Check the "Tutorials" folder for the source code." />
|
Text="Tutorials follow the contents of the CodeProject article. Check the "Tutorials" folder for the source code." />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Button
|
<Button
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,170,0,0"
|
Margin="10,170,0,0"
|
||||||
Width="164"
|
Width="164"
|
||||||
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"
|
||||||
Width="164"
|
Width="164"
|
||||||
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"
|
||||||
Width="164"
|
Width="164"
|
||||||
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"
|
||||||
Width="164"
|
Width="164"
|
||||||
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"
|
||||||
Width="164"
|
Width="164"
|
||||||
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"
|
||||||
Width="164"
|
Width="164"
|
||||||
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"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
HorizontalAlignment="Left" Width="110.93">
|
HorizontalAlignment="Left" Width="110.93">
|
||||||
<Run
|
<Run
|
||||||
Text="Showcase Sample:" />
|
Text="Showcase Sample:" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="255.31,75.96,145.38,0"
|
Margin="255.31,75.96,145.38,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Height="47.04">
|
Height="47.04">
|
||||||
<Run
|
<Run
|
||||||
Text="An interactive sample that shows off most features on a single NotifyIcon." />
|
Text="An interactive sample that shows off most features on a single NotifyIcon." />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Button
|
<Button
|
||||||
Margin="255.31,133,0,0"
|
Margin="255.31,133,0,0"
|
||||||
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
|
||||||
Fill="#FFFFFFFF"
|
Fill="#FFFFFFFF"
|
||||||
Stretch="Fill"
|
Stretch="Fill"
|
||||||
Stroke="#FF60758A"
|
Stroke="#FF60758A"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="244.31,50,0,66"
|
Margin="244.31,50,0,66"
|
||||||
Width="1"
|
Width="1"
|
||||||
Data="M269,57 L269,390.18163" Opacity="0.325" />
|
Data="M269,57 L269,390.18163" Opacity="0.325" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="255.31,191,10,0"
|
Margin="255.31,191,10,0"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
VerticalAlignment="Top">
|
VerticalAlignment="Top">
|
||||||
<Run Text="The latest news related to the component can be found on the project page:" />
|
<Run Text="The latest news related to the component can be found on the project page:" />
|
||||||
<LineBreak />
|
<LineBreak />
|
||||||
<Hyperlink NavigateUri="http://www.hardcodet.net/wpf-notifyicon">
|
<Hyperlink NavigateUri="http://www.hardcodet.net/wpf-notifyicon">
|
||||||
<Run Text="http://www.hardcodet.net/wpf-notifyicon" />
|
<Run Text="http://www.hardcodet.net/wpf-notifyicon" />
|
||||||
</Hyperlink>
|
</Hyperlink>
|
||||||
<LineBreak />
|
<LineBreak />
|
||||||
<LineBreak />
|
<LineBreak />
|
||||||
<Run
|
<Run
|
||||||
Text="Critical feedback is appreciated - please post bug reports, requests, questions etc. to the CodeProject forum" />
|
Text="Critical feedback is appreciated - please post bug reports, requests, questions etc. to the CodeProject forum" />
|
||||||
<Run Language="de-ch" Text=":" />
|
<Run Language="de-ch" Text=":" />
|
||||||
<LineBreak />
|
<LineBreak />
|
||||||
<Hyperlink NavigateUri="http://www.codeproject.com/KB/WPF/wpf_notifyicon.aspx">
|
<Hyperlink NavigateUri="http://www.codeproject.com/KB/WPF/wpf_notifyicon.aspx">
|
||||||
<Run Text="http://www.codeproject.com/KB/WPF/wpf_notifyicon.aspx" />
|
<Run Text="http://www.codeproject.com/KB/WPF/wpf_notifyicon.aspx" />
|
||||||
</Hyperlink>
|
</Hyperlink>
|
||||||
<LineBreak />
|
<LineBreak />
|
||||||
<LineBreak />
|
<LineBreak />
|
||||||
<LineBreak />
|
<LineBreak />
|
||||||
<TextBlock>
|
<TextBlock>
|
||||||
<Run Text="Love it or hate it? Please let me know and " />
|
<Run Text="Love it or hate it? Please let me know and " />
|
||||||
<Hyperlink NavigateUri="http://www.codeproject.com/KB/WPF/wpf_notifyicon.aspx">
|
<Hyperlink NavigateUri="http://www.codeproject.com/KB/WPF/wpf_notifyicon.aspx">
|
||||||
<Run FontWeight="Bold" Text="rate the project" />
|
<Run FontWeight="Bold" Text="rate the project" />
|
||||||
</Hyperlink>
|
</Hyperlink>
|
||||||
<Run Text=" - thanks!" />
|
<Run Text=" - thanks!" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="10,0,10,10"
|
Margin="10,0,10,10"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Height="22.42"
|
Height="22.42"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
FontWeight="Bold">
|
FontWeight="Bold">
|
||||||
<Run
|
<Run
|
||||||
Text="WPF NotifyIcon is free software, released under the" />
|
Text="WPF NotifyIcon is free software, released under the" />
|
||||||
<Run
|
<Run
|
||||||
Text=" " />
|
Text=" " />
|
||||||
<Hyperlink
|
<Hyperlink
|
||||||
NavigateUri="http://www.codeproject.com/info/cpol10.aspx">
|
NavigateUri="http://www.codeproject.com/info/cpol10.aspx">
|
||||||
<Run
|
<Run
|
||||||
Text="CodeProject Open License" />
|
Text="CodeProject Open License" />
|
||||||
</Hyperlink>
|
</Hyperlink>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Path
|
<Path
|
||||||
Fill="#FFFFFFFF"
|
Fill="#FFFFFFFF"
|
||||||
Stretch="Fill"
|
Stretch="Fill"
|
||||||
Stroke="#FF60758A"
|
Stroke="#FF60758A"
|
||||||
Margin="11,0,17.926,41"
|
Margin="11,0,17.926,41"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Height="1"
|
Height="1"
|
||||||
Data="M11,517 L561.07363,517" Opacity="0.33" />
|
Data="M11,517 L561.07363,517" Opacity="0.33" />
|
||||||
<Button
|
<Button
|
||||||
Margin="10,466,0,0"
|
Margin="10,466,0,0"
|
||||||
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"
|
||||||
Width="164"
|
Width="164"
|
||||||
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"
|
||||||
Width="164"
|
Width="164"
|
||||||
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>
|
||||||
<ScaleTransform/>
|
<ScaleTransform/>
|
||||||
<SkewTransform/>
|
<SkewTransform/>
|
||||||
<RotateTransform Angle="-34.915"/>
|
<RotateTransform Angle="-34.915"/>
|
||||||
<TranslateTransform/>
|
<TranslateTransform/>
|
||||||
</TransformGroup>
|
</TransformGroup>
|
||||||
</Image.RenderTransform>
|
</Image.RenderTransform>
|
||||||
</Image>
|
</Image>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -1,106 +1,106 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using Samples.Tutorials;
|
using Samples.Tutorials;
|
||||||
using Samples.Tutorials.Balloons;
|
using Samples.Tutorials.Balloons;
|
||||||
using Samples.Tutorials.Commands;
|
using Samples.Tutorials.Commands;
|
||||||
using Samples.Tutorials.ContextMenus;
|
using Samples.Tutorials.ContextMenus;
|
||||||
using Samples.Tutorials.DataBinding;
|
using Samples.Tutorials.DataBinding;
|
||||||
using Samples.Tutorials.Events;
|
using Samples.Tutorials.Events;
|
||||||
using Samples.Tutorials.MvvmSample;
|
using Samples.Tutorials.MvvmSample;
|
||||||
using Samples.Tutorials.Popups;
|
using Samples.Tutorials.Popups;
|
||||||
using Samples.Tutorials.ToolTips;
|
using Samples.Tutorials.ToolTips;
|
||||||
|
|
||||||
namespace Samples
|
namespace Samples
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for Main.xaml
|
/// Interaction logic for Main.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Main : Window
|
public partial class Main : Window
|
||||||
{
|
{
|
||||||
public Main()
|
public Main()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets <see cref="Window.WindowStartupLocation"/> and
|
/// Sets <see cref="Window.WindowStartupLocation"/> and
|
||||||
/// <see cref="Window.Owner"/> properties of a dialog that
|
/// <see cref="Window.Owner"/> properties of a dialog that
|
||||||
/// is about to be displayed.
|
/// is about to be displayed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="window">The processed window.</param>
|
/// <param name="window">The processed window.</param>
|
||||||
private void ShowDialog(Window window)
|
private void ShowDialog(Window window)
|
||||||
{
|
{
|
||||||
window.Owner = this;
|
window.Owner = this;
|
||||||
window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
||||||
window.ShowDialog();
|
window.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnDeclaration_Click(object sender, RoutedEventArgs e)
|
private void btnDeclaration_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ShowDialog(new SimpleWindowWithNotifyIcon());
|
ShowDialog(new SimpleWindowWithNotifyIcon());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void btnInlineToolTip_Click(object sender, RoutedEventArgs e)
|
private void btnInlineToolTip_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ShowDialog(new InlineToolTipWindow());
|
ShowDialog(new InlineToolTipWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnToolTipControl_Click(object sender, RoutedEventArgs e)
|
private void btnToolTipControl_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ShowDialog(new UserControlToolTipWindow());
|
ShowDialog(new UserControlToolTipWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnPopups_Click(object sender, RoutedEventArgs e)
|
private void btnPopups_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ShowDialog(new InlinePopupWindow());
|
ShowDialog(new InlinePopupWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnContextMenus_Click(object sender, RoutedEventArgs e)
|
private void btnContextMenus_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ShowDialog(new InlineContextMenuWindow());
|
ShowDialog(new InlineContextMenuWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnBalloons_Click(object sender, RoutedEventArgs e)
|
private void btnBalloons_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ShowDialog(new BalloonSampleWindow());
|
ShowDialog(new BalloonSampleWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnCommands_Click(object sender, RoutedEventArgs e)
|
private void btnCommands_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ShowDialog(new CommandWindow());
|
ShowDialog(new CommandWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnEvents_Click(object sender, RoutedEventArgs e)
|
private void btnEvents_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ShowDialog(new EventVisualizerWindow());
|
ShowDialog(new EventVisualizerWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnDataBinding_Click(object sender, RoutedEventArgs e)
|
private void btnDataBinding_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ShowDialog(new DataBoundToolTipWindow());
|
ShowDialog(new DataBoundToolTipWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnMvvm_Click(object sender, System.Windows.RoutedEventArgs e)
|
private void btnMvvm_Click(object sender, System.Windows.RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ShowDialog(new MvvmSampleWindow());
|
ShowDialog(new MvvmSampleWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnMainSample_Click(object sender, RoutedEventArgs e)
|
private void btnMainSample_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var sampleWindow = new ShowcaseWindow();
|
var sampleWindow = new ShowcaseWindow();
|
||||||
|
|
||||||
sampleWindow.Owner = this;
|
sampleWindow.Owner = this;
|
||||||
sampleWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
sampleWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||||
sampleWindow.ShowDialog();
|
sampleWindow.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void OnNavigationRequest(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
|
private void OnNavigationRequest(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
|
||||||
{
|
{
|
||||||
Process.Start(e.Uri.ToString());
|
Process.Start(e.Uri.ToString());
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,58 +1,58 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Resources;
|
using System.Resources;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
|
|
||||||
[assembly: AssemblyTitle("Sample Project")]
|
[assembly: AssemblyTitle("Sample Project")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("Microsoft")]
|
[assembly: AssemblyCompany("Microsoft")]
|
||||||
[assembly: AssemblyProduct("Sample Project")]
|
[assembly: AssemblyProduct("Sample Project")]
|
||||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
|
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
// to COM components. If you need to access a type in this assembly from
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
//In order to begin building localizable applications, set
|
//In order to begin building localizable applications, set
|
||||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||||
//inside a <PropertyGroup>. For example, if you are using US english
|
//inside a <PropertyGroup>. For example, if you are using US english
|
||||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||||
//the line below to match the UICulture setting in the project file.
|
//the line below to match the UICulture setting in the project file.
|
||||||
|
|
||||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||||
|
|
||||||
|
|
||||||
[assembly: ThemeInfo(
|
[assembly: ThemeInfo(
|
||||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||||
//(used if a resource is not found in the page,
|
//(used if a resource is not found in the page,
|
||||||
// or application resource dictionaries)
|
// or application resource dictionaries)
|
||||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||||
//(used if a resource is not found in the page,
|
//(used if a resource is not found in the page,
|
||||||
// app, or any theme specific resource dictionaries)
|
// app, or any theme specific resource dictionaries)
|
||||||
)]
|
)]
|
||||||
|
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
@@ -1,93 +1,93 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <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.18408
|
||||||
//
|
//
|
||||||
// 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 Samples.Properties {
|
namespace Samples.Properties {
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
// 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", "4.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 {
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
internal Resources() {
|
internal Resources() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
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("Samples.Properties.Resources", typeof(Resources).Assembly);
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Samples.Properties.Resources", typeof(Resources).Assembly);
|
||||||
resourceMan = temp;
|
resourceMan = temp;
|
||||||
}
|
}
|
||||||
return resourceMan;
|
return resourceMan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Overrides the current thread's CurrentUICulture property for all
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
/// resource lookups using this strongly typed resource class.
|
/// resource lookups using this strongly typed resource class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Globalization.CultureInfo Culture {
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
get {
|
get {
|
||||||
return resourceCulture;
|
return resourceCulture;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
resourceCulture = value;
|
resourceCulture = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Icon Bulb {
|
internal static System.Drawing.Icon Bulb {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("Bulb", resourceCulture);
|
object obj = ResourceManager.GetObject("Bulb", resourceCulture);
|
||||||
return ((System.Drawing.Icon)(obj));
|
return ((System.Drawing.Icon)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Icon Computers {
|
internal static System.Drawing.Icon Computers {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("Computers", resourceCulture);
|
object obj = ResourceManager.GetObject("Computers", resourceCulture);
|
||||||
return ((System.Drawing.Icon)(obj));
|
return ((System.Drawing.Icon)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Icon NetDrives {
|
internal static System.Drawing.Icon NetDrives {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("NetDrives", resourceCulture);
|
object obj = ResourceManager.GetObject("NetDrives", resourceCulture);
|
||||||
return ((System.Drawing.Icon)(obj));
|
return ((System.Drawing.Icon)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,130 +1,130 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<!--
|
<!--
|
||||||
Microsoft ResX Schema
|
Microsoft ResX Schema
|
||||||
|
|
||||||
Version 2.0
|
Version 2.0
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
The primary goals of this format is to allow a simple XML format
|
||||||
that is mostly human readable. The generation and parsing of the
|
that is mostly human readable. The generation and parsing of the
|
||||||
various data types are done through the TypeConverter classes
|
various data types are done through the TypeConverter classes
|
||||||
associated with the data types.
|
associated with the data types.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
... ado.net/XML headers & schema ...
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
<resheader name="version">2.0</resheader>
|
<resheader name="version">2.0</resheader>
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
<comment>This is a comment</comment>
|
<comment>This is a comment</comment>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
There are any number of "resheader" rows that contain simple
|
||||||
name/value pairs.
|
name/value pairs.
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
Each data row contains a name, and value. The row also contains a
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
text/value conversion through the TypeConverter architecture.
|
text/value conversion through the TypeConverter architecture.
|
||||||
Classes that don't support this are serialized and stored with the
|
Classes that don't support this are serialized and stored with the
|
||||||
mimetype set.
|
mimetype set.
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
The mimetype is used for serialized objects, and tells the
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
read any of the formats listed below.
|
read any of the formats listed below.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
value : The object must be serialized into a byte array
|
value : The object must be serialized into a byte array
|
||||||
: using a System.ComponentModel.TypeConverter
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:choice maxOccurs="unbounded">
|
<xsd:choice maxOccurs="unbounded">
|
||||||
<xsd:element name="metadata">
|
<xsd:element name="metadata">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
<xsd:attribute ref="xml:space" />
|
<xsd:attribute ref="xml:space" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="assembly">
|
<xsd:element name="assembly">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="data">
|
<xsd:element name="data">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
<xsd:attribute ref="xml:space" />
|
<xsd:attribute ref="xml:space" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="resheader">
|
<xsd:element name="resheader">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
</xsd:choice>
|
</xsd:choice>
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
</xsd:schema>
|
</xsd:schema>
|
||||||
<resheader name="resmimetype">
|
<resheader name="resmimetype">
|
||||||
<value>text/microsoft-resx</value>
|
<value>text/microsoft-resx</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="version">
|
<resheader name="version">
|
||||||
<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=2.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=2.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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
<data name="Bulb" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="Bulb" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\icons\bulb.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\icons\bulb.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Computers" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="Computers" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\icons\computers.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\icons\computers.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="NetDrives" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="NetDrives" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\icons\netdrives.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\icons\netdrives.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1,26 +1,26 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <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.18408
|
||||||
//
|
//
|
||||||
// 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 Samples.Properties {
|
namespace Samples.Properties {
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
public static Settings Default {
|
public static Settings Default {
|
||||||
get {
|
get {
|
||||||
return defaultInstance;
|
return defaultInstance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
|
||||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||||
<Profiles>
|
<Profiles>
|
||||||
<Profile Name="(Default)" />
|
<Profile Name="(Default)" />
|
||||||
</Profiles>
|
</Profiles>
|
||||||
<Settings />
|
<Settings />
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
@@ -1,355 +1,355 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProductVersion>9.0.30729</ProductVersion>
|
<ProductVersion>9.0.30729</ProductVersion>
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
<ProjectGuid>{71C74F29-F1C2-49C5-969F-C25AC4CDFCCC}</ProjectGuid>
|
<ProjectGuid>{71C74F29-F1C2-49C5-969F-C25AC4CDFCCC}</ProjectGuid>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>Samples</RootNamespace>
|
<RootNamespace>Samples</RootNamespace>
|
||||||
<AssemblyName>Sample Project</AssemblyName>
|
<AssemblyName>Sample Project</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<FileUpgradeFlags>
|
<FileUpgradeFlags>
|
||||||
</FileUpgradeFlags>
|
</FileUpgradeFlags>
|
||||||
<OldToolsVersion>3.5</OldToolsVersion>
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
<UpgradeBackupLocation />
|
<UpgradeBackupLocation />
|
||||||
<PublishUrl>publish\</PublishUrl>
|
<PublishUrl>publish\</PublishUrl>
|
||||||
<Install>true</Install>
|
<Install>true</Install>
|
||||||
<InstallFrom>Disk</InstallFrom>
|
<InstallFrom>Disk</InstallFrom>
|
||||||
<UpdateEnabled>false</UpdateEnabled>
|
<UpdateEnabled>false</UpdateEnabled>
|
||||||
<UpdateMode>Foreground</UpdateMode>
|
<UpdateMode>Foreground</UpdateMode>
|
||||||
<UpdateInterval>7</UpdateInterval>
|
<UpdateInterval>7</UpdateInterval>
|
||||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||||
<UpdatePeriodically>false</UpdatePeriodically>
|
<UpdatePeriodically>false</UpdatePeriodically>
|
||||||
<UpdateRequired>false</UpdateRequired>
|
<UpdateRequired>false</UpdateRequired>
|
||||||
<MapFileExtensions>true</MapFileExtensions>
|
<MapFileExtensions>true</MapFileExtensions>
|
||||||
<ApplicationRevision>0</ApplicationRevision>
|
<ApplicationRevision>0</ApplicationRevision>
|
||||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||||
<ExpressionBlendVersion>12.0.41002.1</ExpressionBlendVersion>
|
<ExpressionBlendVersion>12.0.41002.1</ExpressionBlendVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Tutorials\09 - MVVM\ClockPopup.xaml.cs">
|
<Compile Include="Tutorials\09 - MVVM\ClockPopup.xaml.cs">
|
||||||
<DependentUpon>ClockPopup.xaml</DependentUpon>
|
<DependentUpon>ClockPopup.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Tutorials\09 - MVVM\MvvmSampleViewModel.cs" />
|
<Compile Include="Tutorials\09 - MVVM\MvvmSampleViewModel.cs" />
|
||||||
<Compile Include="Tutorials\09 - MVVM\MvvmSampleWindow.xaml.cs">
|
<Compile Include="Tutorials\09 - MVVM\MvvmSampleWindow.xaml.cs">
|
||||||
<DependentUpon>MvvmSampleWindow.xaml</DependentUpon>
|
<DependentUpon>MvvmSampleWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Page Include="Tutorials\09 - MVVM\ClockPopup.xaml">
|
<Page Include="Tutorials\09 - MVVM\ClockPopup.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Tutorials\09 - MVVM\MvvmSampleWindow.xaml">
|
<Page Include="Tutorials\09 - MVVM\MvvmSampleWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Reference Include="PresentationFramework.Aero" />
|
<Reference Include="PresentationFramework.Aero" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core">
|
<Reference Include="System.Core">
|
||||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Xaml" />
|
<Reference Include="System.Xaml" />
|
||||||
<Reference Include="System.Xml.Linq">
|
<Reference Include="System.Xml.Linq">
|
||||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Data.DataSetExtensions">
|
<Reference Include="System.Data.DataSetExtensions">
|
||||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="UIAutomationProvider">
|
<Reference Include="UIAutomationProvider">
|
||||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="WindowsBase">
|
<Reference Include="WindowsBase">
|
||||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="PresentationCore">
|
<Reference Include="PresentationCore">
|
||||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="PresentationFramework">
|
<Reference Include="PresentationFramework">
|
||||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Resource Include="Icons\Inactive.ico" />
|
<Resource Include="Icons\Inactive.ico" />
|
||||||
<Resource Include="Icons\Error.ico" />
|
<Resource Include="Icons\Error.ico" />
|
||||||
<Resource Include="Images\Info.png" />
|
<Resource Include="Images\Info.png" />
|
||||||
<Resource Include="Images\Preferences.png" />
|
<Resource Include="Images\Preferences.png" />
|
||||||
<Page Include="Showcase\FancyToolTip.xaml">
|
<Page Include="Showcase\FancyToolTip.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Showcase\NotifyIconResources.xaml">
|
<Page Include="Showcase\NotifyIconResources.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Compile Include="Commands\CloseWindowCommand.cs" />
|
<Compile Include="Commands\CloseWindowCommand.cs" />
|
||||||
<Compile Include="Showcase\FancyToolTip.xaml.cs">
|
<Compile Include="Showcase\FancyToolTip.xaml.cs">
|
||||||
<DependentUpon>FancyToolTip.xaml</DependentUpon>
|
<DependentUpon>FancyToolTip.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Resource Include="Images\Logo.png" />
|
<Resource Include="Images\Logo.png" />
|
||||||
<Resource Include="Tutorials\09 - MVVM\Clock.png" />
|
<Resource Include="Tutorials\09 - MVVM\Clock.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ApplicationDefinition Include="App.xaml">
|
<ApplicationDefinition Include="App.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
<Page Include="Showcase\FancyBalloon.xaml">
|
<Page Include="Showcase\FancyBalloon.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Showcase\FancyPopup.xaml">
|
<Page Include="Showcase\FancyPopup.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Main.xaml">
|
<Page Include="Main.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Tutorials\02 - ToolTips\UserControlToolTipWindow.xaml">
|
<Page Include="Tutorials\02 - ToolTips\UserControlToolTipWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Tutorials\01 - Declaration\NotifyIconResourceDictionary.xaml">
|
<Page Include="Tutorials\01 - Declaration\NotifyIconResourceDictionary.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Tutorials\01 - Declaration\SimpleWindowWithNotifyIcon.xaml">
|
<Page Include="Tutorials\01 - Declaration\SimpleWindowWithNotifyIcon.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Tutorials\02 - ToolTips\SimpleUserControl.xaml">
|
<Page Include="Tutorials\02 - ToolTips\SimpleUserControl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Tutorials\02 - ToolTips\InlineToolTipWindow.xaml">
|
<Page Include="Tutorials\02 - ToolTips\InlineToolTipWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Tutorials\03 - Popups\InlinePopupWindow.xaml">
|
<Page Include="Tutorials\03 - Popups\InlinePopupWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Tutorials\04 - ContextMenus\InlineContextMenuWindow.xaml">
|
<Page Include="Tutorials\04 - ContextMenus\InlineContextMenuWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Tutorials\06 - Commands\CommandWindow.xaml">
|
<Page Include="Tutorials\06 - Commands\CommandWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Tutorials\07 - Events\EventVisualizerWindow.xaml">
|
<Page Include="Tutorials\07 - Events\EventVisualizerWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Tutorials\05 - Balloons\BalloonSampleWindow.xaml">
|
<Page Include="Tutorials\05 - Balloons\BalloonSampleWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Tutorials\08 - DataBinding\DataBoundToolTipWindow.xaml">
|
<Page Include="Tutorials\08 - DataBinding\DataBoundToolTipWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Showcase\WelcomeBalloon.xaml">
|
<Page Include="Showcase\WelcomeBalloon.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Showcase\ShowcaseWindow.xaml">
|
<Page Include="Showcase\ShowcaseWindow.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Compile Include="App.xaml.cs">
|
<Compile Include="App.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
<DependentUpon>App.xaml</DependentUpon>
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Showcase\ShowcaseWindow.xaml.cs">
|
<Compile Include="Showcase\ShowcaseWindow.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
<DependentUpon>ShowcaseWindow.xaml</DependentUpon>
|
<DependentUpon>ShowcaseWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Commands\CommandBase.cs" />
|
<Compile Include="Commands\CommandBase.cs" />
|
||||||
<Compile Include="Commands\HideSampleWindowCommand.cs" />
|
<Compile Include="Commands\HideSampleWindowCommand.cs" />
|
||||||
<Compile Include="Commands\ShowSampleWindowCommand.cs" />
|
<Compile Include="Commands\ShowSampleWindowCommand.cs" />
|
||||||
<Compile Include="Showcase\FancyBalloon.xaml.cs">
|
<Compile Include="Showcase\FancyBalloon.xaml.cs">
|
||||||
<DependentUpon>FancyBalloon.xaml</DependentUpon>
|
<DependentUpon>FancyBalloon.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Showcase\FancyPopup.xaml.cs">
|
<Compile Include="Showcase\FancyPopup.xaml.cs">
|
||||||
<DependentUpon>FancyPopup.xaml</DependentUpon>
|
<DependentUpon>FancyPopup.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Main.xaml.cs">
|
<Compile Include="Main.xaml.cs">
|
||||||
<DependentUpon>Main.xaml</DependentUpon>
|
<DependentUpon>Main.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Properties\Settings.Designer.cs">
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Tutorials\01 - Declaration\SimpleWindowWithNotifyIcon.xaml.cs">
|
<Compile Include="Tutorials\01 - Declaration\SimpleWindowWithNotifyIcon.xaml.cs">
|
||||||
<DependentUpon>SimpleWindowWithNotifyIcon.xaml</DependentUpon>
|
<DependentUpon>SimpleWindowWithNotifyIcon.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Tutorials\02 - ToolTips\SimpleUserControl.xaml.cs">
|
<Compile Include="Tutorials\02 - ToolTips\SimpleUserControl.xaml.cs">
|
||||||
<DependentUpon>SimpleUserControl.xaml</DependentUpon>
|
<DependentUpon>SimpleUserControl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Tutorials\02 - ToolTips\InlineToolTipWindow.xaml.cs">
|
<Compile Include="Tutorials\02 - ToolTips\InlineToolTipWindow.xaml.cs">
|
||||||
<DependentUpon>InlineToolTipWindow.xaml</DependentUpon>
|
<DependentUpon>InlineToolTipWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Tutorials\02 - ToolTips\UserControlToolTipWindow.xaml.cs">
|
<Compile Include="Tutorials\02 - ToolTips\UserControlToolTipWindow.xaml.cs">
|
||||||
<DependentUpon>UserControlToolTipWindow.xaml</DependentUpon>
|
<DependentUpon>UserControlToolTipWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Tutorials\03 - Popups\InlinePopupWindow.xaml.cs">
|
<Compile Include="Tutorials\03 - Popups\InlinePopupWindow.xaml.cs">
|
||||||
<DependentUpon>InlinePopupWindow.xaml</DependentUpon>
|
<DependentUpon>InlinePopupWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Tutorials\04 - ContextMenus\InlineContextMenuWindow.xaml.cs">
|
<Compile Include="Tutorials\04 - ContextMenus\InlineContextMenuWindow.xaml.cs">
|
||||||
<DependentUpon>InlineContextMenuWindow.xaml</DependentUpon>
|
<DependentUpon>InlineContextMenuWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Tutorials\06 - Commands\CommandWindow.xaml.cs">
|
<Compile Include="Tutorials\06 - Commands\CommandWindow.xaml.cs">
|
||||||
<DependentUpon>CommandWindow.xaml</DependentUpon>
|
<DependentUpon>CommandWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Tutorials\06 - Commands\ShowMessageCommand.cs" />
|
<Compile Include="Tutorials\06 - Commands\ShowMessageCommand.cs" />
|
||||||
<Compile Include="Tutorials\07 - Events\EventVisualizerWindow.xaml.cs">
|
<Compile Include="Tutorials\07 - Events\EventVisualizerWindow.xaml.cs">
|
||||||
<DependentUpon>EventVisualizerWindow.xaml</DependentUpon>
|
<DependentUpon>EventVisualizerWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Tutorials\05 - Balloons\BalloonSampleWindow.xaml.cs">
|
<Compile Include="Tutorials\05 - Balloons\BalloonSampleWindow.xaml.cs">
|
||||||
<DependentUpon>BalloonSampleWindow.xaml</DependentUpon>
|
<DependentUpon>BalloonSampleWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Tutorials\08 - DataBinding\DataBoundToolTipWindow.xaml.cs">
|
<Compile Include="Tutorials\08 - DataBinding\DataBoundToolTipWindow.xaml.cs">
|
||||||
<DependentUpon>DataBoundToolTipWindow.xaml</DependentUpon>
|
<DependentUpon>DataBoundToolTipWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Showcase\WelcomeBalloon.xaml.cs">
|
<Compile Include="Showcase\WelcomeBalloon.xaml.cs">
|
||||||
<DependentUpon>WelcomeBalloon.xaml</DependentUpon>
|
<DependentUpon>WelcomeBalloon.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
</None>
|
</None>
|
||||||
<AppDesigner Include="Properties\" />
|
<AppDesigner Include="Properties\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Icons\NetDrives.ico" />
|
<Resource Include="Icons\NetDrives.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Icons\Bulb.ico" />
|
<Resource Include="Icons\Bulb.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Icons\Computers.ico" />
|
<Resource Include="Icons\Computers.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Images\Add.png" />
|
<Resource Include="Images\Add.png" />
|
||||||
<Resource Include="Images\Remove.png" />
|
<Resource Include="Images\Remove.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Images\Close.png" />
|
<Resource Include="Images\Close.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||||
<Visible>False</Visible>
|
<Visible>False</Visible>
|
||||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||||
<Install>false</Install>
|
<Install>false</Install>
|
||||||
</BootstrapperPackage>
|
</BootstrapperPackage>
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||||
<Visible>False</Visible>
|
<Visible>False</Visible>
|
||||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||||
<Install>true</Install>
|
<Install>true</Install>
|
||||||
</BootstrapperPackage>
|
</BootstrapperPackage>
|
||||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||||
<Visible>False</Visible>
|
<Visible>False</Visible>
|
||||||
<ProductName>Windows Installer 3.1</ProductName>
|
<ProductName>Windows Installer 3.1</ProductName>
|
||||||
<Install>true</Install>
|
<Install>true</Install>
|
||||||
</BootstrapperPackage>
|
</BootstrapperPackage>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\NotifyIconWpf\NotifyIconWpf.csproj">
|
<ProjectReference Include="..\NotifyIconWpf\NotifyIconWpf.csproj">
|
||||||
<Project>{7AC63864-7638-41C4-969C-D3197EF2BED9}</Project>
|
<Project>{7AC63864-7638-41C4-969C-D3197EF2BED9}</Project>
|
||||||
<Name>NotifyIconWpf</Name>
|
<Name>NotifyIconWpf</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup />
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
<Target Name="BeforeBuild">
|
<Target Name="BeforeBuild">
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="AfterBuild">
|
<Target Name="AfterBuild">
|
||||||
</Target>
|
</Target>
|
||||||
-->
|
-->
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,162 +1,162 @@
|
|||||||
<UserControl x:Class="Samples.FancyBalloon"
|
<UserControl x:Class="Samples.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"
|
||||||
x:Name="me"
|
x:Name="me"
|
||||||
Height="120"
|
Height="120"
|
||||||
Width="240">
|
Width="240">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<Storyboard x:Key="FadeIn">
|
<Storyboard x:Key="FadeIn">
|
||||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
||||||
Storyboard.TargetName="grid"
|
Storyboard.TargetName="grid"
|
||||||
Storyboard.TargetProperty="(UIElement.Opacity)">
|
Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
||||||
Value="0" />
|
Value="0" />
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:01"
|
<SplineDoubleKeyFrame KeyTime="00:00:01"
|
||||||
Value="0.95" />
|
Value="0.95" />
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:03"
|
<SplineDoubleKeyFrame KeyTime="00:00:03"
|
||||||
Value="0.95" />
|
Value="0.95" />
|
||||||
<!-- <SplineDoubleKeyFrame KeyTime="00:00:05" Value="0"/>-->
|
<!-- <SplineDoubleKeyFrame KeyTime="00:00:05" Value="0"/>-->
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
<Storyboard x:Key="HighlightCloseButton">
|
<Storyboard x:Key="HighlightCloseButton">
|
||||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
||||||
Storyboard.TargetName="imgClose"
|
Storyboard.TargetName="imgClose"
|
||||||
Storyboard.TargetProperty="(UIElement.Opacity)">
|
Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
||||||
Value="0.4" />
|
Value="0.4" />
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
|
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
|
||||||
Value="1" />
|
Value="1" />
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
<Storyboard x:Key="FadeCloseButton">
|
<Storyboard x:Key="FadeCloseButton">
|
||||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
||||||
Storyboard.TargetName="imgClose"
|
Storyboard.TargetName="imgClose"
|
||||||
Storyboard.TargetProperty="(UIElement.Opacity)">
|
Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
||||||
Value="1" />
|
Value="1" />
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
|
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
|
||||||
Value="0.4" />
|
Value="0.4" />
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
<Storyboard x:Key="FadeBack">
|
<Storyboard x:Key="FadeBack">
|
||||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
||||||
Storyboard.TargetName="grid"
|
Storyboard.TargetName="grid"
|
||||||
Storyboard.TargetProperty="(UIElement.Opacity)">
|
Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
||||||
Value="1" />
|
Value="1" />
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
|
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
|
||||||
Value="1" />
|
Value="1" />
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
<Storyboard x:Key="FadeOut"
|
<Storyboard x:Key="FadeOut"
|
||||||
Completed="OnFadeOutCompleted">
|
Completed="OnFadeOutCompleted">
|
||||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
||||||
Storyboard.TargetName="grid"
|
Storyboard.TargetName="grid"
|
||||||
Storyboard.TargetProperty="(UIElement.Opacity)">
|
Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
||||||
Value="1" />
|
Value="1" />
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
|
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
|
||||||
Value="0.2" />
|
Value="0.2" />
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<UserControl.Triggers>
|
<UserControl.Triggers>
|
||||||
<EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonShowing">
|
<EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonShowing">
|
||||||
<BeginStoryboard Storyboard="{StaticResource FadeIn}"
|
<BeginStoryboard Storyboard="{StaticResource FadeIn}"
|
||||||
x:Name="FadeIn_BeginStoryboard" />
|
x:Name="FadeIn_BeginStoryboard" />
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
<EventTrigger RoutedEvent="Mouse.MouseEnter"
|
<EventTrigger RoutedEvent="Mouse.MouseEnter"
|
||||||
SourceName="imgClose">
|
SourceName="imgClose">
|
||||||
<BeginStoryboard Storyboard="{StaticResource HighlightCloseButton}"
|
<BeginStoryboard Storyboard="{StaticResource HighlightCloseButton}"
|
||||||
x:Name="HighlightCloseButton_BeginStoryboard" />
|
x:Name="HighlightCloseButton_BeginStoryboard" />
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
<EventTrigger RoutedEvent="Mouse.MouseLeave"
|
<EventTrigger RoutedEvent="Mouse.MouseLeave"
|
||||||
SourceName="imgClose">
|
SourceName="imgClose">
|
||||||
<BeginStoryboard Storyboard="{StaticResource FadeCloseButton}"
|
<BeginStoryboard Storyboard="{StaticResource FadeCloseButton}"
|
||||||
x:Name="FadeCloseButton_BeginStoryboard" />
|
x:Name="FadeCloseButton_BeginStoryboard" />
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
<EventTrigger RoutedEvent="Mouse.MouseEnter">
|
<EventTrigger RoutedEvent="Mouse.MouseEnter">
|
||||||
<StopStoryboard BeginStoryboardName="FadeIn_BeginStoryboard" />
|
<StopStoryboard BeginStoryboardName="FadeIn_BeginStoryboard" />
|
||||||
<BeginStoryboard x:Name="FadeBack_BeginStoryboard1"
|
<BeginStoryboard x:Name="FadeBack_BeginStoryboard1"
|
||||||
Storyboard="{StaticResource FadeBack}" />
|
Storyboard="{StaticResource FadeBack}" />
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
<EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonClosing">
|
<EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonClosing">
|
||||||
<BeginStoryboard Storyboard="{StaticResource FadeOut}"
|
<BeginStoryboard Storyboard="{StaticResource FadeOut}"
|
||||||
x:Name="FadeOut_BeginStoryboard" />
|
x:Name="FadeOut_BeginStoryboard" />
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
</UserControl.Triggers>
|
</UserControl.Triggers>
|
||||||
<Grid x:Name="grid"
|
<Grid x:Name="grid"
|
||||||
MouseEnter="grid_MouseEnter">
|
MouseEnter="grid_MouseEnter">
|
||||||
<Border HorizontalAlignment="Stretch"
|
<Border HorizontalAlignment="Stretch"
|
||||||
Margin="5,5,5,5"
|
Margin="5,5,5,5"
|
||||||
BorderThickness="1,1,1,1"
|
BorderThickness="1,1,1,1"
|
||||||
BorderBrush="#FF997137">
|
BorderBrush="#FF997137">
|
||||||
<Border.Effect>
|
<Border.Effect>
|
||||||
<DropShadowEffect Color="#FF747474" />
|
<DropShadowEffect Color="#FF747474" />
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
<Border.Background>
|
<Border.Background>
|
||||||
<LinearGradientBrush EndPoint="0.5,1"
|
<LinearGradientBrush EndPoint="0.5,1"
|
||||||
StartPoint="0.5,0">
|
StartPoint="0.5,0">
|
||||||
<GradientStop Color="#FF4B4B4B"
|
<GradientStop Color="#FF4B4B4B"
|
||||||
Offset="0" />
|
Offset="0" />
|
||||||
<GradientStop Color="#FF8F8F8F"
|
<GradientStop Color="#FF8F8F8F"
|
||||||
Offset="1" />
|
Offset="1" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Border.Background>
|
</Border.Background>
|
||||||
</Border>
|
</Border>
|
||||||
<Image HorizontalAlignment="Left"
|
<Image HorizontalAlignment="Left"
|
||||||
Margin="0,10,0,0"
|
Margin="0,10,0,0"
|
||||||
Width="72"
|
Width="72"
|
||||||
Source="/Images/Info.png"
|
Source="/Images/Info.png"
|
||||||
Stretch="Fill"
|
Stretch="Fill"
|
||||||
Height="72"
|
Height="72"
|
||||||
VerticalAlignment="Top" />
|
VerticalAlignment="Top" />
|
||||||
<TextBlock Margin="72,49.2,10,0"
|
<TextBlock Margin="72,49.2,10,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Foreground="#FFECAD25"
|
Foreground="#FFECAD25"
|
||||||
TextWrapping="Wrap">
|
TextWrapping="Wrap">
|
||||||
<Run Text="This is a user control. The animation uses the attached " />
|
<Run Text="This is a user control. The animation uses the attached " />
|
||||||
<Run FontStyle="Italic"
|
<Run FontStyle="Italic"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Text="BalloonShowing " />
|
Text="BalloonShowing " />
|
||||||
<Run Text="event." />
|
<Run Text="event." />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Path Fill="#FFFFFFFF"
|
<Path Fill="#FFFFFFFF"
|
||||||
Stretch="Fill"
|
Stretch="Fill"
|
||||||
Margin="72,38.2,34,0"
|
Margin="72,38.2,34,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Height="1"
|
Height="1"
|
||||||
Data="M26,107 L220.04123,107"
|
Data="M26,107 L220.04123,107"
|
||||||
SnapsToDevicePixels="True">
|
SnapsToDevicePixels="True">
|
||||||
<Path.Stroke>
|
<Path.Stroke>
|
||||||
<LinearGradientBrush EndPoint="0.973,0.5"
|
<LinearGradientBrush EndPoint="0.973,0.5"
|
||||||
StartPoint="0.005,0.5">
|
StartPoint="0.005,0.5">
|
||||||
<GradientStop Color="#00ECAD25"
|
<GradientStop Color="#00ECAD25"
|
||||||
Offset="1" />
|
Offset="1" />
|
||||||
<GradientStop Color="#87ECAD25"
|
<GradientStop Color="#87ECAD25"
|
||||||
Offset="0" />
|
Offset="0" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Path.Stroke>
|
</Path.Stroke>
|
||||||
</Path>
|
</Path>
|
||||||
<TextBlock Margin="72,10,10,0"
|
<TextBlock Margin="72,10,10,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Height="23.2"
|
Height="23.2"
|
||||||
Text="{Binding Path=BalloonText, ElementName=me, Mode=Default}"
|
Text="{Binding Path=BalloonText, ElementName=me, Mode=Default}"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Foreground="#FFECAD25"
|
Foreground="#FFECAD25"
|
||||||
FontWeight="Bold" />
|
FontWeight="Bold" />
|
||||||
<Image HorizontalAlignment="Right"
|
<Image HorizontalAlignment="Right"
|
||||||
Margin="0,10,10,0"
|
Margin="0,10,10,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Width="16"
|
Width="16"
|
||||||
Height="16"
|
Height="16"
|
||||||
Source="/Images/Close.png"
|
Source="/Images/Close.png"
|
||||||
Stretch="Fill"
|
Stretch="Fill"
|
||||||
Opacity="0.4"
|
Opacity="0.4"
|
||||||
ToolTip="Close Balloon"
|
ToolTip="Close Balloon"
|
||||||
x:Name="imgClose"
|
x:Name="imgClose"
|
||||||
MouseDown="imgClose_MouseDown" />
|
MouseDown="imgClose_MouseDown" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,107 +1,107 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Controls.Primitives;
|
using System.Windows.Controls.Primitives;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using Hardcodet.Wpf.TaskbarNotification;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
|
|
||||||
namespace Samples
|
namespace Samples
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for FancyBalloon.xaml
|
/// Interaction logic for FancyBalloon.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class FancyBalloon : UserControl
|
public partial class FancyBalloon : UserControl
|
||||||
{
|
{
|
||||||
private bool isClosing = false;
|
private bool isClosing = false;
|
||||||
|
|
||||||
#region BalloonText dependency property
|
#region BalloonText dependency property
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Description
|
/// Description
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty BalloonTextProperty =
|
public static readonly DependencyProperty BalloonTextProperty =
|
||||||
DependencyProperty.Register("BalloonText",
|
DependencyProperty.Register("BalloonText",
|
||||||
typeof (string),
|
typeof (string),
|
||||||
typeof (FancyBalloon),
|
typeof (FancyBalloon),
|
||||||
new FrameworkPropertyMetadata(""));
|
new FrameworkPropertyMetadata(""));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A property wrapper for the <see cref="BalloonTextProperty"/>
|
/// A property wrapper for the <see cref="BalloonTextProperty"/>
|
||||||
/// dependency property:<br/>
|
/// dependency property:<br/>
|
||||||
/// Description
|
/// Description
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BalloonText
|
public string BalloonText
|
||||||
{
|
{
|
||||||
get { return (string) GetValue(BalloonTextProperty); }
|
get { return (string) GetValue(BalloonTextProperty); }
|
||||||
set { SetValue(BalloonTextProperty, value); }
|
set { SetValue(BalloonTextProperty, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public FancyBalloon()
|
public FancyBalloon()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
|
TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// By subscribing to the <see cref="TaskbarIcon.BalloonClosingEvent"/>
|
/// By subscribing to the <see cref="TaskbarIcon.BalloonClosingEvent"/>
|
||||||
/// and setting the "Handled" property to true, we suppress the popup
|
/// and setting the "Handled" property to true, we suppress the popup
|
||||||
/// from being closed in order to display the custom fade-out animation.
|
/// from being closed in order to display the custom fade-out animation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void OnBalloonClosing(object sender, RoutedEventArgs e)
|
private void OnBalloonClosing(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
e.Handled = true; //suppresses the popup from being closed immediately
|
e.Handled = true; //suppresses the popup from being closed immediately
|
||||||
isClosing = true;
|
isClosing = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resolves the <see cref="TaskbarIcon"/> that displayed
|
/// Resolves the <see cref="TaskbarIcon"/> that displayed
|
||||||
/// the balloon and requests a close action.
|
/// the balloon and requests a close action.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void imgClose_MouseDown(object sender, MouseButtonEventArgs e)
|
private void imgClose_MouseDown(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
//the tray icon assigned this attached property to simplify access
|
//the tray icon assigned this attached property to simplify access
|
||||||
TaskbarIcon taskbarIcon = TaskbarIcon.GetParentTaskbarIcon(this);
|
TaskbarIcon taskbarIcon = TaskbarIcon.GetParentTaskbarIcon(this);
|
||||||
taskbarIcon.CloseBalloon();
|
taskbarIcon.CloseBalloon();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If the users hovers over the balloon, we don't close it.
|
/// If the users hovers over the balloon, we don't close it.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void grid_MouseEnter(object sender, MouseEventArgs e)
|
private void grid_MouseEnter(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
//if we're already running the fade-out animation, do not interrupt anymore
|
//if we're already running the fade-out animation, do not interrupt anymore
|
||||||
//(makes things too complicated for the sample)
|
//(makes things too complicated for the sample)
|
||||||
if (isClosing) return;
|
if (isClosing) return;
|
||||||
|
|
||||||
//the tray icon assigned this attached property to simplify access
|
//the tray icon assigned this attached property to simplify access
|
||||||
TaskbarIcon taskbarIcon = TaskbarIcon.GetParentTaskbarIcon(this);
|
TaskbarIcon taskbarIcon = TaskbarIcon.GetParentTaskbarIcon(this);
|
||||||
taskbarIcon.ResetBalloonCloseTimer();
|
taskbarIcon.ResetBalloonCloseTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Closes the popup once the fade-out animation completed.
|
/// Closes the popup once the fade-out animation completed.
|
||||||
/// The animation was triggered in XAML through the attached
|
/// The animation was triggered in XAML through the attached
|
||||||
/// BalloonClosing event.
|
/// BalloonClosing event.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void OnFadeOutCompleted(object sender, EventArgs e)
|
private void OnFadeOutCompleted(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Popup pp = (Popup) Parent;
|
Popup pp = (Popup) Parent;
|
||||||
pp.IsOpen = false;
|
pp.IsOpen = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,115 +1,115 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
x:Class="Samples.FancyPopup"
|
x:Class="Samples.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"
|
||||||
Height="215"
|
Height="215"
|
||||||
Width="300" x:Name="me">
|
Width="300" x:Name="me">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<Storyboard x:Key="RotateIcon">
|
<Storyboard x:Key="RotateIcon">
|
||||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
|
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
|
||||||
<SplineDoubleKeyFrame KeySpline="0,0.284,0.39,1" KeyTime="00:00:01.4000000" Value="360"/>
|
<SplineDoubleKeyFrame KeySpline="0,0.284,0.39,1" KeyTime="00:00:01.4000000" Value="360"/>
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<UserControl.Triggers>
|
<UserControl.Triggers>
|
||||||
<EventTrigger RoutedEvent="tb:TaskbarIcon.PopupOpened">
|
<EventTrigger RoutedEvent="tb:TaskbarIcon.PopupOpened">
|
||||||
<BeginStoryboard Storyboard="{StaticResource RotateIcon}" x:Name="RotateIcon_BeginStoryboard"/>
|
<BeginStoryboard Storyboard="{StaticResource RotateIcon}" x:Name="RotateIcon_BeginStoryboard"/>
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
</UserControl.Triggers>
|
</UserControl.Triggers>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Border
|
<Border
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Width="Auto"
|
Width="Auto"
|
||||||
Height="Auto"
|
Height="Auto"
|
||||||
Margin="5,5,5,5"
|
Margin="5,5,5,5"
|
||||||
CornerRadius="10,10,10,10">
|
CornerRadius="10,10,10,10">
|
||||||
<Border.Effect>
|
<Border.Effect>
|
||||||
<DropShadowEffect
|
<DropShadowEffect
|
||||||
Color="#FF474747" />
|
Color="#FF474747" />
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
<Border.Background>
|
<Border.Background>
|
||||||
<LinearGradientBrush
|
<LinearGradientBrush
|
||||||
EndPoint="0.5,1"
|
EndPoint="0.5,1"
|
||||||
StartPoint="0.5,0">
|
StartPoint="0.5,0">
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FF58C2FF"
|
Color="#FF58C2FF"
|
||||||
Offset="0" />
|
Offset="0" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFFFFFF"
|
Color="#FFFFFFFF"
|
||||||
Offset="1" />
|
Offset="1" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Border.Background>
|
</Border.Background>
|
||||||
</Border>
|
</Border>
|
||||||
<Image
|
<Image
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="19,10,0,0"
|
Margin="19,10,0,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Width="72"
|
Width="72"
|
||||||
Height="72"
|
Height="72"
|
||||||
Source="/Images/Preferences.png"
|
Source="/Images/Preferences.png"
|
||||||
Stretch="Fill" x:Name="image" RenderTransformOrigin="0.5,0.5" >
|
Stretch="Fill" x:Name="image" RenderTransformOrigin="0.5,0.5" >
|
||||||
<Image.RenderTransform>
|
<Image.RenderTransform>
|
||||||
<TransformGroup>
|
<TransformGroup>
|
||||||
<ScaleTransform ScaleX="1" ScaleY="1"/>
|
<ScaleTransform ScaleX="1" ScaleY="1"/>
|
||||||
<SkewTransform AngleX="0" AngleY="0"/>
|
<SkewTransform AngleX="0" AngleY="0"/>
|
||||||
<RotateTransform Angle="0"/>
|
<RotateTransform Angle="0"/>
|
||||||
<TranslateTransform X="0" Y="0"/>
|
<TranslateTransform X="0" Y="0"/>
|
||||||
</TransformGroup>
|
</TransformGroup>
|
||||||
</Image.RenderTransform>
|
</Image.RenderTransform>
|
||||||
</Image>
|
</Image>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="107,10,20,0"
|
Margin="107,10,20,0"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Height="Auto"
|
Height="Auto"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
FontSize="16"
|
FontSize="16"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Foreground="#FF575757" HorizontalAlignment="Right"><Run
|
Foreground="#FF575757" HorizontalAlignment="Right"><Run
|
||||||
Text="This is a fancy Popup..."
|
Text="This is a fancy Popup..."
|
||||||
Language="de-ch" /></TextBlock>
|
Language="de-ch" /></TextBlock>
|
||||||
<Button
|
<Button
|
||||||
Click="OnButtonClick"
|
Click="OnButtonClick"
|
||||||
ToolTip="{Binding Path=ToolTipText}"
|
ToolTip="{Binding Path=ToolTipText}"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Width="89"
|
Width="89"
|
||||||
Height="29"
|
Height="29"
|
||||||
Content="Click me"
|
Content="Click me"
|
||||||
Margin="0,0,20,20"
|
Margin="0,0,20,20"
|
||||||
BorderBrush="#FFFFFFFF">
|
BorderBrush="#FFFFFFFF">
|
||||||
<Button.Background>
|
<Button.Background>
|
||||||
<LinearGradientBrush
|
<LinearGradientBrush
|
||||||
EndPoint="0,1"
|
EndPoint="0,1"
|
||||||
StartPoint="0,0">
|
StartPoint="0,0">
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFFFFFF"
|
Color="#FFFFFFFF"
|
||||||
Offset="1" />
|
Offset="1" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFFD197"
|
Color="#FFFFD197"
|
||||||
Offset="0.459" />
|
Offset="0.459" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFFDBAD"
|
Color="#FFFFDBAD"
|
||||||
Offset="0" />
|
Offset="0" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFF18E23"
|
Color="#FFF18E23"
|
||||||
Offset="0.508" />
|
Offset="0.508" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFF9D4AC"
|
Color="#FFF9D4AC"
|
||||||
Offset="0.954" />
|
Offset="0.954" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Button.Background>
|
</Button.Background>
|
||||||
</Button>
|
</Button>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="19,92,10,49"
|
Margin="19,92,10,49"
|
||||||
TextWrapping="Wrap"><Run Text="This user control makes use of the " Language="de-ch"/><Run FontStyle="Italic" FontWeight="Bold" Text="PopupOpened " Language="de-ch"/><Run Text="attached routed event . Whenever the popup is opened, this attached event fires and triggers the rotation animation." Language="de-ch"/></TextBlock>
|
TextWrapping="Wrap"><Run Text="This user control makes use of the " Language="de-ch"/><Run FontStyle="Italic" FontWeight="Bold" Text="PopupOpened " Language="de-ch"/><Run Text="attached routed event . Whenever the popup is opened, this attached event fires and triggers the rotation animation." Language="de-ch"/></TextBlock>
|
||||||
<TextBlock Margin="0,52,20,0" VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap" FontWeight="Bold" FontSize="14" HorizontalAlignment="Right" Foreground="#FF575757"><Run Text="Clicks: " Language="de-ch"/><InlineUIContainer>
|
<TextBlock Margin="0,52,20,0" VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap" FontWeight="Bold" FontSize="14" HorizontalAlignment="Right" Foreground="#FF575757"><Run Text="Clicks: " Language="de-ch"/><InlineUIContainer>
|
||||||
<TextBlock Width="Auto" Height="Auto" Text="{Binding Path=ClickCount, ElementName=me, Mode=Default}" TextWrapping="Wrap"/>
|
<TextBlock Width="Auto" Height="Auto" Text="{Binding Path=ClickCount, ElementName=me, Mode=Default}" TextWrapping="Wrap"/>
|
||||||
</InlineUIContainer></TextBlock>
|
</InlineUIContainer></TextBlock>
|
||||||
<Image
|
<Image
|
||||||
Source="{Binding Path=IconSource}" Width="16" HorizontalAlignment="Left" Margin="19,0,0,23" Height="16" VerticalAlignment="Bottom" />
|
Source="{Binding Path=IconSource}" Width="16" HorizontalAlignment="Left" Margin="19,0,0,23" Height="16" VerticalAlignment="Bottom" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -1,46 +1,46 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace Samples
|
namespace Samples
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for FancyPopup.xaml
|
/// Interaction logic for FancyPopup.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class FancyPopup : UserControl
|
public partial class FancyPopup : UserControl
|
||||||
{
|
{
|
||||||
#region ClickCount dependency property
|
#region ClickCount dependency property
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The number of clicks on the popup button.
|
/// The number of clicks on the popup button.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty ClickCountProperty =
|
public static readonly DependencyProperty ClickCountProperty =
|
||||||
DependencyProperty.Register("ClickCount",
|
DependencyProperty.Register("ClickCount",
|
||||||
typeof (int),
|
typeof (int),
|
||||||
typeof (FancyPopup),
|
typeof (FancyPopup),
|
||||||
new FrameworkPropertyMetadata(0));
|
new FrameworkPropertyMetadata(0));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A property wrapper for the <see cref="ClickCountProperty"/>
|
/// A property wrapper for the <see cref="ClickCountProperty"/>
|
||||||
/// dependency property:<br/>
|
/// dependency property:<br/>
|
||||||
/// The number of clicks on the popup button.
|
/// The number of clicks on the popup button.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int ClickCount
|
public int ClickCount
|
||||||
{
|
{
|
||||||
get { return (int) GetValue(ClickCountProperty); }
|
get { return (int) GetValue(ClickCountProperty); }
|
||||||
set { SetValue(ClickCountProperty, value); }
|
set { SetValue(ClickCountProperty, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public FancyPopup()
|
public FancyPopup()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnButtonClick(object sender, RoutedEventArgs e)
|
private void OnButtonClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
//just increment a counter - will be displayed on screen
|
//just increment a counter - will be displayed on screen
|
||||||
ClickCount++;
|
ClickCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,114 +1,114 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
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: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: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="Samples.FancyToolTip"
|
||||||
x:Name="me"
|
x:Name="me"
|
||||||
Width="285"
|
Width="285"
|
||||||
Height="136">
|
Height="136">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<Storyboard x:Key="FadeIn">
|
<Storyboard x:Key="FadeIn">
|
||||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.Opacity)">
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
|
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1" KeySpline="0,0,0.46,0.969"/>
|
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1" KeySpline="0,0,0.46,0.969"/>
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.6"/>
|
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.6"/>
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>
|
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
<Storyboard x:Key="FadeOut">
|
<Storyboard x:Key="FadeOut">
|
||||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.Opacity)">
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
|
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="0.25"/>
|
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="0.25"/>
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
|
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="0.6"/>
|
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="0.6"/>
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<UserControl.Triggers>
|
<UserControl.Triggers>
|
||||||
<EventTrigger RoutedEvent="tb:TaskbarIcon.ToolTipOpened">
|
<EventTrigger RoutedEvent="tb:TaskbarIcon.ToolTipOpened">
|
||||||
<BeginStoryboard Storyboard="{StaticResource FadeIn}" x:Name="FadeIn_BeginStoryboard"/>
|
<BeginStoryboard Storyboard="{StaticResource FadeIn}" x:Name="FadeIn_BeginStoryboard"/>
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
<EventTrigger RoutedEvent="tb:TaskbarIcon.ToolTipClose">
|
<EventTrigger RoutedEvent="tb:TaskbarIcon.ToolTipClose">
|
||||||
<BeginStoryboard Storyboard="{StaticResource FadeOut}" x:Name="FadeOut_BeginStoryboard"/>
|
<BeginStoryboard Storyboard="{StaticResource FadeOut}" x:Name="FadeOut_BeginStoryboard"/>
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
</UserControl.Triggers>
|
</UserControl.Triggers>
|
||||||
|
|
||||||
<Grid
|
<Grid
|
||||||
x:Name="LayoutRoot" Height="Auto">
|
x:Name="LayoutRoot" Height="Auto">
|
||||||
<Border
|
<Border
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Width="Auto"
|
Width="Auto"
|
||||||
Height="Auto"
|
Height="Auto"
|
||||||
CornerRadius="6,6,6,6"
|
CornerRadius="6,6,6,6"
|
||||||
BorderThickness="3,3,3,3"
|
BorderThickness="3,3,3,3"
|
||||||
Margin="0,0,5,5" x:Name="border">
|
Margin="0,0,5,5" x:Name="border">
|
||||||
<Border.Effect>
|
<Border.Effect>
|
||||||
<DropShadowEffect
|
<DropShadowEffect
|
||||||
Color="#FF7A7A7A" />
|
Color="#FF7A7A7A" />
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
<Border.Background>
|
<Border.Background>
|
||||||
<LinearGradientBrush
|
<LinearGradientBrush
|
||||||
EndPoint="0.5,1"
|
EndPoint="0.5,1"
|
||||||
StartPoint="0.5,0">
|
StartPoint="0.5,0">
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFFD283"
|
Color="#FFFFD283"
|
||||||
Offset="0" />
|
Offset="0" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFFFFFF"
|
Color="#FFFFFFFF"
|
||||||
Offset="1" />
|
Offset="1" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Border.Background>
|
</Border.Background>
|
||||||
</Border>
|
</Border>
|
||||||
<Image
|
<Image
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="10,10,0,26"
|
Margin="10,10,0,26"
|
||||||
Width="72"
|
Width="72"
|
||||||
Source="/Images/Info.png"
|
Source="/Images/Info.png"
|
||||||
Stretch="Fill"
|
Stretch="Fill"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
RenderTransformOrigin="0.792,0.486" x:Name="image" Height="72" >
|
RenderTransformOrigin="0.792,0.486" x:Name="image" Height="72" >
|
||||||
<Image.RenderTransform>
|
<Image.RenderTransform>
|
||||||
<TransformGroup>
|
<TransformGroup>
|
||||||
<ScaleTransform ScaleX="1" ScaleY="1"/>
|
<ScaleTransform ScaleX="1" ScaleY="1"/>
|
||||||
<SkewTransform AngleX="0" AngleY="0"/>
|
<SkewTransform AngleX="0" AngleY="0"/>
|
||||||
<RotateTransform Angle="0"/>
|
<RotateTransform Angle="0"/>
|
||||||
<TranslateTransform X="0" Y="0"/>
|
<TranslateTransform X="0" Y="0"/>
|
||||||
</TransformGroup>
|
</TransformGroup>
|
||||||
</Image.RenderTransform>
|
</Image.RenderTransform>
|
||||||
</Image>
|
</Image>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="82,10,20,0"
|
Margin="82,10,20,0"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Height="32"
|
Height="32"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
FontSize="16"
|
FontSize="16"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Foreground="#FF575757"><Run
|
Foreground="#FF575757"><Run
|
||||||
Text="This is a fancy ToolTip..."
|
Text="This is a fancy ToolTip..."
|
||||||
Language="de-ch" /></TextBlock>
|
Language="de-ch" /></TextBlock>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Foreground="#FF141414"
|
Foreground="#FF141414"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Margin="10,0,20,19"
|
Margin="10,0,20,19"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Text="{Binding ElementName=me, Path=InfoText}"
|
Text="{Binding ElementName=me, Path=InfoText}"
|
||||||
x:Name="txtToolTipDetail" d:LayoutOverrides="Height" />
|
x:Name="txtToolTipDetail" d:LayoutOverrides="Height" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
FontWeight="Normal"
|
FontWeight="Normal"
|
||||||
Foreground="#FF141414"
|
Foreground="#FF141414"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Margin="82,42,20,44.96"
|
Margin="82,42,20,44.96"
|
||||||
x:Name="txtToolTipDetail_Copy" ><Run Text="Data binding is simple: The NotifyIcon sets the DataContext unless it's not already in use." Language="de-ch"/></TextBlock>
|
x:Name="txtToolTipDetail_Copy" ><Run Text="Data binding is simple: The NotifyIcon sets the DataContext unless it's not already in use." Language="de-ch"/></TextBlock>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,51 +1,51 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using Hardcodet.Wpf.TaskbarNotification;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
|
|
||||||
namespace Samples
|
namespace Samples
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for FancyToolTip.xaml
|
/// Interaction logic for FancyToolTip.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class FancyToolTip
|
public partial class FancyToolTip
|
||||||
{
|
{
|
||||||
#region InfoText dependency property
|
#region InfoText dependency property
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The tooltip details.
|
/// The tooltip details.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty InfoTextProperty =
|
public static readonly DependencyProperty InfoTextProperty =
|
||||||
DependencyProperty.Register("InfoText",
|
DependencyProperty.Register("InfoText",
|
||||||
typeof (string),
|
typeof (string),
|
||||||
typeof (FancyToolTip),
|
typeof (FancyToolTip),
|
||||||
new FrameworkPropertyMetadata(""));
|
new FrameworkPropertyMetadata(""));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A property wrapper for the <see cref="InfoTextProperty"/>
|
/// A property wrapper for the <see cref="InfoTextProperty"/>
|
||||||
/// dependency property:<br/>
|
/// dependency property:<br/>
|
||||||
/// The tooltip details.
|
/// The tooltip details.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string InfoText
|
public string InfoText
|
||||||
{
|
{
|
||||||
get { return (string) GetValue(InfoTextProperty); }
|
get { return (string) GetValue(InfoTextProperty); }
|
||||||
set { SetValue(InfoTextProperty, value); }
|
set { SetValue(InfoTextProperty, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public FancyToolTip()
|
public FancyToolTip()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
this.InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,81 +1,81 @@
|
|||||||
<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:Commands="clr-namespace:Samples.Commands"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar">
|
xmlns:tb="http://www.hardcodet.net/taskbar">
|
||||||
<LinearGradientBrush x:Key="MenuBackground"
|
<LinearGradientBrush x:Key="MenuBackground"
|
||||||
EndPoint="0.5,1"
|
EndPoint="0.5,1"
|
||||||
StartPoint="0.5,0">
|
StartPoint="0.5,0">
|
||||||
<GradientStop Color="#FFFFD892"
|
<GradientStop Color="#FFFFD892"
|
||||||
Offset="1" />
|
Offset="1" />
|
||||||
<GradientStop Color="#FFFFF3DD"
|
<GradientStop Color="#FFFFF3DD"
|
||||||
Offset="0.259" />
|
Offset="0.259" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
|
|
||||||
|
|
||||||
<Style TargetType="{x:Type ContextMenu}">
|
<Style TargetType="{x:Type ContextMenu}">
|
||||||
<Setter Property="BorderThickness"
|
<Setter Property="BorderThickness"
|
||||||
Value="1,1,1,1" />
|
Value="1,1,1,1" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="{x:Type ContextMenu}">
|
<ControlTemplate TargetType="{x:Type ContextMenu}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Border Background="{DynamicResource MenuBackground}"
|
<Border Background="{DynamicResource MenuBackground}"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}">
|
BorderThickness="{TemplateBinding BorderThickness}">
|
||||||
<ScrollViewer
|
<ScrollViewer
|
||||||
Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}"
|
Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}"
|
||||||
Uid="ScrollViewer_9"
|
Uid="ScrollViewer_9"
|
||||||
CanContentScroll="True">
|
CanContentScroll="True">
|
||||||
<ItemsPresenter Margin="{TemplateBinding Padding}"
|
<ItemsPresenter Margin="{TemplateBinding Padding}"
|
||||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||||
KeyboardNavigation.DirectionalNavigation="Cycle" />
|
KeyboardNavigation.DirectionalNavigation="Cycle" />
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
|
||||||
<!-- 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 -->
|
||||||
<!--
|
<!--
|
||||||
The "shared" directive is needed if we reopen the sample window a few times - WPF will otherwise
|
The "shared" directive is needed if we reopen the sample window a few times - WPF will otherwise
|
||||||
reuse the same context menu (which is a resource) again (which will have its DataContext set to the old TaskbarIcon)
|
reuse the same context menu (which is a resource) again (which will have its DataContext set to the old TaskbarIcon)
|
||||||
-->
|
-->
|
||||||
<ContextMenu x:Shared="false"
|
<ContextMenu x:Shared="false"
|
||||||
x:Key="tbMenu">
|
x:Key="tbMenu">
|
||||||
<MenuItem IsEnabled="False"
|
<MenuItem IsEnabled="False"
|
||||||
Header="{Binding Path=ToolTipText}">
|
Header="{Binding Path=ToolTipText}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16"
|
<Image Width="16"
|
||||||
Height="16"
|
Height="16"
|
||||||
Source="{Binding Path=IconSource}" />
|
Source="{Binding Path=IconSource}" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</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"
|
||||||
Height="16"
|
Height="16"
|
||||||
Source="/Images/Add.png" />
|
Source="/Images/Add.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
|
||||||
<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"
|
||||||
Height="16"
|
Height="16"
|
||||||
Source="/Images/Remove.png" />
|
Source="/Images/Remove.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
|
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,92 +1,92 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls.Primitives;
|
using System.Windows.Controls.Primitives;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using Hardcodet.Wpf.TaskbarNotification;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
|
|
||||||
namespace Samples
|
namespace Samples
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for ShowcaseWindow.xaml
|
/// Interaction logic for ShowcaseWindow.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ShowcaseWindow : Window
|
public partial class ShowcaseWindow : Window
|
||||||
{
|
{
|
||||||
public ShowcaseWindow()
|
public ShowcaseWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
|
||||||
Loaded += delegate
|
Loaded += delegate
|
||||||
{
|
{
|
||||||
//show balloon at startup
|
//show balloon at startup
|
||||||
var balloon = new WelcomeBalloon();
|
var balloon = new WelcomeBalloon();
|
||||||
tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 12000);
|
tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 12000);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Displays a balloon tip.
|
/// Displays a balloon tip.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void showBalloonTip_Click(object sender, RoutedEventArgs e)
|
private void showBalloonTip_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
string title = txtBalloonTitle.Text;
|
string title = txtBalloonTitle.Text;
|
||||||
string message = txtBalloonText.Text;
|
string message = txtBalloonText.Text;
|
||||||
|
|
||||||
if (rbCustomIcon.IsChecked == true)
|
if (rbCustomIcon.IsChecked == true)
|
||||||
{
|
{
|
||||||
//just display the icon on the tray
|
//just display the icon on the tray
|
||||||
var icon = tb.Icon;
|
var icon = tb.Icon;
|
||||||
tb.ShowBalloonTip(title, message, icon);
|
tb.ShowBalloonTip(title, message, icon);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BalloonIcon bi = rbInfo.IsChecked == true ? BalloonIcon.Info : BalloonIcon.Error;
|
BalloonIcon bi = rbInfo.IsChecked == true ? BalloonIcon.Info : BalloonIcon.Error;
|
||||||
tb.ShowBalloonTip(title, message, bi);
|
tb.ShowBalloonTip(title, message, bi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void hideBalloonTip_Click(object sender, RoutedEventArgs e)
|
private void hideBalloonTip_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
tb.HideBalloonTip();
|
tb.HideBalloonTip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Resets the tooltip.
|
/// Resets the tooltip.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void removeToolTip_Click(object sender, RoutedEventArgs e)
|
private void removeToolTip_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
tb.TrayToolTip = null;
|
tb.TrayToolTip = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void showCustomBalloon_Click(object sender, RoutedEventArgs e)
|
private void showCustomBalloon_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
FancyBalloon balloon = new FancyBalloon();
|
FancyBalloon balloon = new FancyBalloon();
|
||||||
balloon.BalloonText = customBalloonTitle.Text;
|
balloon.BalloonText = customBalloonTitle.Text;
|
||||||
//show and close after 2.5 seconds
|
//show and close after 2.5 seconds
|
||||||
tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000);
|
tb.ShowCustomBalloon(balloon, PopupAnimation.Slide, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void hideCustomBalloon_Click(object sender, RoutedEventArgs e)
|
private void hideCustomBalloon_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
tb.CloseBalloon();
|
tb.CloseBalloon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void OnNavigationRequest(object sender, RequestNavigateEventArgs e)
|
private void OnNavigationRequest(object sender, RequestNavigateEventArgs e)
|
||||||
{
|
{
|
||||||
Process.Start(e.Uri.ToString());
|
Process.Start(e.Uri.ToString());
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
//clean up notifyicon (would otherwise stay open until application finishes)
|
//clean up notifyicon (would otherwise stay open until application finishes)
|
||||||
tb.Dispose();
|
tb.Dispose();
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,105 +1,105 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
x:Class="Samples.WelcomeBalloon"
|
x:Class="Samples.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"
|
||||||
Height="130"
|
Height="130"
|
||||||
Width="283"
|
Width="283"
|
||||||
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:Name="me">
|
x:Name="me">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<Storyboard
|
<Storyboard
|
||||||
x:Key="FadeInAndOut">
|
x:Key="FadeInAndOut">
|
||||||
<DoubleAnimationUsingKeyFrames
|
<DoubleAnimationUsingKeyFrames
|
||||||
BeginTime="00:00:00"
|
BeginTime="00:00:00"
|
||||||
Storyboard.TargetName="grid"
|
Storyboard.TargetName="grid"
|
||||||
Storyboard.TargetProperty="(UIElement.Opacity)">
|
Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:00"
|
KeyTime="00:00:00"
|
||||||
Value="0" />
|
Value="0" />
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:01"
|
KeyTime="00:00:01"
|
||||||
Value="0.895" />
|
Value="0.895" />
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:10"
|
KeyTime="00:00:10"
|
||||||
Value="0.895" />
|
Value="0.895" />
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:11.6000000"
|
KeyTime="00:00:11.6000000"
|
||||||
Value="0" />
|
Value="0" />
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<UserControl.Triggers>
|
<UserControl.Triggers>
|
||||||
<EventTrigger
|
<EventTrigger
|
||||||
RoutedEvent="tb:TaskbarIcon.BalloonShowing">
|
RoutedEvent="tb:TaskbarIcon.BalloonShowing">
|
||||||
<BeginStoryboard
|
<BeginStoryboard
|
||||||
Storyboard="{StaticResource FadeInAndOut}"
|
Storyboard="{StaticResource FadeInAndOut}"
|
||||||
x:Name="FadeInAndOut_BeginStoryboard" />
|
x:Name="FadeInAndOut_BeginStoryboard" />
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
</UserControl.Triggers>
|
</UserControl.Triggers>
|
||||||
<Grid
|
<Grid
|
||||||
x:Name="grid">
|
x:Name="grid">
|
||||||
|
|
||||||
<Border
|
<Border
|
||||||
x:Name="border"
|
x:Name="border"
|
||||||
CornerRadius="10,10,10,10"
|
CornerRadius="10,10,10,10"
|
||||||
Margin="0,0,5,5">
|
Margin="0,0,5,5">
|
||||||
<Border.Background>
|
<Border.Background>
|
||||||
<LinearGradientBrush
|
<LinearGradientBrush
|
||||||
EndPoint="0.5,1"
|
EndPoint="0.5,1"
|
||||||
StartPoint="0.5,0">
|
StartPoint="0.5,0">
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFEEEEEE"
|
Color="#FFEEEEEE"
|
||||||
Offset="1" />
|
Offset="1" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFB6B42"
|
Color="#FFFB6B42"
|
||||||
Offset="0" />
|
Offset="0" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Border.Background>
|
</Border.Background>
|
||||||
<Border.Effect>
|
<Border.Effect>
|
||||||
<DropShadowEffect />
|
<DropShadowEffect />
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
</Border>
|
</Border>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="10,10,15,0"
|
Margin="10,10,15,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
FontSize="14"
|
FontSize="14"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
HorizontalAlignment="Center">
|
HorizontalAlignment="Center">
|
||||||
<Run
|
<Run
|
||||||
Text="WPF NotifyIcon - Sample Application"
|
Text="WPF NotifyIcon - Sample Application"
|
||||||
Language="de-ch" />
|
Language="de-ch" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="10,38.62,10,0"
|
Margin="10,38.62,10,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
HorizontalAlignment="Left">
|
HorizontalAlignment="Left">
|
||||||
<Run
|
<Run
|
||||||
Text="You should see this icon in your system tray:" />
|
Text="You should see this icon in your system tray:" />
|
||||||
<Run
|
<Run
|
||||||
Text=" " />
|
Text=" " />
|
||||||
<InlineUIContainer>
|
<InlineUIContainer>
|
||||||
<Image
|
<Image
|
||||||
Source="{Binding Path=IconSource}"
|
Source="{Binding Path=IconSource}"
|
||||||
Width="16"
|
Width="16"
|
||||||
Height="16" />
|
Height="16" />
|
||||||
</InlineUIContainer>
|
</InlineUIContainer>
|
||||||
<LineBreak />
|
<LineBreak />
|
||||||
<Run
|
<Run
|
||||||
Text="This is your NotifyIcon." />
|
Text="This is your NotifyIcon." />
|
||||||
<LineBreak />
|
<LineBreak />
|
||||||
<Run
|
<Run
|
||||||
Text="" />
|
Text="" />
|
||||||
<LineBreak />
|
<LineBreak />
|
||||||
<Run
|
<Run
|
||||||
FontSize="10"
|
FontSize="10"
|
||||||
FontStyle="Italic"
|
FontStyle="Italic"
|
||||||
Text="You can change the displayed icon by selecting another image in the sample window." />
|
Text="You can change the displayed icon by selecting another image in the sample window." />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,27 +1,27 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
namespace Samples
|
namespace Samples
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for WelcomeBalloon.xaml
|
/// Interaction logic for WelcomeBalloon.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class WelcomeBalloon : UserControl
|
public partial class WelcomeBalloon : UserControl
|
||||||
{
|
{
|
||||||
public WelcomeBalloon()
|
public WelcomeBalloon()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
<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">
|
||||||
|
|
||||||
<!-- Globally declared notify icon (ResourceDictionary is not in use, example only) -->
|
<!-- Globally declared notify icon (ResourceDictionary is not in use, example only) -->
|
||||||
<tb:TaskbarIcon x:Key="MyNotifyIcon"
|
<tb:TaskbarIcon x:Key="MyNotifyIcon"
|
||||||
IconSource="/Icons/Error.ico"
|
IconSource="/Icons/Error.ico"
|
||||||
ToolTipText="hello world" />
|
ToolTipText="hello world" />
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Tutorials.SimpleWindowWithNotifyIcon"
|
x:Class="Samples.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"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="300">
|
Width="300">
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|
||||||
<!-- in order to declare a NotifyIcon, all you need is the namespace declaration (see above on line 5) and a single line -->
|
<!-- in order to declare a NotifyIcon, all you need is the namespace declaration (see above on line 5) and a single line -->
|
||||||
<tb:TaskbarIcon x:Name="MyNotifyIcon" IconSource="/Icons/Error.ico" ToolTipText="hello world" />
|
<tb:TaskbarIcon x:Name="MyNotifyIcon" IconSource="/Icons/Error.ico" ToolTipText="hello world" />
|
||||||
|
|
||||||
<TextBlock Margin="26,26,24,0"
|
<TextBlock Margin="26,26,24,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Text="You should see an icon in the tray." />
|
Text="You should see an icon in the tray." />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples.Tutorials
|
namespace Samples.Tutorials
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for SimpleWindowWithNotifyIcon.xaml
|
/// Interaction logic for SimpleWindowWithNotifyIcon.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class SimpleWindowWithNotifyIcon : Window
|
public partial class SimpleWindowWithNotifyIcon : Window
|
||||||
{
|
{
|
||||||
public SimpleWindowWithNotifyIcon()
|
public SimpleWindowWithNotifyIcon()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
//clean up notifyicon (would otherwise stay open until application finishes)
|
//clean up notifyicon (would otherwise stay open until application finishes)
|
||||||
MyNotifyIcon.Dispose();
|
MyNotifyIcon.Dispose();
|
||||||
|
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,41 +1,41 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Tutorials.ToolTips.InlineToolTipWindow"
|
x:Class="Samples.Tutorials.ToolTips.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"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="300">
|
Width="300">
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|
||||||
<tb:TaskbarIcon
|
<tb:TaskbarIcon
|
||||||
x:Name="MyNotifyIcon"
|
x:Name="MyNotifyIcon"
|
||||||
IconSource="/Icons/Error.ico"
|
IconSource="/Icons/Error.ico"
|
||||||
ToolTipText="hello world">
|
ToolTipText="hello world">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
We can use arbitrary UI elements as ToolTips.
|
We can use arbitrary UI elements as ToolTips.
|
||||||
Let's use a semi-transparent border.
|
Let's use a semi-transparent border.
|
||||||
-->
|
-->
|
||||||
<tb:TaskbarIcon.TrayToolTip>
|
<tb:TaskbarIcon.TrayToolTip>
|
||||||
<Border
|
<Border
|
||||||
Background="White"
|
Background="White"
|
||||||
BorderBrush="Orange"
|
BorderBrush="Orange"
|
||||||
BorderThickness="2"
|
BorderThickness="2"
|
||||||
CornerRadius="4"
|
CornerRadius="4"
|
||||||
Opacity="0.8"
|
Opacity="0.8"
|
||||||
Width="160"
|
Width="160"
|
||||||
Height="40">
|
Height="40">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Text="hello world"
|
Text="hello world"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
</Border>
|
</Border>
|
||||||
</tb:TaskbarIcon.TrayToolTip>
|
</tb:TaskbarIcon.TrayToolTip>
|
||||||
|
|
||||||
</tb:TaskbarIcon>
|
</tb:TaskbarIcon>
|
||||||
<TextBlock Margin="26,26,24,0" VerticalAlignment="Top" FontWeight="Bold" TextWrapping="Wrap">
|
<TextBlock Margin="26,26,24,0" VerticalAlignment="Top" FontWeight="Bold" TextWrapping="Wrap">
|
||||||
<Run Text="Move mouse over NotifyIcon to show ToolTip" Language="de-ch" />
|
<Run Text="Move mouse over NotifyIcon to show ToolTip" Language="de-ch" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -1,34 +1,34 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
namespace Samples.Tutorials.ToolTips
|
namespace Samples.Tutorials.ToolTips
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for Window1.xaml
|
/// Interaction logic for Window1.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class InlineToolTipWindow : Window
|
public partial class InlineToolTipWindow : Window
|
||||||
{
|
{
|
||||||
public InlineToolTipWindow()
|
public InlineToolTipWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
//clean up notifyicon (would otherwise stay open until application finishes)
|
//clean up notifyicon (would otherwise stay open until application finishes)
|
||||||
MyNotifyIcon.Dispose();
|
MyNotifyIcon.Dispose();
|
||||||
|
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,21 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
x:Class="Samples.Tutorials.ToolTips.SimpleUserControl"
|
x:Class="Samples.Tutorials.ToolTips.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">
|
||||||
|
|
||||||
<!-- a simple user control which displays a fixed text within a border -->
|
<!-- a simple user control which displays a fixed text within a border -->
|
||||||
<Border
|
<Border
|
||||||
Background="White"
|
Background="White"
|
||||||
BorderBrush="Orange"
|
BorderBrush="Orange"
|
||||||
BorderThickness="2"
|
BorderThickness="2"
|
||||||
CornerRadius="4"
|
CornerRadius="4"
|
||||||
Opacity="0.8"
|
Opacity="0.8"
|
||||||
Width="160"
|
Width="160"
|
||||||
Height="40">
|
Height="40">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Text="hello world"
|
Text="hello world"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,27 +1,27 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
namespace Samples.Tutorials.ToolTips
|
namespace Samples.Tutorials.ToolTips
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for SimpleUserControl.xaml
|
/// Interaction logic for SimpleUserControl.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class SimpleUserControl : UserControl
|
public partial class SimpleUserControl : UserControl
|
||||||
{
|
{
|
||||||
public SimpleUserControl()
|
public SimpleUserControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,27 +1,27 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Tutorials.ToolTips.UserControlToolTipWindow"
|
x:Class="Samples.Tutorials.ToolTips.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:local="clr-namespace:Samples.Tutorials.ToolTips"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="300">
|
Width="300">
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|
||||||
<tb:TaskbarIcon
|
<tb:TaskbarIcon
|
||||||
x:Name="MyNotifyIcon"
|
x:Name="MyNotifyIcon"
|
||||||
IconSource="/Icons/Error.ico"
|
IconSource="/Icons/Error.ico"
|
||||||
ToolTipText="hello world">
|
ToolTipText="hello world">
|
||||||
|
|
||||||
<!-- assign user control as ToolTip -->
|
<!-- assign user control as ToolTip -->
|
||||||
<tb:TaskbarIcon.TrayToolTip>
|
<tb:TaskbarIcon.TrayToolTip>
|
||||||
<local:SimpleUserControl />
|
<local:SimpleUserControl />
|
||||||
</tb:TaskbarIcon.TrayToolTip>
|
</tb:TaskbarIcon.TrayToolTip>
|
||||||
|
|
||||||
</tb:TaskbarIcon>
|
</tb:TaskbarIcon>
|
||||||
<TextBlock Margin="26,26,24,0" VerticalAlignment="Top" FontWeight="Bold" TextWrapping="Wrap">
|
<TextBlock Margin="26,26,24,0" VerticalAlignment="Top" FontWeight="Bold" TextWrapping="Wrap">
|
||||||
<Run Text="Move mouse over NotifyIcon to show ToolTip" Language="de-ch" />
|
<Run Text="Move mouse over NotifyIcon to show ToolTip" Language="de-ch" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -1,34 +1,34 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
namespace Samples.Tutorials.ToolTips
|
namespace Samples.Tutorials.ToolTips
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for UserControlToolTipWindow.xaml
|
/// Interaction logic for UserControlToolTipWindow.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class UserControlToolTipWindow : Window
|
public partial class UserControlToolTipWindow : Window
|
||||||
{
|
{
|
||||||
public UserControlToolTipWindow()
|
public UserControlToolTipWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
//clean up notifyicon (would otherwise stay open until application finishes)
|
//clean up notifyicon (would otherwise stay open until application finishes)
|
||||||
MyNotifyIcon.Dispose();
|
MyNotifyIcon.Dispose();
|
||||||
|
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,61 +1,61 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Tutorials.Popups.InlinePopupWindow"
|
x:Class="Samples.Tutorials.Popups.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:Samples.Commands"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="300">
|
Width="300">
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|
||||||
<tb:TaskbarIcon
|
<tb:TaskbarIcon
|
||||||
x:Name="MyNotifyIcon"
|
x:Name="MyNotifyIcon"
|
||||||
IconSource="/Icons/Error.ico"
|
IconSource="/Icons/Error.ico"
|
||||||
ToolTipText="hello world">
|
ToolTipText="hello world">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
We can use arbitrary UI elements as Popups.
|
We can use arbitrary UI elements as Popups.
|
||||||
Popups stay open if the user moves away from the tray area
|
Popups stay open if the user moves away from the tray area
|
||||||
-->
|
-->
|
||||||
<tb:TaskbarIcon.TrayPopup>
|
<tb:TaskbarIcon.TrayPopup>
|
||||||
<Border
|
<Border
|
||||||
Background="White"
|
Background="White"
|
||||||
BorderBrush="Orange"
|
BorderBrush="Orange"
|
||||||
BorderThickness="2"
|
BorderThickness="2"
|
||||||
CornerRadius="4"
|
CornerRadius="4"
|
||||||
Width="160">
|
Width="160">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="popupText"
|
x:Name="popupText"
|
||||||
Margin="5,10,5,10"
|
Margin="5,10,5,10"
|
||||||
Width="200"
|
Width="200"
|
||||||
Height="24"
|
Height="24"
|
||||||
Text="Enter Text..." />
|
Text="Enter Text..." />
|
||||||
<Button
|
<Button
|
||||||
Content="Click Me!"
|
Content="Click Me!"
|
||||||
Command="{commands:CloseWindowCommand}"
|
Command="{commands:CloseWindowCommand}"
|
||||||
CommandParameter="{Binding}"
|
CommandParameter="{Binding}"
|
||||||
Margin="5,0,5,10"
|
Margin="5,0,5,10"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</tb:TaskbarIcon.TrayPopup>
|
</tb:TaskbarIcon.TrayPopup>
|
||||||
|
|
||||||
</tb:TaskbarIcon>
|
</tb:TaskbarIcon>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="26,26,24,0"
|
Margin="26,26,24,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Text="Left-Click NotifyIcon to open popup." />
|
Text="Left-Click NotifyIcon to open popup." />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Text="Text on Popup: "
|
Text="Text on Popup: "
|
||||||
Margin="26,66,24,0"
|
Margin="26,66,24,0"
|
||||||
VerticalAlignment="Top">
|
VerticalAlignment="Top">
|
||||||
<TextBlock Foreground="Red"
|
<TextBlock Foreground="Red"
|
||||||
Text="{Binding ElementName=popupText, Path=Text}" />
|
Text="{Binding ElementName=popupText, Path=Text}" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -1,34 +1,34 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
namespace Samples.Tutorials.Popups
|
namespace Samples.Tutorials.Popups
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for InlinePopupWindow.xaml
|
/// Interaction logic for InlinePopupWindow.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class InlinePopupWindow : Window
|
public partial class InlinePopupWindow : Window
|
||||||
{
|
{
|
||||||
public InlinePopupWindow()
|
public InlinePopupWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
//clean up notifyicon (would otherwise stay open until application finishes)
|
//clean up notifyicon (would otherwise stay open until application finishes)
|
||||||
MyNotifyIcon.Dispose();
|
MyNotifyIcon.Dispose();
|
||||||
|
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,81 +1,81 @@
|
|||||||
<Window x:Class="Samples.Tutorials.ContextMenus.InlineContextMenuWindow"
|
<Window x:Class="Samples.Tutorials.ContextMenus.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:Samples.Commands"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="300">
|
Width="300">
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|
||||||
<tb:TaskbarIcon x:Name="MyNotifyIcon"
|
<tb:TaskbarIcon x:Name="MyNotifyIcon"
|
||||||
IconSource="/Icons/Error.ico"
|
IconSource="/Icons/Error.ico"
|
||||||
ToolTipText="hello world"
|
ToolTipText="hello world"
|
||||||
TrayContextMenuOpen="MyNotifyIcon_TrayContextMenuOpen"
|
TrayContextMenuOpen="MyNotifyIcon_TrayContextMenuOpen"
|
||||||
PreviewTrayContextMenuOpen="MyNotifyIcon_PreviewTrayContextMenuOpen">
|
PreviewTrayContextMenuOpen="MyNotifyIcon_PreviewTrayContextMenuOpen">
|
||||||
|
|
||||||
<!-- Set a simple context menu -->
|
<!-- Set a simple context menu -->
|
||||||
<!-- the data context of the context menu is the NotifyIcon itself (see more about this in DataBinding samples) -->
|
<!-- the data context of the context menu is the NotifyIcon itself (see more about this in DataBinding samples) -->
|
||||||
<tb:TaskbarIcon.ContextMenu>
|
<tb:TaskbarIcon.ContextMenu>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
<TextBlock Text="Hiding the sample window will not close it!" />
|
<TextBlock Text="Hiding the sample window will not close it!" />
|
||||||
<MenuItem Header="_Show Sample Window [S]"
|
<MenuItem Header="_Show Sample Window [S]"
|
||||||
Command="{commands:ShowSampleWindowCommand}"
|
Command="{commands:ShowSampleWindowCommand}"
|
||||||
CommandParameter="{Binding}">
|
CommandParameter="{Binding}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16"
|
<Image Width="16"
|
||||||
Height="16"
|
Height="16"
|
||||||
Source="/Images/Add.png" />
|
Source="/Images/Add.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
|
||||||
<Separator />
|
<Separator />
|
||||||
|
|
||||||
<MenuItem Header="_Hide Sample Window [H]"
|
<MenuItem Header="_Hide Sample Window [H]"
|
||||||
Command="{commands:HideSampleWindowCommand}"
|
Command="{commands:HideSampleWindowCommand}"
|
||||||
CommandParameter="{Binding}">
|
CommandParameter="{Binding}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16"
|
<Image Width="16"
|
||||||
Height="16"
|
Height="16"
|
||||||
Source="/Images/Remove.png" />
|
Source="/Images/Remove.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</tb:TaskbarIcon.ContextMenu>
|
</tb:TaskbarIcon.ContextMenu>
|
||||||
|
|
||||||
</tb:TaskbarIcon>
|
</tb:TaskbarIcon>
|
||||||
<TextBlock Margin="26,26,24,0"
|
<TextBlock Margin="26,26,24,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
TextWrapping="Wrap">
|
TextWrapping="Wrap">
|
||||||
<Run Language="de-ch"
|
<Run Language="de-ch"
|
||||||
Text="Right-click on NotifyIcon to open Context Menu" />
|
Text="Right-click on NotifyIcon to open Context Menu" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock HorizontalAlignment="Left"
|
<TextBlock HorizontalAlignment="Left"
|
||||||
Margin="26,83,0,0"
|
Margin="26,83,0,0"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Text="Context menu preview open events:"
|
Text="Context menu preview open events:"
|
||||||
VerticalAlignment="Top" />
|
VerticalAlignment="Top" />
|
||||||
<TextBlock HorizontalAlignment="Left"
|
<TextBlock HorizontalAlignment="Left"
|
||||||
Margin="26,103.96,0,0"
|
Margin="26,103.96,0,0"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Text="Context menu open events:"
|
Text="Context menu open events:"
|
||||||
VerticalAlignment="Top" />
|
VerticalAlignment="Top" />
|
||||||
<TextBlock x:Name="PreviewOpenEventCounter"
|
<TextBlock x:Name="PreviewOpenEventCounter"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="246,83,0,0"
|
Margin="246,83,0,0"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Text="0"
|
Text="0"
|
||||||
VerticalAlignment="Top" />
|
VerticalAlignment="Top" />
|
||||||
<TextBlock x:Name="OpenEventCounter"
|
<TextBlock x:Name="OpenEventCounter"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="246,106.97,0,0"
|
Margin="246,106.97,0,0"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Text="0"
|
Text="0"
|
||||||
VerticalAlignment="Top" />
|
VerticalAlignment="Top" />
|
||||||
<CheckBox x:Name="SuppressContextMenu"
|
<CheckBox x:Name="SuppressContextMenu"
|
||||||
Content="Suppress context menu in preview event"
|
Content="Suppress context menu in preview event"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="26,190,0,0"
|
Margin="26,190,0,0"
|
||||||
VerticalAlignment="Top" />
|
VerticalAlignment="Top" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -1,40 +1,40 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Samples.Tutorials.ContextMenus
|
namespace Samples.Tutorials.ContextMenus
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for InlineContextMenuWindow.xaml
|
/// Interaction logic for InlineContextMenuWindow.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class InlineContextMenuWindow : Window
|
public partial class InlineContextMenuWindow : Window
|
||||||
{
|
{
|
||||||
public InlineContextMenuWindow()
|
public InlineContextMenuWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
//clean up notifyicon (would otherwise stay open until application finishes)
|
//clean up notifyicon (would otherwise stay open until application finishes)
|
||||||
MyNotifyIcon.Dispose();
|
MyNotifyIcon.Dispose();
|
||||||
|
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MyNotifyIcon_TrayContextMenuOpen(object sender, System.Windows.RoutedEventArgs e)
|
private void MyNotifyIcon_TrayContextMenuOpen(object sender, System.Windows.RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
OpenEventCounter.Text = (int.Parse(OpenEventCounter.Text) + 1).ToString();
|
OpenEventCounter.Text = (int.Parse(OpenEventCounter.Text) + 1).ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MyNotifyIcon_PreviewTrayContextMenuOpen(object sender, System.Windows.RoutedEventArgs e)
|
private void MyNotifyIcon_PreviewTrayContextMenuOpen(object sender, System.Windows.RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
//marking the event as handled suppresses the context menu
|
//marking the event as handled suppresses the context menu
|
||||||
e.Handled = (bool) SuppressContextMenu.IsChecked;
|
e.Handled = (bool) SuppressContextMenu.IsChecked;
|
||||||
|
|
||||||
PreviewOpenEventCounter.Text = (int.Parse(PreviewOpenEventCounter.Text) + 1).ToString();
|
PreviewOpenEventCounter.Text = (int.Parse(PreviewOpenEventCounter.Text) + 1).ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,51 +1,51 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Tutorials.Balloons.BalloonSampleWindow"
|
x:Class="Samples.Tutorials.Balloons.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"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="300">
|
Width="300">
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|
||||||
<!-- the ToolTipText property is bound to the TextBox below -->
|
<!-- the ToolTipText property is bound to the TextBox below -->
|
||||||
<tb:TaskbarIcon
|
<tb:TaskbarIcon
|
||||||
x:Name="MyNotifyIcon"
|
x:Name="MyNotifyIcon"
|
||||||
IconSource="/Icons/Error.ico"
|
IconSource="/Icons/Error.ico"
|
||||||
ToolTipText="Balloon Sample Icon" />
|
ToolTipText="Balloon Sample Icon" />
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnShowStandardBalloon"
|
x:Name="btnShowStandardBalloon"
|
||||||
Click="btnShowStandardBalloon_Click"
|
Click="btnShowStandardBalloon_Click"
|
||||||
Margin="26,74,29,0"
|
Margin="26,74,29,0"
|
||||||
Content="Show Standard Balloon" Height="29" VerticalAlignment="Top" />
|
Content="Show Standard Balloon" Height="29" VerticalAlignment="Top" />
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnShowCustomBalloon"
|
x:Name="btnShowCustomBalloon"
|
||||||
Click="btnShowCustomBalloon_Click"
|
Click="btnShowCustomBalloon_Click"
|
||||||
Margin="26,0,29,49"
|
Margin="26,0,29,49"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Height="27"
|
Height="27"
|
||||||
Content="Show Custom Balloon" />
|
Content="Show Custom Balloon" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="26,26,24,0"
|
Margin="26,26,24,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
TextWrapping="Wrap">
|
TextWrapping="Wrap">
|
||||||
<Run
|
<Run
|
||||||
Language="de-ch"
|
Language="de-ch"
|
||||||
Text="Clicking on buttons shows balloon tips" />
|
Text="Clicking on buttons shows balloon tips" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnHideStandardBalloon"
|
x:Name="btnHideStandardBalloon"
|
||||||
Click="btnHideStandardBalloon_Click"
|
Click="btnHideStandardBalloon_Click"
|
||||||
Margin="26,113,29,122"
|
Margin="26,113,29,122"
|
||||||
Content="Hide Standard Balloon" />
|
Content="Hide Standard Balloon" />
|
||||||
<Button
|
<Button
|
||||||
x:Name="btnCloseCustomBalloon"
|
x:Name="btnCloseCustomBalloon"
|
||||||
Click="btnCloseCustomBalloon_Click"
|
Click="btnCloseCustomBalloon_Click"
|
||||||
Margin="26,0,29,12"
|
Margin="26,0,29,12"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Height="27"
|
Height="27"
|
||||||
Content="Close Custom Balloon" />
|
Content="Close Custom Balloon" />
|
||||||
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -1,65 +1,65 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Controls.Primitives;
|
using System.Windows.Controls.Primitives;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using Hardcodet.Wpf.TaskbarNotification;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
|
|
||||||
namespace Samples.Tutorials.Balloons
|
namespace Samples.Tutorials.Balloons
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for BalloonSampleWindow.xaml
|
/// Interaction logic for BalloonSampleWindow.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class BalloonSampleWindow : Window
|
public partial class BalloonSampleWindow : Window
|
||||||
{
|
{
|
||||||
public BalloonSampleWindow()
|
public BalloonSampleWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
//clean up notifyicon (would otherwise stay open until application finishes)
|
//clean up notifyicon (would otherwise stay open until application finishes)
|
||||||
MyNotifyIcon.Dispose();
|
MyNotifyIcon.Dispose();
|
||||||
|
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void btnShowCustomBalloon_Click(object sender, RoutedEventArgs e)
|
private void btnShowCustomBalloon_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
FancyBalloon balloon = new FancyBalloon();
|
FancyBalloon balloon = new FancyBalloon();
|
||||||
balloon.BalloonText = "Custom Balloon";
|
balloon.BalloonText = "Custom Balloon";
|
||||||
|
|
||||||
//show balloon and close it after 4 seconds
|
//show balloon and close it after 4 seconds
|
||||||
MyNotifyIcon.ShowCustomBalloon(balloon, PopupAnimation.Slide, 4000);
|
MyNotifyIcon.ShowCustomBalloon(balloon, PopupAnimation.Slide, 4000);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnHideStandardBalloon_Click(object sender, RoutedEventArgs e)
|
private void btnHideStandardBalloon_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
MyNotifyIcon.HideBalloonTip();
|
MyNotifyIcon.HideBalloonTip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void btnShowStandardBalloon_Click(object sender, RoutedEventArgs e)
|
private void btnShowStandardBalloon_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
string title = "WPF NotifyIcon";
|
string title = "WPF NotifyIcon";
|
||||||
string text = "This is a standard balloon";
|
string text = "This is a standard balloon";
|
||||||
|
|
||||||
MyNotifyIcon.ShowBalloonTip(title, text, MyNotifyIcon.Icon);
|
MyNotifyIcon.ShowBalloonTip(title, text, MyNotifyIcon.Icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnCloseCustomBalloon_Click(object sender, RoutedEventArgs e)
|
private void btnCloseCustomBalloon_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
MyNotifyIcon.CloseBalloon();
|
MyNotifyIcon.CloseBalloon();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,64 +1,64 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Tutorials.Commands.CommandWindow"
|
x:Class="Samples.Tutorials.Commands.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"
|
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"
|
||||||
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
|
<local:ShowMessageCommand
|
||||||
x:Key="MessageCommand" />
|
x:Key="MessageCommand" />
|
||||||
</Grid.Resources>
|
</Grid.Resources>
|
||||||
|
|
||||||
<!-- declare the NotifyIcon and configure commands with parameters -->
|
<!-- declare the NotifyIcon and configure commands with parameters -->
|
||||||
<tb:TaskbarIcon
|
<tb:TaskbarIcon
|
||||||
x:Name="CustomCommandNotifyIcon"
|
x:Name="CustomCommandNotifyIcon"
|
||||||
IconSource="/Icons/Error.ico"
|
IconSource="/Icons/Error.ico"
|
||||||
LeftClickCommand="{StaticResource MessageCommand}"
|
LeftClickCommand="{StaticResource MessageCommand}"
|
||||||
LeftClickCommandParameter="Left mouse button was clicked"
|
LeftClickCommandParameter="Left mouse button was clicked"
|
||||||
DoubleClickCommand="{StaticResource MessageCommand}"
|
DoubleClickCommand="{StaticResource MessageCommand}"
|
||||||
DoubleClickCommandParameter="Double click on NotifyIcon" />
|
DoubleClickCommandParameter="Double click on NotifyIcon" />
|
||||||
|
|
||||||
<!-- declare the NotifyIcon and configure commands with targets -->
|
<!-- declare the NotifyIcon and configure commands with targets -->
|
||||||
<tb:TaskbarIcon
|
<tb:TaskbarIcon
|
||||||
x:Name="RoutedCommandNotifyIcon"
|
x:Name="RoutedCommandNotifyIcon"
|
||||||
IconSource="/Icons/Inactive.ico"
|
IconSource="/Icons/Inactive.ico"
|
||||||
LeftClickCommand="ApplicationCommands.Cut"
|
LeftClickCommand="ApplicationCommands.Cut"
|
||||||
LeftClickCommandTarget="{Binding ElementName=txtInput}"
|
LeftClickCommandTarget="{Binding ElementName=txtInput}"
|
||||||
DoubleClickCommand="ApplicationCommands.Paste"
|
DoubleClickCommand="ApplicationCommands.Paste"
|
||||||
DoubleClickCommandTarget="{Binding ElementName=txtInput}" />
|
DoubleClickCommandTarget="{Binding ElementName=txtInput}" />
|
||||||
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="26,26,24,0"
|
Margin="26,26,24,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
TextWrapping="Wrap">
|
TextWrapping="Wrap">
|
||||||
<Run
|
<Run
|
||||||
Language="de-ch"
|
Language="de-ch"
|
||||||
Text="Left / Double clicks on red NotifyIcon executes simple custom commands." />
|
Text="Left / Double clicks on red NotifyIcon executes simple custom commands." />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="26,112,24,80"
|
Margin="26,112,24,80"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
TextWrapping="Wrap">
|
TextWrapping="Wrap">
|
||||||
<Run Language="de-ch" Text="Left / Double clicks on grey NotifyIcon executes routed commands." />
|
<Run Language="de-ch" Text="Left / Double clicks on grey NotifyIcon executes routed commands." />
|
||||||
<LineBreak /><Run Language="de-ch" Text="Single click: Cuts selected text" /><LineBreak />
|
<LineBreak /><Run Language="de-ch" Text="Single click: Cuts selected text" /><LineBreak />
|
||||||
<Run Language="de-ch" Text="Double click: Paste text from clipboard" />
|
<Run Language="de-ch" Text="Double click: Paste text from clipboard" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBox
|
<TextBox
|
||||||
Margin="26,0,24,48"
|
Margin="26,0,24,48"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Height="22"
|
Height="22"
|
||||||
Text="hello world"
|
Text="hello world"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
x:Name="txtInput" />
|
x:Name="txtInput" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -1,36 +1,36 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
namespace Samples.Tutorials.Commands
|
namespace Samples.Tutorials.Commands
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for CommandWindow.xaml
|
/// Interaction logic for CommandWindow.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class CommandWindow : Window
|
public partial class CommandWindow : Window
|
||||||
{
|
{
|
||||||
public CommandWindow()
|
public CommandWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
//clean up notifyicon (would otherwise stay open until application finishes)
|
//clean up notifyicon (would otherwise stay open until application finishes)
|
||||||
CustomCommandNotifyIcon.Dispose();
|
CustomCommandNotifyIcon.Dispose();
|
||||||
RoutedCommandNotifyIcon.Dispose();
|
RoutedCommandNotifyIcon.Dispose();
|
||||||
|
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,25 +1,25 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Samples.Tutorials.Commands
|
namespace Samples.Tutorials.Commands
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A simple command that displays the command parameter as
|
/// A simple command that displays the command parameter as
|
||||||
/// a dialog message.
|
/// a dialog message.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ShowMessageCommand : ICommand
|
public class ShowMessageCommand : ICommand
|
||||||
{
|
{
|
||||||
public void Execute(object parameter)
|
public void Execute(object parameter)
|
||||||
{
|
{
|
||||||
MessageBox.Show(parameter.ToString());
|
MessageBox.Show(parameter.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanExecute(object parameter)
|
public bool CanExecute(object parameter)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public event EventHandler CanExecuteChanged;
|
public event EventHandler CanExecuteChanged;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,265 +1,265 @@
|
|||||||
<Window
|
<Window
|
||||||
x:Class="Samples.Tutorials.Events.EventVisualizerWindow"
|
x:Class="Samples.Tutorials.Events.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"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="300">
|
Width="300">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<Storyboard
|
<Storyboard
|
||||||
x:Key="ShowMovement"
|
x:Key="ShowMovement"
|
||||||
AutoReverse="True">
|
AutoReverse="True">
|
||||||
<DoubleAnimationUsingKeyFrames
|
<DoubleAnimationUsingKeyFrames
|
||||||
BeginTime="00:00:00"
|
BeginTime="00:00:00"
|
||||||
Storyboard.TargetName="MoveIndicator"
|
Storyboard.TargetName="MoveIndicator"
|
||||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
|
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:00"
|
KeyTime="00:00:00"
|
||||||
Value="1" />
|
Value="1" />
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:00.1000000"
|
KeyTime="00:00:00.1000000"
|
||||||
Value="1.2" />
|
Value="1.2" />
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
<DoubleAnimationUsingKeyFrames
|
<DoubleAnimationUsingKeyFrames
|
||||||
BeginTime="00:00:00"
|
BeginTime="00:00:00"
|
||||||
Storyboard.TargetName="MoveIndicator"
|
Storyboard.TargetName="MoveIndicator"
|
||||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
|
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:00"
|
KeyTime="00:00:00"
|
||||||
Value="1" />
|
Value="1" />
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:00.1000000"
|
KeyTime="00:00:00.1000000"
|
||||||
Value="1.2" />
|
Value="1.2" />
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
<Storyboard
|
<Storyboard
|
||||||
x:Key="ShowMouseUp"
|
x:Key="ShowMouseUp"
|
||||||
AutoReverse="True">
|
AutoReverse="True">
|
||||||
<DoubleAnimationUsingKeyFrames
|
<DoubleAnimationUsingKeyFrames
|
||||||
BeginTime="00:00:00"
|
BeginTime="00:00:00"
|
||||||
Storyboard.TargetName="LeftMouseIndicator"
|
Storyboard.TargetName="LeftMouseIndicator"
|
||||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
|
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:00"
|
KeyTime="00:00:00"
|
||||||
Value="1" />
|
Value="1" />
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:00.1000000"
|
KeyTime="00:00:00.1000000"
|
||||||
Value="1.35" />
|
Value="1.35" />
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
<DoubleAnimationUsingKeyFrames
|
<DoubleAnimationUsingKeyFrames
|
||||||
BeginTime="00:00:00"
|
BeginTime="00:00:00"
|
||||||
Storyboard.TargetName="LeftMouseIndicator"
|
Storyboard.TargetName="LeftMouseIndicator"
|
||||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
|
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:00"
|
KeyTime="00:00:00"
|
||||||
Value="1" />
|
Value="1" />
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:00.1000000"
|
KeyTime="00:00:00.1000000"
|
||||||
Value="1.35" />
|
Value="1.35" />
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
<Storyboard
|
<Storyboard
|
||||||
x:Key="ShowToolTipOpened"
|
x:Key="ShowToolTipOpened"
|
||||||
AutoReverse="True">
|
AutoReverse="True">
|
||||||
<DoubleAnimationUsingKeyFrames
|
<DoubleAnimationUsingKeyFrames
|
||||||
BeginTime="00:00:00"
|
BeginTime="00:00:00"
|
||||||
Storyboard.TargetName="ToolTipIndicator"
|
Storyboard.TargetName="ToolTipIndicator"
|
||||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
|
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:00"
|
KeyTime="00:00:00"
|
||||||
Value="1" />
|
Value="1" />
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:00.2000000"
|
KeyTime="00:00:00.2000000"
|
||||||
Value="1.4" />
|
Value="1.4" />
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
<DoubleAnimationUsingKeyFrames
|
<DoubleAnimationUsingKeyFrames
|
||||||
BeginTime="00:00:00"
|
BeginTime="00:00:00"
|
||||||
Storyboard.TargetName="ToolTipIndicator"
|
Storyboard.TargetName="ToolTipIndicator"
|
||||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
|
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:00"
|
KeyTime="00:00:00"
|
||||||
Value="1" />
|
Value="1" />
|
||||||
<SplineDoubleKeyFrame
|
<SplineDoubleKeyFrame
|
||||||
KeyTime="00:00:00.2000000"
|
KeyTime="00:00:00.2000000"
|
||||||
Value="1.4" />
|
Value="1.4" />
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<Window.Triggers>
|
<Window.Triggers>
|
||||||
<EventTrigger
|
<EventTrigger
|
||||||
RoutedEvent="tb:TaskbarIcon.TrayMouseMove"
|
RoutedEvent="tb:TaskbarIcon.TrayMouseMove"
|
||||||
SourceName="notifyIcon">
|
SourceName="notifyIcon">
|
||||||
<BeginStoryboard
|
<BeginStoryboard
|
||||||
Storyboard="{StaticResource ShowMovement}" />
|
Storyboard="{StaticResource ShowMovement}" />
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
<EventTrigger
|
<EventTrigger
|
||||||
RoutedEvent="tb:TaskbarIcon.TrayLeftMouseUp"
|
RoutedEvent="tb:TaskbarIcon.TrayLeftMouseUp"
|
||||||
SourceName="notifyIcon">
|
SourceName="notifyIcon">
|
||||||
<BeginStoryboard
|
<BeginStoryboard
|
||||||
Storyboard="{StaticResource ShowMouseUp}"
|
Storyboard="{StaticResource ShowMouseUp}"
|
||||||
x:Name="ShowMouseUp_BeginStoryboard" />
|
x:Name="ShowMouseUp_BeginStoryboard" />
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
<EventTrigger
|
<EventTrigger
|
||||||
RoutedEvent="tb:TaskbarIcon.TrayToolTipOpen"
|
RoutedEvent="tb:TaskbarIcon.TrayToolTipOpen"
|
||||||
SourceName="notifyIcon">
|
SourceName="notifyIcon">
|
||||||
<BeginStoryboard
|
<BeginStoryboard
|
||||||
Storyboard="{StaticResource ShowToolTipOpened}"
|
Storyboard="{StaticResource ShowToolTipOpened}"
|
||||||
x:Name="ShowToolTipOpened_BeginStoryboard" />
|
x:Name="ShowToolTipOpened_BeginStoryboard" />
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
</Window.Triggers>
|
</Window.Triggers>
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|
||||||
<!-- the NotifyIcon does not need to be configured here - animations were set up in Blend -->
|
<!-- the NotifyIcon does not need to be configured here - animations were set up in Blend -->
|
||||||
<tb:TaskbarIcon
|
<tb:TaskbarIcon
|
||||||
x:Name="notifyIcon"
|
x:Name="notifyIcon"
|
||||||
ToolTipText="hello world"
|
ToolTipText="hello world"
|
||||||
IconSource="/Icons/Error.ico" />
|
IconSource="/Icons/Error.ico" />
|
||||||
|
|
||||||
|
|
||||||
<Ellipse
|
<Ellipse
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="24,62,0,0"
|
Margin="24,62,0,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Width="19"
|
Width="19"
|
||||||
Height="19"
|
Height="19"
|
||||||
Stroke="#FF549D2D"
|
Stroke="#FF549D2D"
|
||||||
x:Name="MoveIndicator"
|
x:Name="MoveIndicator"
|
||||||
RenderTransformOrigin="0.5,0.5">
|
RenderTransformOrigin="0.5,0.5">
|
||||||
<Ellipse.RenderTransform>
|
<Ellipse.RenderTransform>
|
||||||
<TransformGroup>
|
<TransformGroup>
|
||||||
<ScaleTransform
|
<ScaleTransform
|
||||||
ScaleX="1"
|
ScaleX="1"
|
||||||
ScaleY="1" />
|
ScaleY="1" />
|
||||||
<SkewTransform
|
<SkewTransform
|
||||||
AngleX="0"
|
AngleX="0"
|
||||||
AngleY="0" />
|
AngleY="0" />
|
||||||
<RotateTransform
|
<RotateTransform
|
||||||
Angle="0" />
|
Angle="0" />
|
||||||
<TranslateTransform
|
<TranslateTransform
|
||||||
X="0"
|
X="0"
|
||||||
Y="0" />
|
Y="0" />
|
||||||
</TransformGroup>
|
</TransformGroup>
|
||||||
</Ellipse.RenderTransform>
|
</Ellipse.RenderTransform>
|
||||||
<Ellipse.Fill>
|
<Ellipse.Fill>
|
||||||
<LinearGradientBrush
|
<LinearGradientBrush
|
||||||
EndPoint="0.528,0.694"
|
EndPoint="0.528,0.694"
|
||||||
StartPoint="-0.056,-0.118">
|
StartPoint="-0.056,-0.118">
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFFFFFF"
|
Color="#FFFFFFFF"
|
||||||
Offset="0" />
|
Offset="0" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FF65A135"
|
Color="#FF65A135"
|
||||||
Offset="1" />
|
Offset="1" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Ellipse.Fill>
|
</Ellipse.Fill>
|
||||||
</Ellipse>
|
</Ellipse>
|
||||||
<Ellipse
|
<Ellipse
|
||||||
Stroke="#FF549D2D"
|
Stroke="#FF549D2D"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="24,106,0,0"
|
Margin="24,106,0,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Width="19"
|
Width="19"
|
||||||
Height="19"
|
Height="19"
|
||||||
x:Name="LeftMouseIndicator"
|
x:Name="LeftMouseIndicator"
|
||||||
RenderTransformOrigin="0.5,0.5">
|
RenderTransformOrigin="0.5,0.5">
|
||||||
<Ellipse.RenderTransform>
|
<Ellipse.RenderTransform>
|
||||||
<TransformGroup>
|
<TransformGroup>
|
||||||
<ScaleTransform />
|
<ScaleTransform />
|
||||||
<SkewTransform
|
<SkewTransform
|
||||||
AngleX="0"
|
AngleX="0"
|
||||||
AngleY="0" />
|
AngleY="0" />
|
||||||
<RotateTransform
|
<RotateTransform
|
||||||
Angle="0" />
|
Angle="0" />
|
||||||
<TranslateTransform
|
<TranslateTransform
|
||||||
X="0"
|
X="0"
|
||||||
Y="0" />
|
Y="0" />
|
||||||
</TransformGroup>
|
</TransformGroup>
|
||||||
</Ellipse.RenderTransform>
|
</Ellipse.RenderTransform>
|
||||||
<Ellipse.Fill>
|
<Ellipse.Fill>
|
||||||
<LinearGradientBrush
|
<LinearGradientBrush
|
||||||
EndPoint="0.528,0.694"
|
EndPoint="0.528,0.694"
|
||||||
StartPoint="-0.056,-0.118">
|
StartPoint="-0.056,-0.118">
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFFFFFF"
|
Color="#FFFFFFFF"
|
||||||
Offset="0" />
|
Offset="0" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FF65A135"
|
Color="#FF65A135"
|
||||||
Offset="1" />
|
Offset="1" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Ellipse.Fill>
|
</Ellipse.Fill>
|
||||||
</Ellipse>
|
</Ellipse>
|
||||||
<Ellipse
|
<Ellipse
|
||||||
Stroke="#FF549D2D"
|
Stroke="#FF549D2D"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="24,0,0,94"
|
Margin="24,0,0,94"
|
||||||
Width="19"
|
Width="19"
|
||||||
x:Name="ToolTipIndicator"
|
x:Name="ToolTipIndicator"
|
||||||
RenderTransformOrigin="0.5,0.5"
|
RenderTransformOrigin="0.5,0.5"
|
||||||
Height="19"
|
Height="19"
|
||||||
VerticalAlignment="Bottom">
|
VerticalAlignment="Bottom">
|
||||||
<Ellipse.RenderTransform>
|
<Ellipse.RenderTransform>
|
||||||
<TransformGroup>
|
<TransformGroup>
|
||||||
<ScaleTransform
|
<ScaleTransform
|
||||||
ScaleX="1"
|
ScaleX="1"
|
||||||
ScaleY="1" />
|
ScaleY="1" />
|
||||||
<SkewTransform
|
<SkewTransform
|
||||||
AngleX="0"
|
AngleX="0"
|
||||||
AngleY="0" />
|
AngleY="0" />
|
||||||
<RotateTransform
|
<RotateTransform
|
||||||
Angle="0" />
|
Angle="0" />
|
||||||
<TranslateTransform
|
<TranslateTransform
|
||||||
X="0"
|
X="0"
|
||||||
Y="0" />
|
Y="0" />
|
||||||
</TransformGroup>
|
</TransformGroup>
|
||||||
</Ellipse.RenderTransform>
|
</Ellipse.RenderTransform>
|
||||||
<Ellipse.Fill>
|
<Ellipse.Fill>
|
||||||
<LinearGradientBrush
|
<LinearGradientBrush
|
||||||
EndPoint="0.528,0.694"
|
EndPoint="0.528,0.694"
|
||||||
StartPoint="-0.056,-0.118">
|
StartPoint="-0.056,-0.118">
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFFFFFF"
|
Color="#FFFFFFFF"
|
||||||
Offset="0" />
|
Offset="0" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FF65A135"
|
Color="#FF65A135"
|
||||||
Offset="1" />
|
Offset="1" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Ellipse.Fill>
|
</Ellipse.Fill>
|
||||||
</Ellipse>
|
</Ellipse>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="63,62,91,0"
|
Margin="63,62,91,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Height="19"
|
Height="19"
|
||||||
TextWrapping="Wrap">
|
TextWrapping="Wrap">
|
||||||
<Run
|
<Run
|
||||||
Language="de-ch"
|
Language="de-ch"
|
||||||
Text="TrayMouseMove Event" />
|
Text="TrayMouseMove Event" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="63,106,91,0"
|
Margin="63,106,91,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Height="19"
|
Height="19"
|
||||||
TextWrapping="Wrap">
|
TextWrapping="Wrap">
|
||||||
<Run
|
<Run
|
||||||
Language="de-ch"
|
Language="de-ch"
|
||||||
Text="TrayLeftMouseUp Event" />
|
Text="TrayLeftMouseUp Event" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="63,0,91,94"
|
Margin="63,0,91,94"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Height="19">
|
Height="19">
|
||||||
<Run
|
<Run
|
||||||
Language="de-ch"
|
Language="de-ch"
|
||||||
Text="TrayToolTipOpen Event" />
|
Text="TrayToolTipOpen Event" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="10,10,10,0"
|
Margin="10,10,10,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Height="31"
|
Height="31"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
FontWeight="Bold">
|
FontWeight="Bold">
|
||||||
<Run Language="de-ch" Text="The green ellipses are animated based on routed events of the NotifyIcon" />
|
<Run Language="de-ch" Text="The green ellipses are animated based on routed events of the NotifyIcon" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -1,24 +1,24 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples.Tutorials.Events
|
namespace Samples.Tutorials.Events
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for EventVisualizerWindow.xaml
|
/// Interaction logic for EventVisualizerWindow.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class EventVisualizerWindow : Window
|
public partial class EventVisualizerWindow : Window
|
||||||
{
|
{
|
||||||
public EventVisualizerWindow()
|
public EventVisualizerWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
//clean up notifyicon (would otherwise stay open until application finishes)
|
//clean up notifyicon (would otherwise stay open until application finishes)
|
||||||
notifyIcon.Dispose();
|
notifyIcon.Dispose();
|
||||||
|
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,91 +1,91 @@
|
|||||||
<Window x:Class="Samples.Tutorials.DataBinding.DataBoundToolTipWindow"
|
<Window x:Class="Samples.Tutorials.DataBinding.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"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="500">
|
Width="500">
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|
||||||
<!-- 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
|
||||||
The binding is implicit (using DataContext)
|
The binding is implicit (using DataContext)
|
||||||
-->
|
-->
|
||||||
<tb:TaskbarIcon.TrayToolTip>
|
<tb:TaskbarIcon.TrayToolTip>
|
||||||
<Border Background="White"
|
<Border Background="White"
|
||||||
BorderBrush="Orange"
|
BorderBrush="Orange"
|
||||||
BorderThickness="2"
|
BorderThickness="2"
|
||||||
CornerRadius="4"
|
CornerRadius="4"
|
||||||
Opacity="0.8"
|
Opacity="0.8"
|
||||||
Width="160"
|
Width="160"
|
||||||
Height="40">
|
Height="40">
|
||||||
<TextBlock Text="{Binding Path=ToolTipText}"
|
<TextBlock Text="{Binding Path=ToolTipText}"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
</Border>
|
</Border>
|
||||||
</tb:TaskbarIcon.TrayToolTip>
|
</tb:TaskbarIcon.TrayToolTip>
|
||||||
|
|
||||||
</tb:TaskbarIcon>
|
</tb:TaskbarIcon>
|
||||||
|
|
||||||
|
|
||||||
<!-- This NotifyIcon has its DataContext set (just the string "WPF FTW") - implicit binding is no longer possible -->
|
<!-- This NotifyIcon has its DataContext set (just the string "WPF FTW") - implicit binding is no longer possible -->
|
||||||
<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>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Important: The attached property is assigned to the border, but derived by all controls.
|
Important: The attached property is assigned to the border, but derived by all controls.
|
||||||
The NotifyIcon does not touch the underlying controls.
|
The NotifyIcon does not touch the underlying controls.
|
||||||
-->
|
-->
|
||||||
<Border Background="White"
|
<Border Background="White"
|
||||||
BorderBrush="Orange"
|
BorderBrush="Orange"
|
||||||
BorderThickness="2"
|
BorderThickness="2"
|
||||||
CornerRadius="4"
|
CornerRadius="4"
|
||||||
Opacity="0.8"
|
Opacity="0.8"
|
||||||
Width="160"
|
Width="160"
|
||||||
Height="40">
|
Height="40">
|
||||||
<!-- Implicitly access the DataContext (which is a string this time)-->
|
<!-- Implicitly access the DataContext (which is a string this time)-->
|
||||||
<TextBlock Text="{Binding}">
|
<TextBlock Text="{Binding}">
|
||||||
<!-- Explicitly access the NotifyIcon, as it is an attached property -->
|
<!-- Explicitly access the NotifyIcon, as it is an attached property -->
|
||||||
<TextBlock Text="{Binding RelativeSource={RelativeSource Self},
|
<TextBlock Text="{Binding RelativeSource={RelativeSource Self},
|
||||||
Path=(tb:TaskbarIcon.ParentTaskbarIcon).ToolTipText}"
|
Path=(tb:TaskbarIcon.ParentTaskbarIcon).ToolTipText}"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</Border>
|
</Border>
|
||||||
</tb:TaskbarIcon.TrayToolTip>
|
</tb:TaskbarIcon.TrayToolTip>
|
||||||
|
|
||||||
</tb:TaskbarIcon>
|
</tb:TaskbarIcon>
|
||||||
|
|
||||||
|
|
||||||
<TextBlock Margin="26,26,24,0"
|
<TextBlock Margin="26,26,24,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
FontWeight="Bold">
|
FontWeight="Bold">
|
||||||
<Run Text="This sample shows data bound ToolTips in two flavors" /><LineBreak /><Run Text="" />
|
<Run Text="This sample shows data bound ToolTips in two flavors" /><LineBreak /><Run Text="" />
|
||||||
<LineBreak /><Run Text="- implicit binding via DataContext" /><LineBreak />
|
<LineBreak /><Run Text="- implicit binding via DataContext" /><LineBreak />
|
||||||
<Run Text="- explicit binding via ParentTaskbarIcon (attached property)" /><LineBreak /><Run Text="" />
|
<Run Text="- explicit binding via ParentTaskbarIcon (attached property)" /><LineBreak /><Run Text="" />
|
||||||
<LineBreak /><Run Text="Move over NotifyIcons (grey / red) to show data bound ToolTip" />
|
<LineBreak /><Run Text="Move over NotifyIcons (grey / red) to show data bound ToolTip" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<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"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Height="26"
|
Height="26"
|
||||||
TextWrapping="Wrap">
|
TextWrapping="Wrap">
|
||||||
<Run Text="ToolTipText:" />
|
<Run Text="ToolTipText:" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -1,25 +1,25 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples.Tutorials.DataBinding
|
namespace Samples.Tutorials.DataBinding
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for DataBoundToolTipWindow.xaml
|
/// Interaction logic for DataBoundToolTipWindow.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class DataBoundToolTipWindow : Window
|
public partial class DataBoundToolTipWindow : Window
|
||||||
{
|
{
|
||||||
public DataBoundToolTipWindow()
|
public DataBoundToolTipWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
//clean up notifyicon (would otherwise stay open until application finishes)
|
//clean up notifyicon (would otherwise stay open until application finishes)
|
||||||
MyNotifyIcon1.Dispose();
|
MyNotifyIcon1.Dispose();
|
||||||
MyNotifyIcon2.Dispose();
|
MyNotifyIcon2.Dispose();
|
||||||
|
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,37 +1,37 @@
|
|||||||
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<UserControl 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: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="Samples.Tutorials.MvvmSample.ClockPopup"
|
||||||
x:Name="UserControl"
|
x:Name="UserControl"
|
||||||
Height="141"
|
Height="141"
|
||||||
Width="304">
|
Width="304">
|
||||||
<UserControl.Background>
|
<UserControl.Background>
|
||||||
<LinearGradientBrush EndPoint="0.5,1"
|
<LinearGradientBrush EndPoint="0.5,1"
|
||||||
StartPoint="0.5,0">
|
StartPoint="0.5,0">
|
||||||
<GradientStop Color="#FFA8A8A8"
|
<GradientStop Color="#FFA8A8A8"
|
||||||
Offset="0" />
|
Offset="0" />
|
||||||
<GradientStop Color="White"
|
<GradientStop Color="White"
|
||||||
Offset="1" />
|
Offset="1" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</UserControl.Background>
|
</UserControl.Background>
|
||||||
|
|
||||||
<Grid x:Name="LayoutRoot">
|
<Grid x:Name="LayoutRoot">
|
||||||
<Rectangle Stroke="#FF727272"/>
|
<Rectangle Stroke="#FF727272"/>
|
||||||
<Image Source="Clock.png"
|
<Image Source="Clock.png"
|
||||||
Stretch="Fill"
|
Stretch="Fill"
|
||||||
Height="128"
|
Height="128"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Width="128"
|
Width="128"
|
||||||
Margin="10,10,0,0" />
|
Margin="10,10,0,0" />
|
||||||
<TextBlock HorizontalAlignment="Left"
|
<TextBlock HorizontalAlignment="Left"
|
||||||
Margin="143,0,0,0"
|
Margin="143,0,0,0"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Text="{Binding Timestamp}"
|
Text="{Binding Timestamp}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontSize="40"
|
FontSize="40"
|
||||||
Foreground="#F2346172" />
|
Foreground="#F2346172" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace Samples.Tutorials.MvvmSample
|
namespace Samples.Tutorials.MvvmSample
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for ClockPopup.xaml
|
/// Interaction logic for ClockPopup.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ClockPopup : UserControl
|
public partial class ClockPopup : UserControl
|
||||||
{
|
{
|
||||||
public ClockPopup()
|
public ClockPopup()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
this.InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,38 +1,38 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
|
|
||||||
namespace Samples.Tutorials.MvvmSample
|
namespace Samples.Tutorials.MvvmSample
|
||||||
{
|
{
|
||||||
public class MvvmSampleViewModel : INotifyPropertyChanged
|
public class MvvmSampleViewModel : INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
private DispatcherTimer timer;
|
private DispatcherTimer timer;
|
||||||
|
|
||||||
public string Timestamp
|
public string Timestamp
|
||||||
{
|
{
|
||||||
get { return DateTime.Now.ToLongTimeString(); }
|
get { return DateTime.Now.ToLongTimeString(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public MvvmSampleViewModel()
|
public MvvmSampleViewModel()
|
||||||
{
|
{
|
||||||
timer = new DispatcherTimer(TimeSpan.FromSeconds(1), DispatcherPriority.Normal, OnTimerTick, Application.Current.Dispatcher);
|
timer = new DispatcherTimer(TimeSpan.FromSeconds(1), DispatcherPriority.Normal, OnTimerTick, Application.Current.Dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTimerTick(object sender, EventArgs e)
|
private void OnTimerTick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//fire a property change event for the timestamp
|
//fire a property change event for the timestamp
|
||||||
Application.Current.Dispatcher.BeginInvoke(new Action(() => OnPropertyChanged("Timestamp")));
|
Application.Current.Dispatcher.BeginInvoke(new Action(() => OnPropertyChanged("Timestamp")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
protected virtual void OnPropertyChanged(string propertyName)
|
protected virtual void OnPropertyChanged(string propertyName)
|
||||||
{
|
{
|
||||||
PropertyChangedEventHandler handler = PropertyChanged;
|
PropertyChangedEventHandler handler = PropertyChanged;
|
||||||
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
|
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,37 +1,37 @@
|
|||||||
<Window x:Class="Samples.Tutorials.MvvmSample.MvvmSampleWindow"
|
<Window x:Class="Samples.Tutorials.MvvmSample.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:local="clr-namespace:Samples.Tutorials.MvvmSample"
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||||
Title="MvvmSampleWindow"
|
Title="MvvmSampleWindow"
|
||||||
Height="300"
|
Height="300"
|
||||||
Width="300">
|
Width="300">
|
||||||
<Window.DataContext>
|
<Window.DataContext>
|
||||||
<local:MvvmSampleViewModel />
|
<local:MvvmSampleViewModel />
|
||||||
</Window.DataContext>
|
</Window.DataContext>
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
the NotifyIcon automatically derives the DataContext of it's
|
the NotifyIcon automatically derives the DataContext of it's
|
||||||
declaring view. Alternatively, you could just assign it manually
|
declaring view. Alternatively, you could just assign it manually
|
||||||
-->
|
-->
|
||||||
<tb:TaskbarIcon IconSource="/Icons/Inactive.ico"
|
<tb:TaskbarIcon IconSource="/Icons/Inactive.ico"
|
||||||
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" />
|
<local:ClockPopup Opacity="0.8" />
|
||||||
</tb:TaskbarIcon.TrayPopup>
|
</tb:TaskbarIcon.TrayPopup>
|
||||||
</tb:TaskbarIcon>
|
</tb:TaskbarIcon>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<TextBlock TextWrapping="Wrap"
|
<TextBlock TextWrapping="Wrap"
|
||||||
Text="MVVM is quite simple - content of the NotifyIcon derive its DataContext. Sample: Hover over the icon in order to see the bound ToolTipText. Click for a richer Popup that is bound to the same property."
|
Text="MVVM is quite simple - content of the NotifyIcon derive its DataContext. Sample: Hover over the icon in order to see the bound ToolTipText. Click for a richer Popup that is bound to the same property."
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Margin="10,10,10,0" />
|
Margin="10,10,10,0" />
|
||||||
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples.Tutorials.MvvmSample
|
namespace Samples.Tutorials.MvvmSample
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for MvvmSampleWindow.xaml
|
/// Interaction logic for MvvmSampleWindow.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MvvmSampleWindow : Window
|
public partial class MvvmSampleWindow : Window
|
||||||
{
|
{
|
||||||
public MvvmSampleWindow()
|
public MvvmSampleWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<Application x:Class="Windowless_Sample.App"
|
<Application x:Class="Windowless_Sample.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">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Note that this application does not have a StartupUri declared, so no Window is automatically loaded.
|
Note that this application does not have a StartupUri declared, so no Window is automatically loaded.
|
||||||
Also, the ShutdownMode was set to explicit, so we have to close the application programmatically
|
Also, the ShutdownMode was set to explicit, so we have to close the application programmatically
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
<!-- merge NotifyIcon and related stuff into the application -->
|
<!-- merge NotifyIcon and related stuff into the application -->
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="NotifyIconResources.xaml" />
|
<ResourceDictionary Source="NotifyIconResources.xaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
</Application>
|
</Application>
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using Hardcodet.Wpf.TaskbarNotification;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
|
|
||||||
namespace Windowless_Sample
|
namespace Windowless_Sample
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Simple application. Check the XAML for comments.
|
/// Simple application. Check the XAML for comments.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
private TaskbarIcon notifyIcon;
|
private TaskbarIcon notifyIcon;
|
||||||
|
|
||||||
protected override void OnStartup(StartupEventArgs e)
|
protected override void OnStartup(StartupEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnStartup(e);
|
base.OnStartup(e);
|
||||||
|
|
||||||
//create the notifyicon (it's a resource declared in NotifyIconResources.xaml
|
//create the notifyicon (it's a resource declared in NotifyIconResources.xaml
|
||||||
notifyIcon = (TaskbarIcon) FindResource("NotifyIcon");
|
notifyIcon = (TaskbarIcon) FindResource("NotifyIcon");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnExit(ExitEventArgs e)
|
protected override void OnExit(ExitEventArgs e)
|
||||||
{
|
{
|
||||||
notifyIcon.Dispose(); //the icon would clean up automatically, but this is cleaner
|
notifyIcon.Dispose(); //the icon would clean up automatically, but this is cleaner
|
||||||
base.OnExit(e);
|
base.OnExit(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<Window x:Class="Windowless_Sample.MainWindow"
|
<Window x:Class="Windowless_Sample.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">
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextBlock Text="Have a look at App.xaml and App.xaml.cs to see how things are working" />
|
<TextBlock Text="Have a look at App.xaml and App.xaml.cs to see how things are working" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
namespace Windowless_Sample
|
namespace Windowless_Sample
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for MainWindow.xaml
|
/// Interaction logic for MainWindow.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class MainWindow : Window
|
public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,32 @@
|
|||||||
<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:Windowless_Sample">
|
||||||
|
|
||||||
<!-- 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 -->
|
||||||
<!--
|
<!--
|
||||||
The "shared" directive is needed if we reopen the sample window a few times - WPF will otherwise
|
The "shared" directive is needed if we reopen the sample window a few times - WPF will otherwise
|
||||||
reuse the same context menu (which is a resource) again (which will have its DataContext set to the old TaskbarIcon)
|
reuse the same context menu (which is a resource) again (which will have its DataContext set to the old TaskbarIcon)
|
||||||
-->
|
-->
|
||||||
<ContextMenu x:Shared="false" x:Key="SysTrayMenu">
|
<ContextMenu x:Shared="false" x:Key="SysTrayMenu">
|
||||||
<MenuItem Header="Show Window" Command="{Binding ShowWindowCommand}" />
|
<MenuItem Header="Show Window" Command="{Binding ShowWindowCommand}" />
|
||||||
<MenuItem Header="Hide Window" Command="{Binding HideWindowCommand}" />
|
<MenuItem Header="Hide Window" Command="{Binding HideWindowCommand}" />
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem Header="Exit" Command="{Binding ExitApplicationCommand}" />
|
<MenuItem Header="Exit" Command="{Binding ExitApplicationCommand}" />
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
|
|
||||||
|
|
||||||
<!-- the application's NotifyIcon - started from App.xaml.cs. Declares its own view model. -->
|
<!-- the application's NotifyIcon - started from App.xaml.cs. Declares its own view model. -->
|
||||||
<tb:TaskbarIcon x:Key="NotifyIcon"
|
<tb:TaskbarIcon x:Key="NotifyIcon"
|
||||||
IconSource="/Red.ico"
|
IconSource="/Red.ico"
|
||||||
ToolTipText="Double-click for window, right-click for menu"
|
ToolTipText="Double-click for window, right-click for menu"
|
||||||
DoubleClickCommand="{Binding ShowWindowCommand}"
|
DoubleClickCommand="{Binding ShowWindowCommand}"
|
||||||
ContextMenu="{StaticResource SysTrayMenu}">
|
ContextMenu="{StaticResource SysTrayMenu}">
|
||||||
|
|
||||||
<!-- self-assign a data context (could also be done programmatically) -->
|
<!-- self-assign a data context (could also be done programmatically) -->
|
||||||
<tb:TaskbarIcon.DataContext>
|
<tb:TaskbarIcon.DataContext>
|
||||||
<local:NotifyIconViewModel />
|
<local:NotifyIconViewModel />
|
||||||
</tb:TaskbarIcon.DataContext>
|
</tb:TaskbarIcon.DataContext>
|
||||||
</tb:TaskbarIcon>
|
</tb:TaskbarIcon>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -1,86 +1,86 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Windowless_Sample
|
namespace Windowless_Sample
|
||||||
{
|
{
|
||||||
/// <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
|
||||||
/// view model is assigned to the NotifyIcon in XAML. Alternatively, the startup routing
|
/// view model is assigned to the NotifyIcon in XAML. Alternatively, the startup routing
|
||||||
/// in App.xaml.cs could have created this view model, and assigned it to the NotifyIcon.
|
/// in App.xaml.cs could have created this view model, and assigned it to the NotifyIcon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class NotifyIconViewModel
|
public class NotifyIconViewModel
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows a window, if none is already open.
|
/// Shows a window, if none is already open.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ICommand ShowWindowCommand
|
public ICommand ShowWindowCommand
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new DelegateCommand
|
return new DelegateCommand
|
||||||
{
|
{
|
||||||
CanExecuteFunc = () => Application.Current.MainWindow == null,
|
CanExecuteFunc = () => Application.Current.MainWindow == null,
|
||||||
CommandAction = () =>
|
CommandAction = () =>
|
||||||
{
|
{
|
||||||
Application.Current.MainWindow = new MainWindow();
|
Application.Current.MainWindow = new MainWindow();
|
||||||
Application.Current.MainWindow.Show();
|
Application.Current.MainWindow.Show();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Hides the main window. This command is only enabled if a window is open.
|
/// Hides the main window. This command is only enabled if a window is open.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ICommand HideWindowCommand
|
public ICommand HideWindowCommand
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new DelegateCommand
|
return new DelegateCommand
|
||||||
{
|
{
|
||||||
CommandAction = () => Application.Current.MainWindow.Close(),
|
CommandAction = () => Application.Current.MainWindow.Close(),
|
||||||
CanExecuteFunc = () => Application.Current.MainWindow != null
|
CanExecuteFunc = () => Application.Current.MainWindow != null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shuts down the application.
|
/// Shuts down the application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ICommand ExitApplicationCommand
|
public ICommand ExitApplicationCommand
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new DelegateCommand {CommandAction = () => Application.Current.Shutdown()};
|
return new DelegateCommand {CommandAction = () => Application.Current.Shutdown()};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Simplistic delegate command for the demo.
|
/// Simplistic delegate command for the demo.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DelegateCommand : ICommand
|
public class DelegateCommand : ICommand
|
||||||
{
|
{
|
||||||
public Action CommandAction { get; set; }
|
public Action CommandAction { get; set; }
|
||||||
public Func<bool> CanExecuteFunc { get; set; }
|
public Func<bool> CanExecuteFunc { get; set; }
|
||||||
|
|
||||||
public void Execute(object parameter)
|
public void Execute(object parameter)
|
||||||
{
|
{
|
||||||
CommandAction();
|
CommandAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanExecute(object parameter)
|
public bool CanExecute(object parameter)
|
||||||
{
|
{
|
||||||
return CanExecuteFunc == null || CanExecuteFunc();
|
return CanExecuteFunc == null || CanExecuteFunc();
|
||||||
}
|
}
|
||||||
|
|
||||||
public event EventHandler CanExecuteChanged
|
public event EventHandler CanExecuteChanged
|
||||||
{
|
{
|
||||||
add { CommandManager.RequerySuggested += value; }
|
add { CommandManager.RequerySuggested += value; }
|
||||||
remove { CommandManager.RequerySuggested -= value; }
|
remove { CommandManager.RequerySuggested -= value; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,55 +1,55 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Resources;
|
using System.Resources;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("Windowless Sample")]
|
[assembly: AssemblyTitle("Windowless Sample")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("Windowless Sample")]
|
[assembly: AssemblyProduct("Windowless Sample")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2013")]
|
[assembly: AssemblyCopyright("Copyright © 2013")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
// to COM components. If you need to access a type in this assembly from
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
//In order to begin building localizable applications, set
|
//In order to begin building localizable applications, set
|
||||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||||
//inside a <PropertyGroup>. For example, if you are using US english
|
//inside a <PropertyGroup>. For example, if you are using US english
|
||||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||||
//the line below to match the UICulture setting in the project file.
|
//the line below to match the UICulture setting in the project file.
|
||||||
|
|
||||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||||
|
|
||||||
|
|
||||||
[assembly: ThemeInfo(
|
[assembly: ThemeInfo(
|
||||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||||
//(used if a resource is not found in the page,
|
//(used if a resource is not found in the page,
|
||||||
// or application resource dictionaries)
|
// or application resource dictionaries)
|
||||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||||
//(used if a resource is not found in the page,
|
//(used if a resource is not found in the page,
|
||||||
// app, or any theme specific resource dictionaries)
|
// app, or any theme specific resource dictionaries)
|
||||||
)]
|
)]
|
||||||
|
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
|
|||||||
@@ -1,98 +1,98 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProjectGuid>{964EBFBE-A600-49B2-BDD8-422B46F1D544}</ProjectGuid>
|
<ProjectGuid>{964EBFBE-A600-49B2-BDD8-422B46F1D544}</ProjectGuid>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>Windowless_Sample</RootNamespace>
|
<RootNamespace>Windowless_Sample</RootNamespace>
|
||||||
<AssemblyName>Windowless Sample</AssemblyName>
|
<AssemblyName>Windowless Sample</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="System.Xaml">
|
<Reference Include="System.Xaml">
|
||||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ApplicationDefinition Include="App.xaml">
|
<ApplicationDefinition Include="App.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
<Page Include="MainWindow.xaml">
|
<Page Include="MainWindow.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Compile Include="App.xaml.cs">
|
<Compile Include="App.xaml.cs">
|
||||||
<DependentUpon>App.xaml</DependentUpon>
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="MainWindow.xaml.cs">
|
<Compile Include="MainWindow.xaml.cs">
|
||||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Page Include="NotifyIconResources.xaml">
|
<Page Include="NotifyIconResources.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="NotifyIconViewModel.cs" />
|
<Compile Include="NotifyIconViewModel.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<AppDesigner Include="Properties\" />
|
<AppDesigner Include="Properties\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\NotifyIconWpf\NotifyIconWpf.csproj">
|
<ProjectReference Include="..\NotifyIconWpf\NotifyIconWpf.csproj">
|
||||||
<Project>{7AC63864-7638-41C4-969C-D3197EF2BED9}</Project>
|
<Project>{7AC63864-7638-41C4-969C-D3197EF2BED9}</Project>
|
||||||
<Name>NotifyIconWpf</Name>
|
<Name>NotifyIconWpf</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Red.ico" />
|
<Resource Include="Red.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
<Target Name="BeforeBuild">
|
<Target Name="BeforeBuild">
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="AfterBuild">
|
<Target Name="AfterBuild">
|
||||||
</Target>
|
</Target>
|
||||||
-->
|
-->
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,129 +1,129 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
x:Class="Samples.FancyPopup"
|
x:Class="Samples.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"
|
||||||
Height="215"
|
Height="215"
|
||||||
Width="300" x:Name="me">
|
Width="300" x:Name="me">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<Storyboard x:Key="RotateIcon">
|
<Storyboard x:Key="RotateIcon">
|
||||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image"
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image"
|
||||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
|
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
|
||||||
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
|
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
|
||||||
<SplineDoubleKeyFrame KeySpline="0,0.284,0.39,1" KeyTime="00:00:01.4000000" Value="360" />
|
<SplineDoubleKeyFrame KeySpline="0,0.284,0.39,1" KeyTime="00:00:01.4000000" Value="360" />
|
||||||
</DoubleAnimationUsingKeyFrames>
|
</DoubleAnimationUsingKeyFrames>
|
||||||
</Storyboard>
|
</Storyboard>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<UserControl.Triggers>
|
<UserControl.Triggers>
|
||||||
<EventTrigger RoutedEvent="tb:TaskbarIcon.PopupOpened">
|
<EventTrigger RoutedEvent="tb:TaskbarIcon.PopupOpened">
|
||||||
<BeginStoryboard Storyboard="{StaticResource RotateIcon}" x:Name="RotateIcon_BeginStoryboard" />
|
<BeginStoryboard Storyboard="{StaticResource RotateIcon}" x:Name="RotateIcon_BeginStoryboard" />
|
||||||
</EventTrigger>
|
</EventTrigger>
|
||||||
</UserControl.Triggers>
|
</UserControl.Triggers>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Border
|
<Border
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Width="Auto"
|
Width="Auto"
|
||||||
Height="Auto"
|
Height="Auto"
|
||||||
Margin="5,5,5,5"
|
Margin="5,5,5,5"
|
||||||
CornerRadius="10,10,10,10">
|
CornerRadius="10,10,10,10">
|
||||||
<Border.Effect>
|
<Border.Effect>
|
||||||
<DropShadowEffect
|
<DropShadowEffect
|
||||||
Color="#FF474747" />
|
Color="#FF474747" />
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
<Border.Background>
|
<Border.Background>
|
||||||
<LinearGradientBrush
|
<LinearGradientBrush
|
||||||
EndPoint="0.5,1"
|
EndPoint="0.5,1"
|
||||||
StartPoint="0.5,0">
|
StartPoint="0.5,0">
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FF58C2FF"
|
Color="#FF58C2FF"
|
||||||
Offset="0" />
|
Offset="0" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFFFFFF"
|
Color="#FFFFFFFF"
|
||||||
Offset="1" />
|
Offset="1" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Border.Background>
|
</Border.Background>
|
||||||
</Border>
|
</Border>
|
||||||
<Image
|
<Image
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="19,10,0,0"
|
Margin="19,10,0,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Width="72"
|
Width="72"
|
||||||
Height="72"
|
Height="72"
|
||||||
Source="/Images/Preferences.png"
|
Source="/Images/Preferences.png"
|
||||||
Stretch="Fill" x:Name="image" RenderTransformOrigin="0.5,0.5">
|
Stretch="Fill" x:Name="image" RenderTransformOrigin="0.5,0.5">
|
||||||
<Image.RenderTransform>
|
<Image.RenderTransform>
|
||||||
<TransformGroup>
|
<TransformGroup>
|
||||||
<ScaleTransform ScaleX="1" ScaleY="1" />
|
<ScaleTransform ScaleX="1" ScaleY="1" />
|
||||||
<SkewTransform AngleX="0" AngleY="0" />
|
<SkewTransform AngleX="0" AngleY="0" />
|
||||||
<RotateTransform Angle="0" />
|
<RotateTransform Angle="0" />
|
||||||
<TranslateTransform X="0" Y="0" />
|
<TranslateTransform X="0" Y="0" />
|
||||||
</TransformGroup>
|
</TransformGroup>
|
||||||
</Image.RenderTransform>
|
</Image.RenderTransform>
|
||||||
</Image>
|
</Image>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="107,10,20,0"
|
Margin="107,10,20,0"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Height="Auto"
|
Height="Auto"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
FontSize="16"
|
FontSize="16"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Foreground="#FF575757" HorizontalAlignment="Right">
|
Foreground="#FF575757" HorizontalAlignment="Right">
|
||||||
<Run
|
<Run
|
||||||
Text="This is a fancy Popup..."
|
Text="This is a fancy Popup..."
|
||||||
Language="de-ch" />
|
Language="de-ch" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Button
|
<Button
|
||||||
Click="OnButtonClick"
|
Click="OnButtonClick"
|
||||||
ToolTip="{Binding Path=ToolTipText}"
|
ToolTip="{Binding Path=ToolTipText}"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Width="89"
|
Width="89"
|
||||||
Height="29"
|
Height="29"
|
||||||
Content="Click me"
|
Content="Click me"
|
||||||
Margin="0,0,20,20"
|
Margin="0,0,20,20"
|
||||||
BorderBrush="#FFFFFFFF">
|
BorderBrush="#FFFFFFFF">
|
||||||
<Button.Background>
|
<Button.Background>
|
||||||
<LinearGradientBrush
|
<LinearGradientBrush
|
||||||
EndPoint="0,1"
|
EndPoint="0,1"
|
||||||
StartPoint="0,0">
|
StartPoint="0,0">
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFFFFFF"
|
Color="#FFFFFFFF"
|
||||||
Offset="1" />
|
Offset="1" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFFD197"
|
Color="#FFFFD197"
|
||||||
Offset="0.459" />
|
Offset="0.459" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFFFDBAD"
|
Color="#FFFFDBAD"
|
||||||
Offset="0" />
|
Offset="0" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFF18E23"
|
Color="#FFF18E23"
|
||||||
Offset="0.508" />
|
Offset="0.508" />
|
||||||
<GradientStop
|
<GradientStop
|
||||||
Color="#FFF9D4AC"
|
Color="#FFF9D4AC"
|
||||||
Offset="0.954" />
|
Offset="0.954" />
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Button.Background>
|
</Button.Background>
|
||||||
</Button>
|
</Button>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="19,92,10,49"
|
Margin="19,92,10,49"
|
||||||
TextWrapping="Wrap">
|
TextWrapping="Wrap">
|
||||||
<Run Text="This user control makes use of the " Language="de-ch" />
|
<Run Text="This user control makes use of the " Language="de-ch" />
|
||||||
<Run FontStyle="Italic" FontWeight="Bold" Text="PopupOpened " Language="de-ch" />
|
<Run FontStyle="Italic" FontWeight="Bold" Text="PopupOpened " Language="de-ch" />
|
||||||
<Run
|
<Run
|
||||||
Text="attached routed event . Whenever the popup is opened, this attached event fires and triggers the rotation animation."
|
Text="attached routed event . Whenever the popup is opened, this attached event fires and triggers the rotation animation."
|
||||||
Language="de-ch" />
|
Language="de-ch" />
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock Margin="0,52,20,0" VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap" FontWeight="Bold"
|
<TextBlock Margin="0,52,20,0" VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap" FontWeight="Bold"
|
||||||
FontSize="14" HorizontalAlignment="Right" Foreground="#FF575757">
|
FontSize="14" HorizontalAlignment="Right" Foreground="#FF575757">
|
||||||
<Run Text="Clicks: " Language="de-ch" />
|
<Run Text="Clicks: " Language="de-ch" />
|
||||||
<InlineUIContainer>
|
<InlineUIContainer>
|
||||||
<TextBlock Width="Auto" Height="Auto" Text="{Binding Path=ClickCount, ElementName=me, Mode=Default}"
|
<TextBlock Width="Auto" Height="Auto" Text="{Binding Path=ClickCount, ElementName=me, Mode=Default}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</InlineUIContainer>
|
</InlineUIContainer>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Image
|
<Image
|
||||||
Source="{Binding Path=IconSource}" Width="16" HorizontalAlignment="Left" Margin="19,0,0,23" Height="16"
|
Source="{Binding Path=IconSource}" Width="16" HorizontalAlignment="Left" Margin="19,0,0,23" Height="16"
|
||||||
VerticalAlignment="Bottom" />
|
VerticalAlignment="Bottom" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,45 +1,45 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Samples
|
namespace Samples
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for FancyPopup.xaml
|
/// Interaction logic for FancyPopup.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class FancyPopup
|
public partial class FancyPopup
|
||||||
{
|
{
|
||||||
#region ClickCount dependency property
|
#region ClickCount dependency property
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The number of clicks on the popup button.
|
/// The number of clicks on the popup button.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly DependencyProperty ClickCountProperty =
|
public static readonly DependencyProperty ClickCountProperty =
|
||||||
DependencyProperty.Register("ClickCount",
|
DependencyProperty.Register("ClickCount",
|
||||||
typeof (int),
|
typeof (int),
|
||||||
typeof (FancyPopup),
|
typeof (FancyPopup),
|
||||||
new FrameworkPropertyMetadata(0));
|
new FrameworkPropertyMetadata(0));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A property wrapper for the <see cref="ClickCountProperty"/>
|
/// A property wrapper for the <see cref="ClickCountProperty"/>
|
||||||
/// dependency property:<br/>
|
/// dependency property:<br/>
|
||||||
/// The number of clicks on the popup button.
|
/// The number of clicks on the popup button.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int ClickCount
|
public int ClickCount
|
||||||
{
|
{
|
||||||
get { return (int) GetValue(ClickCountProperty); }
|
get { return (int) GetValue(ClickCountProperty); }
|
||||||
set { SetValue(ClickCountProperty, value); }
|
set { SetValue(ClickCountProperty, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public FancyPopup()
|
public FancyPopup()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnButtonClick(object sender, RoutedEventArgs e)
|
private void OnButtonClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
//just increment a counter - will be displayed on screen
|
//just increment a counter - will be displayed on screen
|
||||||
ClickCount++;
|
ClickCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,62 +1,62 @@
|
|||||||
namespace WindowsFormsSample
|
namespace WindowsFormsSample
|
||||||
{
|
{
|
||||||
partial class Form1
|
partial class Form1
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required designer variable.
|
/// Required designer variable.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private System.ComponentModel.IContainer components = null;
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clean up any resources being used.
|
/// Clean up any resources being used.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
if (disposing && (components != null))
|
if (disposing && (components != null))
|
||||||
{
|
{
|
||||||
components.Dispose();
|
components.Dispose();
|
||||||
}
|
}
|
||||||
base.Dispose(disposing);
|
base.Dispose(disposing);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Windows Form Designer generated code
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required method for Designer support - do not modify
|
/// Required method for Designer support - do not modify
|
||||||
/// the contents of this method with the code editor.
|
/// the contents of this method with the code editor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.label1 = new System.Windows.Forms.Label();
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// label1
|
// label1
|
||||||
//
|
//
|
||||||
this.label1.AutoSize = true;
|
this.label1.AutoSize = true;
|
||||||
this.label1.Location = new System.Drawing.Point(32, 25);
|
this.label1.Location = new System.Drawing.Point(32, 25);
|
||||||
this.label1.Name = "label1";
|
this.label1.Name = "label1";
|
||||||
this.label1.Size = new System.Drawing.Size(408, 13);
|
this.label1.Size = new System.Drawing.Size(408, 13);
|
||||||
this.label1.TabIndex = 0;
|
this.label1.TabIndex = 0;
|
||||||
this.label1.Text = "Click on the red LED icon in the taskbar to display an interactive WPF Popup cont" +
|
this.label1.Text = "Click on the red LED icon in the taskbar to display an interactive WPF Popup cont" +
|
||||||
"rol.";
|
"rol.";
|
||||||
//
|
//
|
||||||
// Form1
|
// Form1
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(488, 264);
|
this.ClientSize = new System.Drawing.Size(488, 264);
|
||||||
this.Controls.Add(this.label1);
|
this.Controls.Add(this.label1);
|
||||||
this.Name = "Form1";
|
this.Name = "Form1";
|
||||||
this.Text = "Form1";
|
this.Text = "Form1";
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private System.Windows.Forms.Label label1;
|
private System.Windows.Forms.Label label1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,39 +1,39 @@
|
|||||||
using System;
|
using System;
|
||||||
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 Samples;
|
||||||
using WindowsFormsSample.Properties;
|
using WindowsFormsSample.Properties;
|
||||||
|
|
||||||
namespace WindowsFormsSample
|
namespace WindowsFormsSample
|
||||||
{
|
{
|
||||||
public partial class Form1 : Form
|
public partial class Form1 : Form
|
||||||
{
|
{
|
||||||
private TaskbarIcon notifyIcon;
|
private TaskbarIcon notifyIcon;
|
||||||
|
|
||||||
public Form1()
|
public Form1()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
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.Icon = Resources.Led;
|
||||||
notifyIcon.ToolTipText = "Left-click to open popup";
|
notifyIcon.ToolTipText = "Left-click to open popup";
|
||||||
notifyIcon.Visibility = Visibility.Visible;
|
notifyIcon.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
notifyIcon.TrayPopup = new FancyPopup();
|
notifyIcon.TrayPopup = new FancyPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClosed(EventArgs e)
|
protected override void OnClosed(EventArgs e)
|
||||||
{
|
{
|
||||||
base.OnClosed(e);
|
base.OnClosed(e);
|
||||||
|
|
||||||
//the notify icon only closes automatically on WPF applications
|
//the notify icon only closes automatically on WPF applications
|
||||||
//-> dispose the notify icon manually
|
//-> dispose the notify icon manually
|
||||||
notifyIcon.Dispose();
|
notifyIcon.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,120 +1,120 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<!--
|
<!--
|
||||||
Microsoft ResX Schema
|
Microsoft ResX Schema
|
||||||
|
|
||||||
Version 2.0
|
Version 2.0
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
The primary goals of this format is to allow a simple XML format
|
||||||
that is mostly human readable. The generation and parsing of the
|
that is mostly human readable. The generation and parsing of the
|
||||||
various data types are done through the TypeConverter classes
|
various data types are done through the TypeConverter classes
|
||||||
associated with the data types.
|
associated with the data types.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
... ado.net/XML headers & schema ...
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
<resheader name="version">2.0</resheader>
|
<resheader name="version">2.0</resheader>
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
<comment>This is a comment</comment>
|
<comment>This is a comment</comment>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
There are any number of "resheader" rows that contain simple
|
||||||
name/value pairs.
|
name/value pairs.
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
Each data row contains a name, and value. The row also contains a
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
text/value conversion through the TypeConverter architecture.
|
text/value conversion through the TypeConverter architecture.
|
||||||
Classes that don't support this are serialized and stored with the
|
Classes that don't support this are serialized and stored with the
|
||||||
mimetype set.
|
mimetype set.
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
The mimetype is used for serialized objects, and tells the
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
read any of the formats listed below.
|
read any of the formats listed below.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
value : The object must be serialized into a byte array
|
value : The object must be serialized into a byte array
|
||||||
: using a System.ComponentModel.TypeConverter
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:choice maxOccurs="unbounded">
|
<xsd:choice maxOccurs="unbounded">
|
||||||
<xsd:element name="metadata">
|
<xsd:element name="metadata">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
<xsd:attribute ref="xml:space" />
|
<xsd:attribute ref="xml:space" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="assembly">
|
<xsd:element name="assembly">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="data">
|
<xsd:element name="data">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
<xsd:attribute ref="xml:space" />
|
<xsd:attribute ref="xml:space" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="resheader">
|
<xsd:element name="resheader">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
</xsd:choice>
|
</xsd:choice>
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
</xsd:schema>
|
</xsd:schema>
|
||||||
<resheader name="resmimetype">
|
<resheader name="resmimetype">
|
||||||
<value>text/microsoft-resx</value>
|
<value>text/microsoft-resx</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="version">
|
<resheader name="version">
|
||||||
<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=2.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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
</root>
|
</root>
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Samples;
|
using Samples;
|
||||||
|
|
||||||
namespace WindowsFormsSample
|
namespace WindowsFormsSample
|
||||||
{
|
{
|
||||||
internal static class Program
|
internal static class Program
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The main entry point for the application.
|
/// The main entry point for the application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[STAThread]
|
[STAThread]
|
||||||
private static void Main()
|
private static void Main()
|
||||||
{
|
{
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
Application.Run(new Form1());
|
Application.Run(new Form1());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,40 +1,40 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
|
|
||||||
[assembly: AssemblyTitle("WindowsFormsSample")]
|
[assembly: AssemblyTitle("WindowsFormsSample")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("Microsoft")]
|
[assembly: AssemblyCompany("Microsoft")]
|
||||||
[assembly: AssemblyProduct("WindowsFormsSample")]
|
[assembly: AssemblyProduct("WindowsFormsSample")]
|
||||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
|
[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
// to COM components. If you need to access a type in this assembly from
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
|
||||||
[assembly: Guid("072bbfa0-9b8b-48df-bf88-3e4806b3e3e8")]
|
[assembly: Guid("072bbfa0-9b8b-48df-bf88-3e4806b3e3e8")]
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
@@ -1,73 +1,73 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <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.18408
|
||||||
//
|
//
|
||||||
// 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 WindowsFormsSample.Properties {
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
// 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", "4.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 {
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
internal Resources() {
|
internal Resources() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
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("WindowsFormsSample.Properties.Resources", typeof(Resources).Assembly);
|
||||||
resourceMan = temp;
|
resourceMan = temp;
|
||||||
}
|
}
|
||||||
return resourceMan;
|
return resourceMan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Overrides the current thread's CurrentUICulture property for all
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
/// resource lookups using this strongly typed resource class.
|
/// resource lookups using this strongly typed resource class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Globalization.CultureInfo Culture {
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
get {
|
get {
|
||||||
return resourceCulture;
|
return resourceCulture;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
resourceCulture = value;
|
resourceCulture = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Icon Led {
|
internal static System.Drawing.Icon Led {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("Led", resourceCulture);
|
object obj = ResourceManager.GetObject("Led", resourceCulture);
|
||||||
return ((System.Drawing.Icon)(obj));
|
return ((System.Drawing.Icon)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,124 +1,124 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<!--
|
<!--
|
||||||
Microsoft ResX Schema
|
Microsoft ResX Schema
|
||||||
|
|
||||||
Version 2.0
|
Version 2.0
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
The primary goals of this format is to allow a simple XML format
|
||||||
that is mostly human readable. The generation and parsing of the
|
that is mostly human readable. The generation and parsing of the
|
||||||
various data types are done through the TypeConverter classes
|
various data types are done through the TypeConverter classes
|
||||||
associated with the data types.
|
associated with the data types.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
... ado.net/XML headers & schema ...
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
<resheader name="version">2.0</resheader>
|
<resheader name="version">2.0</resheader>
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
<comment>This is a comment</comment>
|
<comment>This is a comment</comment>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
There are any number of "resheader" rows that contain simple
|
||||||
name/value pairs.
|
name/value pairs.
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
Each data row contains a name, and value. The row also contains a
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
text/value conversion through the TypeConverter architecture.
|
text/value conversion through the TypeConverter architecture.
|
||||||
Classes that don't support this are serialized and stored with the
|
Classes that don't support this are serialized and stored with the
|
||||||
mimetype set.
|
mimetype set.
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
The mimetype is used for serialized objects, and tells the
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
read any of the formats listed below.
|
read any of the formats listed below.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
value : The object must be serialized into a byte array
|
value : The object must be serialized into a byte array
|
||||||
: using a System.ComponentModel.TypeConverter
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:choice maxOccurs="unbounded">
|
<xsd:choice maxOccurs="unbounded">
|
||||||
<xsd:element name="metadata">
|
<xsd:element name="metadata">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
<xsd:attribute ref="xml:space" />
|
<xsd:attribute ref="xml:space" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="assembly">
|
<xsd:element name="assembly">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="data">
|
<xsd:element name="data">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
<xsd:attribute ref="xml:space" />
|
<xsd:attribute ref="xml:space" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="resheader">
|
<xsd:element name="resheader">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
</xsd:choice>
|
</xsd:choice>
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
</xsd:schema>
|
</xsd:schema>
|
||||||
<resheader name="resmimetype">
|
<resheader name="resmimetype">
|
||||||
<value>text/microsoft-resx</value>
|
<value>text/microsoft-resx</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="version">
|
<resheader name="version">
|
||||||
<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=2.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=2.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=2.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=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user