mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-24 09:45:41 -05:00
WPF NotifyIcon
-------------- CHG Remove PlacementTarget assignment for popups and others. Did not provide advantages, but hid popups if taskbar owner isn't visible. ADD Added double click command declaration. git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@83 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
@@ -72,6 +72,7 @@
|
||||
Language="de-ch" /></TextBlock>
|
||||
<Button
|
||||
Click="OnButtonClick"
|
||||
ToolTip="{Binding Path=ToolTipText}"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
Width="89"
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
xmlns:local="clr-namespace:Sample_Project" MinWidth="750" MinHeight="800">
|
||||
xmlns:local="clr-namespace:Sample_Project"
|
||||
xmlns:Commands="clr-namespace:Sample_Project.Commands" MinWidth="750" MinHeight="800">
|
||||
<Window.Resources>
|
||||
|
||||
<BooleanToVisibilityConverter
|
||||
@@ -63,7 +64,9 @@
|
||||
ToolTipText="{Binding Path=Text, ElementName=txtToolTipText, Mode=Default}"
|
||||
Visibility="{Binding Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=iconVisibility, Mode=Default}"
|
||||
MenuActivation="{Binding Path=SelectedItem, ElementName=lstMenuTrigger, Mode=Default}"
|
||||
PopupActivation="{Binding Path=SelectedItem, ElementName=lstPopupTrigger, Mode=Default}">
|
||||
PopupActivation="{Binding Path=SelectedItem, ElementName=lstPopupTrigger, Mode=Default}"
|
||||
DoubleClickCommand="{Binding Source={x:Static Commands:TaskbarIconCommands.ShowMain}}"
|
||||
>
|
||||
|
||||
<tb:TaskbarIcon.TrayPopup>
|
||||
<!-- the control will be put into a popup with an explicit DataContext -->
|
||||
@@ -141,10 +144,11 @@
|
||||
Margin="125,0,17,133"
|
||||
x:Name="txtBalloonTitle"
|
||||
VerticalAlignment="Bottom"
|
||||
Height="23" />
|
||||
Height="23">WPF NotifyIcon</TextBox>
|
||||
<TextBox
|
||||
Margin="125,0,17,76"
|
||||
x:Name="txtBalloonText" AcceptsReturn="True" Height="47" VerticalAlignment="Bottom" d:LayoutOverrides="VerticalAlignment" />
|
||||
x:Name="txtBalloonText" AcceptsReturn="True" Height="47" VerticalAlignment="Bottom" d:LayoutOverrides="VerticalAlignment"
|
||||
TextWrapping="Wrap">You should see a grey LED icon in your system tray. This is your NotifyIcon</TextBox>
|
||||
<RadioButton
|
||||
HorizontalAlignment="Left"
|
||||
Margin="14,0,0,54"
|
||||
@@ -377,7 +381,7 @@
|
||||
<Border HorizontalAlignment="Stretch" Width="Auto" BorderThickness="2,2,2,2" BorderBrush="#FF000000"/>
|
||||
<Button Content="Display Message" x:Name="showCustomBalloon"
|
||||
Click="showCustomBalloon_Click" HorizontalAlignment="Right" Margin="0,0,24.377,10.52" Width="107.623" Height="23" VerticalAlignment="Bottom" />
|
||||
<TextBox VerticalAlignment="Bottom" Height="23" Text="Balloon Title" TextWrapping="Wrap" Margin="10,0,173,10" x:Name="customBalloonTitle"/>
|
||||
<TextBox VerticalAlignment="Bottom" Height="23" Text="WPF Balloon" TextWrapping="Wrap" Margin="10,0,173,10" x:Name="customBalloonTitle"/>
|
||||
<TextBlock Margin="10,10,24.377,0" VerticalAlignment="Top" TextWrapping="Wrap"><Run Text="Custom Balloon Tips are more flexible then standard tips when it comes to styling..." Language="de-ch"/></TextBlock>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -12,6 +12,13 @@ namespace Sample_Project
|
||||
public Window1()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
Loaded += delegate
|
||||
{
|
||||
//show balloon at startup, pointing to the icon
|
||||
showBalloonTip_Click(null, null);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user