Compare commits

..

No commits in common. "fc7ad1ec22a4213f843cdf11d1adc096a712c33a" and "c95094a003316704de590e9de6e6004ec8ed2153" have entirely different histories.

3 changed files with 46 additions and 40 deletions

View File

@ -121,5 +121,6 @@
</Button> </Button>
</StackPanel> </StackPanel>
</Grid> </Grid>
<Image Margin="0,0,503,127" Stretch="Fill" Source="pack://siteoforigin:,,,/Image1.png"/>
</Grid> </Grid>
</Window> </Window>

View File

@ -1,48 +1,49 @@
<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:emoji="clr-namespace:Emoji.Wpf;assembly=Emoji.Wpf"
xmlns:local="clr-namespace:unison"> xmlns:local="clr-namespace:unison">
<ContextMenu x:Shared="false" x:Key="SystrayMenu"> <tb:TaskbarIcon x:Name="SystrayTaskbar" xmlns:emoji="clr-namespace:Emoji.Wpf;assembly=Emoji.Wpf"
<MenuItem IsEnabled="False"> IconSource="/images/unison.ico" ToolTipText="{Binding GetAppText}" DoubleClickCommand="{Binding ShowWindowCommand}" x:Key="SystrayTaskbar">
<MenuItem.Icon> <tb:TaskbarIcon.ContextMenu>
<Image Source="/images/unison.ico" Width="16" Height="16"/> <ContextMenu>
</MenuItem.Icon> <MenuItem IsEnabled="False">
<MenuItem.Header> <MenuItem.Icon>
<TextBlock Text="{Binding GetAppText}" /> <Image Source="/images/unison.ico" Width="16" Height="16"/>
</MenuItem.Header> </MenuItem.Icon>
</MenuItem> <MenuItem.Header>
<Separator /> <TextBlock Text="{Binding GetAppText}" />
<MenuItem Header="Show window" Command="{Binding ShowWindowCommand}"> </MenuItem.Header>
<MenuItem.Icon> </MenuItem>
<Image Width="16" Height="16" emoji:Image.Source="▶️" /> <Separator />
</MenuItem.Icon> <MenuItem Header="Show window" Command="{Binding ShowWindowCommand}">
</MenuItem> <MenuItem.Icon>
<MenuItem Name="test_snapcast_item" Header="{Binding SnapcastText}" Command="{Binding Snapcast}"> <Image Width="16" Height="16" emoji:Image.Source="▶️" />
<MenuItem.Icon> </MenuItem.Icon>
<Image Width="16" Height="16" emoji:Image.Source="🔊" /> </MenuItem>
</MenuItem.Icon> <MenuItem Name="test_snapcast_item" Header="{Binding SnapcastText}" Command="{Binding Snapcast}">
</MenuItem> <MenuItem.Icon>
<!--<MenuItem Header="Shuffle" Command="{Binding Shuffle}"> <Image Width="16" Height="16" emoji:Image.Source="🔊" />
<MenuItem.Icon> </MenuItem.Icon>
<Image Width="16" Height="16" emoji:Image.Source="🔀" /> </MenuItem>
</MenuItem.Icon> <!--<MenuItem Header="Shuffle" Command="{Binding Shuffle}">
</MenuItem>--> <MenuItem.Icon>
<MenuItem Header="Settings" Command="{Binding Settings}"> <Image Width="16" Height="16" emoji:Image.Source="🔀" />
<MenuItem.Icon> </MenuItem.Icon>
<Image Width="16" Height="16" emoji:Image.Source="🛠️" /> </MenuItem>-->
</MenuItem.Icon> <MenuItem Header="Settings" Command="{Binding Settings}">
</MenuItem> <MenuItem.Icon>
<Separator /> <Image Width="16" Height="16" emoji:Image.Source="🛠️" />
<MenuItem Header="Exit" Command="{Binding ExitApplicationCommand}"> </MenuItem.Icon>
<MenuItem.Icon> </MenuItem>
<Image Width="16" Height="16" emoji:Image.Source="❌" /> <Separator />
</MenuItem.Icon> <MenuItem Header="Exit" Command="{Binding ExitApplicationCommand}">
</MenuItem> <MenuItem.Icon>
</ContextMenu> <Image Width="16" Height="16" emoji:Image.Source="❌" />
</MenuItem.Icon>
<tb:TaskbarIcon x:Key="SystrayTaskbar" IconSource="/images/unison.ico" ToolTipText="{Binding GetAppText}" DoubleClickCommand="{Binding ShowWindowCommand}" ContextMenu="{StaticResource SystrayMenu}"> </MenuItem>
</ContextMenu>
</tb:TaskbarIcon.ContextMenu>
<tb:TaskbarIcon.DataContext> <tb:TaskbarIcon.DataContext>
<local:SystrayViewModel /> <local:SystrayViewModel />
</tb:TaskbarIcon.DataContext> </tb:TaskbarIcon.DataContext>

View File

@ -8,6 +8,10 @@ namespace unison
{ {
public class SystrayViewModel : INotifyPropertyChanged public class SystrayViewModel : INotifyPropertyChanged
{ {
public SystrayViewModel()
{
}
public string GetAppText => "unison v" + Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion; public string GetAppText => "unison v" + Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
public ICommand ShowWindowCommand => new DelegateCommand public ICommand ShowWindowCommand => new DelegateCommand