mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-14 10:00:10 -05:00
CHG The attached TaskBarIcon DP is derived now, so binding doesn't have to go through the parent element anymore (NTFY-18).
git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@176 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
@@ -36,17 +36,17 @@
|
||||
</tb:TaskbarIcon>
|
||||
|
||||
|
||||
<!-- This NotifyIcon has its DataContext set - 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"
|
||||
DataContext="WPF IS GREAT: "
|
||||
DataContext="WPF FTW "
|
||||
IconSource="/Icons/Inactive.ico"
|
||||
ToolTipText="{Binding ElementName=txtToolTip, Path=Text}">
|
||||
|
||||
<tb:TaskbarIcon.TrayToolTip>
|
||||
|
||||
<!--
|
||||
Important: The attached property is assigned to the border!
|
||||
Important: The attached property is assigned to the border, but derived by all controls.
|
||||
The NotifyIcon does not touch the underlying controls.
|
||||
-->
|
||||
<Border
|
||||
@@ -59,10 +59,9 @@
|
||||
Height="40">
|
||||
<!-- Implicitly access the DataContext (which is a string this time)-->
|
||||
<TextBlock Text="{Binding}">
|
||||
<!-- Explicitly access the NotifyIcon -->
|
||||
<!-- Explicitly access the NotifyIcon, as it is an attached property -->
|
||||
<TextBlock
|
||||
Text="{Binding RelativeSource={RelativeSource FindAncestor,
|
||||
AncestorType={x:Type Border}},
|
||||
Text="{Binding RelativeSource={RelativeSource Self},
|
||||
Path=(tb:TaskbarIcon.ParentTaskbarIcon).ToolTipText}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
|
||||
Reference in New Issue
Block a user