mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-18 01:35:38 -05:00
Added .NET 5.0 and restructured the repository. (#47)
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<Window x:Class="NotifyIconWpf.Sample.ShowCases.Tutorials.MvvmSampleWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||
xmlns:tutorials="clr-namespace:NotifyIconWpf.Sample.ShowCases.Tutorials"
|
||||
Title="MvvmSampleWindow"
|
||||
Height="300"
|
||||
Width="300">
|
||||
<Window.DataContext>
|
||||
<tutorials:MvvmSampleViewModel />
|
||||
</Window.DataContext>
|
||||
<Grid>
|
||||
|
||||
|
||||
<!--
|
||||
the NotifyIcon automatically derives the DataContext of it's
|
||||
declaring view. Alternatively, you could just assign it manually
|
||||
-->
|
||||
<tb:TaskbarIcon IconSource="/Icons/Inactive.ico"
|
||||
ToolTipText="{Binding Timestamp}">
|
||||
<tb:TaskbarIcon.TrayPopup >
|
||||
<!-- the popup, here a custom user control, will also get the DataContext of the NotifyIcon -->
|
||||
<tutorials:ClockPopup Opacity="0.8" />
|
||||
</tb:TaskbarIcon.TrayPopup>
|
||||
</tb:TaskbarIcon>
|
||||
|
||||
|
||||
|
||||
<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."
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Margin="10,10,10,0" />
|
||||
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
Reference in New Issue
Block a user