Snapcast text notify working
This commit is contained in:
parent
60ca1b6e9a
commit
89ddb81840
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
@ -18,6 +19,13 @@ namespace unison
|
|||||||
Start();
|
Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UpdateSystray()
|
||||||
|
{
|
||||||
|
TaskbarIcon Systray = (TaskbarIcon)Application.Current.Properties["systray"];
|
||||||
|
SystrayViewModel DataContext = Systray.DataContext as SystrayViewModel;
|
||||||
|
DataContext.OnPropertyChanged("SnapcastText");
|
||||||
|
}
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
if (!Started)
|
if (!Started)
|
||||||
@ -37,11 +45,13 @@ namespace unison
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Started = true;
|
Started = true;
|
||||||
|
UpdateSystray();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_snapcast.Kill();
|
_snapcast.Kill();
|
||||||
Started = false;
|
Started = false;
|
||||||
|
UpdateSystray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,6 +61,7 @@ namespace unison
|
|||||||
{
|
{
|
||||||
_snapcast.Kill();
|
_snapcast.Kill();
|
||||||
Started = false;
|
Started = false;
|
||||||
|
UpdateSystray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ namespace unison
|
|||||||
CanExecuteFunc = () => true
|
CanExecuteFunc = () => true
|
||||||
};
|
};
|
||||||
|
|
||||||
public static string SnapcastText
|
public string SnapcastText
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -75,7 +75,7 @@ namespace unison
|
|||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
protected virtual void OnPropertyChanged(string propertyName)
|
public virtual void OnPropertyChanged(string propertyName)
|
||||||
{
|
{
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user