2021-08-08 15:12:36 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
using System.Windows.Threading;
|
2021-08-13 23:20:38 +00:00
|
|
|
|
using System.Windows.Interop;
|
2021-08-27 17:49:57 +00:00
|
|
|
|
using System.Windows.Input;
|
2021-08-30 23:53:52 +00:00
|
|
|
|
using System.Windows.Controls.Primitives;
|
2022-11-13 14:58:30 +00:00
|
|
|
|
using System.Diagnostics;
|
2021-08-08 15:12:36 +00:00
|
|
|
|
|
|
|
|
|
namespace unison
|
|
|
|
|
{
|
2021-09-01 00:35:37 +00:00
|
|
|
|
public partial class MainWindow : Window
|
2021-08-08 15:12:36 +00:00
|
|
|
|
{
|
2021-09-01 00:35:37 +00:00
|
|
|
|
private readonly Settings _settingsWin;
|
2021-10-01 00:24:18 +00:00
|
|
|
|
private readonly Radios _radiosWin;
|
2022-11-13 14:58:30 +00:00
|
|
|
|
private readonly Shuffle _shuffleWin;
|
2021-09-01 00:35:37 +00:00
|
|
|
|
private readonly DispatcherTimer _timer;
|
|
|
|
|
private readonly MPDHandler _mpd;
|
2021-08-30 23:53:52 +00:00
|
|
|
|
|
2021-08-08 15:12:36 +00:00
|
|
|
|
public MainWindow()
|
|
|
|
|
{
|
2021-08-13 23:20:38 +00:00
|
|
|
|
InitHwnd();
|
2021-08-08 15:12:36 +00:00
|
|
|
|
InitializeComponent();
|
2021-09-02 17:47:55 +00:00
|
|
|
|
DefaultState(true);
|
2021-08-13 23:20:38 +00:00
|
|
|
|
WindowState = WindowState.Minimized;
|
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
_settingsWin = new Settings();
|
2021-10-01 00:24:18 +00:00
|
|
|
|
_radiosWin = new Radios();
|
2022-11-13 14:58:30 +00:00
|
|
|
|
_shuffleWin = new Shuffle();
|
2021-09-01 00:35:37 +00:00
|
|
|
|
_timer = new DispatcherTimer();
|
|
|
|
|
_mpd = (MPDHandler)Application.Current.Properties["mpd"];
|
2021-08-16 00:13:47 +00:00
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
_timer.Interval = TimeSpan.FromSeconds(0.5);
|
|
|
|
|
_timer.Tick += Timer_Tick;
|
|
|
|
|
_timer.Start();
|
2021-08-08 15:12:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-08-13 23:20:38 +00:00
|
|
|
|
private void Timer_Tick(object sender, EventArgs e)
|
2021-08-08 15:12:36 +00:00
|
|
|
|
{
|
2021-09-01 00:35:37 +00:00
|
|
|
|
if (_mpd.GetCurrentSong() == null)
|
2021-08-30 23:30:00 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
CurrentTime.Text = FormatSeconds(_mpd.GetCurrentTime());
|
|
|
|
|
TimeSlider.Value = _mpd.GetCurrentTime() / _mpd.GetCurrentSong().Time * 100;
|
2021-08-08 15:12:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-08-30 23:30:00 +00:00
|
|
|
|
public void OnConnectionChanged(object sender, EventArgs e)
|
2021-08-08 15:12:36 +00:00
|
|
|
|
{
|
2021-09-01 00:35:37 +00:00
|
|
|
|
if (_mpd.IsConnected())
|
2021-09-01 22:14:28 +00:00
|
|
|
|
{
|
2022-11-13 14:58:30 +00:00
|
|
|
|
_mpd.QueryStats();
|
|
|
|
|
_settingsWin.UpdateStats();
|
|
|
|
|
|
2021-09-02 17:47:55 +00:00
|
|
|
|
ConnectionOkIcon.Visibility = Visibility.Visible;
|
|
|
|
|
ConnectionFailIcon.Visibility = Visibility.Collapsed;
|
2022-04-18 17:22:12 +00:00
|
|
|
|
|
|
|
|
|
Snapcast.IsEnabled = true;
|
|
|
|
|
if (_radiosWin.IsConnected())
|
|
|
|
|
Radio.IsEnabled = true;
|
2022-11-13 14:58:30 +00:00
|
|
|
|
|
|
|
|
|
_shuffleWin.Initialize();
|
2021-09-01 22:14:28 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_timer.Stop();
|
2021-09-02 17:47:55 +00:00
|
|
|
|
DefaultState(true);
|
|
|
|
|
ConnectionOkIcon.Visibility = Visibility.Collapsed;
|
|
|
|
|
ConnectionFailIcon.Visibility = Visibility.Visible;
|
2022-04-18 17:22:12 +00:00
|
|
|
|
|
|
|
|
|
Snapcast.IsEnabled = false;
|
|
|
|
|
Radio.IsEnabled = false;
|
2021-09-01 22:14:28 +00:00
|
|
|
|
}
|
|
|
|
|
_settingsWin.UpdateConnectionStatus();
|
2021-09-02 17:47:55 +00:00
|
|
|
|
Connection.Text = $"{Properties.Settings.Default.mpd_host}:{Properties.Settings.Default.mpd_port}";
|
2021-08-30 23:30:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-13 14:58:30 +00:00
|
|
|
|
public async void OnSongChanged(object sender, EventArgs e)
|
2021-08-30 23:30:00 +00:00
|
|
|
|
{
|
2021-09-01 00:35:37 +00:00
|
|
|
|
if (_mpd.GetCurrentSong() == null)
|
2021-08-28 22:32:41 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2021-09-01 08:21:52 +00:00
|
|
|
|
if (_mpd.GetCurrentSong().HasTitle && _mpd.GetCurrentSong().Title.Length > 0)
|
2021-09-01 00:35:37 +00:00
|
|
|
|
SongTitle.Text = _mpd.GetCurrentSong().Title;
|
2021-09-01 08:21:52 +00:00
|
|
|
|
else if (_mpd.GetCurrentSong().HasName && _mpd.GetCurrentSong().Name.Length > 0)
|
2021-09-01 00:35:37 +00:00
|
|
|
|
SongTitle.Text = _mpd.GetCurrentSong().Name;
|
2021-10-03 11:54:54 +00:00
|
|
|
|
else if (_mpd.GetCurrentSong().Path != null)
|
2021-09-01 08:21:52 +00:00
|
|
|
|
{
|
|
|
|
|
int start = _mpd.GetCurrentSong().Path.LastIndexOf("/") + 1;
|
|
|
|
|
int end = _mpd.GetCurrentSong().Path.LastIndexOf(".");
|
2021-10-03 11:54:54 +00:00
|
|
|
|
if (start > 0 && end > 0 && end > start)
|
|
|
|
|
SongTitle.Text = _mpd.GetCurrentSong().Path.Substring(start, end - start);
|
2021-09-01 08:21:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
SongTitle.ToolTip = _mpd.GetCurrentSong().Path;
|
|
|
|
|
SongArtist.Text = _mpd.GetCurrentSong().Artist;
|
|
|
|
|
SongAlbum.Text = _mpd.GetCurrentSong().Album;
|
2021-08-30 23:30:00 +00:00
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
if (_mpd.GetCurrentSong().Date != null)
|
2022-04-07 11:41:18 +00:00
|
|
|
|
SongAlbum.Text += $" ({_mpd.GetCurrentSong().Date.Split("-")[0]})";
|
2021-08-28 22:32:41 +00:00
|
|
|
|
|
2021-09-01 08:21:52 +00:00
|
|
|
|
SongGenre.Text = _mpd.GetCurrentSong().Genre;
|
|
|
|
|
SongFormat.Text = _mpd.GetCurrentSong().Path.Substring(_mpd.GetCurrentSong().Path.LastIndexOf(".") + 1);
|
|
|
|
|
if (SongGenre.Text.Length == 0 || SongFormat.Text.Length == 0)
|
|
|
|
|
SongInfoDash.Text = "";
|
|
|
|
|
else
|
|
|
|
|
SongInfoDash.Text = " – ";
|
|
|
|
|
|
|
|
|
|
TimeSlider.IsEnabled = true;
|
2021-09-01 00:35:37 +00:00
|
|
|
|
if (_mpd.GetCurrentSong().Time == -1)
|
|
|
|
|
{
|
|
|
|
|
CurrentTime.Text = "";
|
|
|
|
|
EndTime.Text = "";
|
|
|
|
|
_timer.Stop();
|
|
|
|
|
TimeSlider.Value = 50;
|
|
|
|
|
TimeSlider.IsEnabled = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (!_timer.IsEnabled)
|
|
|
|
|
_timer.Start();
|
|
|
|
|
EndTime.Text = FormatSeconds(_mpd.GetCurrentSong().Time);
|
|
|
|
|
}
|
2022-11-13 14:58:30 +00:00
|
|
|
|
|
|
|
|
|
Trace.WriteLine("Song changed called!");
|
|
|
|
|
|
|
|
|
|
if (_shuffleWin.GetContinuous())
|
|
|
|
|
{
|
|
|
|
|
_mpd.CanPrevNext = false;
|
|
|
|
|
await _shuffleWin.HandleContinuous();
|
|
|
|
|
_mpd.CanPrevNext = true;
|
|
|
|
|
}
|
2021-08-30 23:30:00 +00:00
|
|
|
|
}
|
2021-08-28 22:32:41 +00:00
|
|
|
|
|
2021-08-30 23:30:00 +00:00
|
|
|
|
public void OnStatusChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
2021-09-01 00:35:37 +00:00
|
|
|
|
if (_mpd.GetStatus() == null)
|
2021-08-30 23:30:00 +00:00
|
|
|
|
return;
|
2021-08-08 15:12:36 +00:00
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
if (VolumeSlider.Value != _mpd.GetStatus().Volume)
|
2021-08-08 15:12:36 +00:00
|
|
|
|
{
|
2021-09-01 00:35:37 +00:00
|
|
|
|
VolumeSlider.Value = _mpd.GetStatus().Volume;
|
|
|
|
|
VolumeSlider.ToolTip = _mpd.GetStatus().Volume;
|
2021-08-08 15:12:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-09-01 08:21:52 +00:00
|
|
|
|
UpdateButton(ref BorderRandom, _mpd.GetStatus().Random);
|
|
|
|
|
UpdateButton(ref BorderRepeat, _mpd.GetStatus().Repeat);
|
|
|
|
|
UpdateButton(ref BorderSingle, _mpd.GetStatus().Single);
|
|
|
|
|
UpdateButton(ref BorderConsume, _mpd.GetStatus().Consume);
|
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
if (_mpd.IsPlaying())
|
2021-09-02 17:47:55 +00:00
|
|
|
|
PlayPause.Text = (string)Application.Current.FindResource("playButton");
|
2021-08-16 00:13:47 +00:00
|
|
|
|
else
|
2021-09-01 08:21:52 +00:00
|
|
|
|
{
|
2021-09-02 17:47:55 +00:00
|
|
|
|
PlayPause.Text = (string)Application.Current.FindResource("pauseButton");
|
2021-09-01 08:21:52 +00:00
|
|
|
|
if (_mpd.GetStatus().State == MpcNET.MpdState.Stop)
|
|
|
|
|
{
|
|
|
|
|
DefaultState();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-08-08 15:12:36 +00:00
|
|
|
|
|
2021-09-02 17:47:55 +00:00
|
|
|
|
private void DefaultState(bool LostConnection = false)
|
2021-09-01 08:21:52 +00:00
|
|
|
|
{
|
|
|
|
|
SongTitle.Text = "";
|
|
|
|
|
SongArtist.Text = "";
|
|
|
|
|
SongAlbum.Text = "";
|
|
|
|
|
SongGenre.Text = "";
|
|
|
|
|
SongInfoDash.Text = "";
|
|
|
|
|
SongFormat.Text = "";
|
|
|
|
|
CurrentTime.Text = "";
|
|
|
|
|
EndTime.Text = "";
|
2021-09-02 17:47:55 +00:00
|
|
|
|
PlayPause.Text = (string)Application.Current.FindResource("pauseButton");
|
2021-09-01 08:21:52 +00:00
|
|
|
|
TimeSlider.Value = 50;
|
|
|
|
|
TimeSlider.IsEnabled = false;
|
2022-04-18 21:37:49 +00:00
|
|
|
|
NoCover.Visibility = Visibility.Collapsed;
|
2021-09-01 08:21:52 +00:00
|
|
|
|
Cover.Visibility = Visibility.Collapsed;
|
2022-04-18 21:37:49 +00:00
|
|
|
|
RadioCover.Visibility = Visibility.Collapsed;
|
2021-09-02 17:47:55 +00:00
|
|
|
|
|
|
|
|
|
if (LostConnection)
|
|
|
|
|
{
|
|
|
|
|
ConnectionOkIcon.Visibility = Visibility.Collapsed;
|
|
|
|
|
ConnectionFailIcon.Visibility = Visibility.Visible;
|
|
|
|
|
}
|
|
|
|
|
Connection.Text = $"{Properties.Settings.Default.mpd_host}:{Properties.Settings.Default.mpd_port}";
|
2021-08-30 23:30:00 +00:00
|
|
|
|
}
|
2021-08-19 20:00:25 +00:00
|
|
|
|
|
2021-08-30 23:30:00 +00:00
|
|
|
|
public void OnCoverChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
2022-04-18 21:37:49 +00:00
|
|
|
|
NoCover.Visibility = Visibility.Collapsed;
|
|
|
|
|
Cover.Visibility = Visibility.Collapsed;
|
|
|
|
|
RadioCover.Visibility = Visibility.Collapsed;
|
|
|
|
|
|
|
|
|
|
if (_mpd.GetCurrentSong().Time == -1)
|
|
|
|
|
RadioCover.Visibility = Visibility.Visible;
|
|
|
|
|
else if (_mpd.GetCover() == null)
|
2021-08-28 22:32:41 +00:00
|
|
|
|
NoCover.Visibility = Visibility.Visible;
|
2021-09-01 00:35:37 +00:00
|
|
|
|
else if (Cover.Source != _mpd.GetCover())
|
2021-08-28 22:32:41 +00:00
|
|
|
|
{
|
2021-09-01 00:35:37 +00:00
|
|
|
|
Cover.Source = _mpd.GetCover();
|
2021-08-28 22:32:41 +00:00
|
|
|
|
Cover.Visibility = Visibility.Visible;
|
|
|
|
|
}
|
2021-08-30 23:30:00 +00:00
|
|
|
|
}
|
2021-08-28 22:32:41 +00:00
|
|
|
|
|
2021-08-30 23:30:00 +00:00
|
|
|
|
public void OnSnapcastChanged()
|
|
|
|
|
{
|
2021-08-28 22:32:41 +00:00
|
|
|
|
SnapcastHandler snapcast = (SnapcastHandler)Application.Current.Properties["snapcast"];
|
2021-09-01 00:35:37 +00:00
|
|
|
|
if (snapcast.HasStarted)
|
2021-09-02 17:47:55 +00:00
|
|
|
|
SnapcastText.Text = unison.Resources.Resources.StopSnapcast;
|
2021-08-28 22:32:41 +00:00
|
|
|
|
else
|
2021-09-02 17:47:55 +00:00
|
|
|
|
SnapcastText.Text = unison.Resources.Resources.StartSnapcast;
|
2021-08-08 15:12:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
public void UpdateButton(ref Border border, bool b)
|
|
|
|
|
{
|
|
|
|
|
border.Style = b ? (Style)Resources["SelectedButton"] : (Style)Resources["UnselectedButton"];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string FormatSeconds(int time)
|
|
|
|
|
{
|
|
|
|
|
TimeSpan timespan = TimeSpan.FromSeconds(time);
|
|
|
|
|
return timespan.ToString(@"mm\:ss");
|
|
|
|
|
}
|
|
|
|
|
public string FormatSeconds(double time)
|
|
|
|
|
{
|
|
|
|
|
TimeSpan timespan = TimeSpan.FromSeconds(time);
|
|
|
|
|
return timespan.ToString(@"mm\:ss");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Pause_Clicked(object sender, RoutedEventArgs e) => _mpd.PlayPause();
|
|
|
|
|
public void Previous_Clicked(object sender, RoutedEventArgs e) => _mpd.Prev();
|
|
|
|
|
public void Next_Clicked(object sender, RoutedEventArgs e) => _mpd.Next();
|
|
|
|
|
public void Random_Clicked(object sender, RoutedEventArgs e) => _mpd.Random();
|
|
|
|
|
public void Repeat_Clicked(object sender, RoutedEventArgs e) => _mpd.Repeat();
|
|
|
|
|
public void Single_Clicked(object sender, RoutedEventArgs e) => _mpd.Single();
|
|
|
|
|
public void Consume_Clicked(object sender, RoutedEventArgs e) => _mpd.Consume();
|
|
|
|
|
public void ChangeVolume(int value) => _mpd.SetVolume(value);
|
2021-08-08 22:51:06 +00:00
|
|
|
|
|
2021-08-13 23:20:38 +00:00
|
|
|
|
public void Snapcast_Clicked(object sender, RoutedEventArgs e)
|
2021-08-08 15:12:36 +00:00
|
|
|
|
{
|
2021-08-13 23:20:38 +00:00
|
|
|
|
SnapcastHandler snapcast = (SnapcastHandler)Application.Current.Properties["snapcast"];
|
2021-09-01 00:35:37 +00:00
|
|
|
|
snapcast.LaunchOrExit();
|
2021-08-13 23:20:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-10-03 11:54:54 +00:00
|
|
|
|
public void Radios_Clicked(object sender, RoutedEventArgs e)
|
2021-10-01 00:24:18 +00:00
|
|
|
|
{
|
|
|
|
|
_radiosWin.Show();
|
|
|
|
|
_radiosWin.Activate();
|
|
|
|
|
|
|
|
|
|
if (_radiosWin.WindowState == WindowState.Minimized)
|
|
|
|
|
_radiosWin.WindowState = WindowState.Normal;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-13 14:58:30 +00:00
|
|
|
|
public void Shuffle_Clicked(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
_shuffleWin.Show();
|
|
|
|
|
_shuffleWin.Activate();
|
|
|
|
|
|
|
|
|
|
if (_shuffleWin.WindowState == WindowState.Minimized)
|
|
|
|
|
_shuffleWin.WindowState = WindowState.Normal;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-13 23:20:38 +00:00
|
|
|
|
public void Settings_Clicked(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2021-09-01 00:35:37 +00:00
|
|
|
|
_settingsWin.Show();
|
|
|
|
|
_settingsWin.Activate();
|
2021-08-14 23:29:16 +00:00
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
if (_settingsWin.WindowState == WindowState.Minimized)
|
|
|
|
|
_settingsWin.WindowState = WindowState.Normal;
|
2021-08-08 15:12:36 +00:00
|
|
|
|
}
|
2021-08-08 22:51:06 +00:00
|
|
|
|
|
2021-08-30 23:53:52 +00:00
|
|
|
|
private void TimeSlider_DragStarted(object sender, DragStartedEventArgs e)
|
|
|
|
|
{
|
2021-09-01 00:35:37 +00:00
|
|
|
|
_timer.Stop();
|
2021-08-30 23:53:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-08-27 17:49:57 +00:00
|
|
|
|
private void TimeSlider_DragCompleted(object sender, MouseButtonEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Slider slider = (Slider)sender;
|
|
|
|
|
|
|
|
|
|
double SongPercentage = slider.Value;
|
2021-09-01 00:35:37 +00:00
|
|
|
|
double SongTime = _mpd.GetCurrentSong().Time;
|
2021-08-27 17:49:57 +00:00
|
|
|
|
double SeekTime = SongPercentage / 100 * SongTime;
|
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
_mpd.SetTime(SeekTime);
|
|
|
|
|
_timer.Start();
|
2021-08-27 17:49:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void VolumeSlider_DragCompleted(object sender, MouseButtonEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Slider slider = (Slider)sender;
|
2021-09-01 00:35:37 +00:00
|
|
|
|
_mpd.SetVolume((int)slider.Value);
|
|
|
|
|
slider.ToolTip = (int)slider.Value;
|
2021-08-27 17:49:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-11-06 14:44:53 +00:00
|
|
|
|
public void UpdateUpdateStatus(string version)
|
|
|
|
|
{
|
|
|
|
|
_settingsWin.UpdateUpdateStatus(version);
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-08 22:51:06 +00:00
|
|
|
|
protected override void OnSourceInitialized(EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnSourceInitialized(e);
|
2021-08-13 23:20:38 +00:00
|
|
|
|
HotkeyHandler hk = (HotkeyHandler)Application.Current.Properties["hotkeys"];
|
|
|
|
|
hk.Activate(this);
|
2021-08-08 22:51:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-10-04 18:01:50 +00:00
|
|
|
|
private void MouseDownClipboard(object sender, MouseButtonEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (e.ClickCount == 2)
|
|
|
|
|
{
|
|
|
|
|
string CopyText = SongTitle.Text + " - " + SongArtist.Text + "\n";
|
|
|
|
|
CopyText += SongAlbum.Text + "\n";
|
|
|
|
|
CopyText += SongTitle.ToolTip;
|
|
|
|
|
Clipboard.SetText(CopyText);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-13 23:20:38 +00:00
|
|
|
|
public void InitHwnd()
|
2021-08-08 22:51:06 +00:00
|
|
|
|
{
|
2021-08-13 23:20:38 +00:00
|
|
|
|
WindowInteropHelper helper = new(this);
|
|
|
|
|
helper.EnsureHandle();
|
2021-08-08 22:51:06 +00:00
|
|
|
|
}
|
2021-08-19 20:00:25 +00:00
|
|
|
|
|
2021-09-01 00:35:37 +00:00
|
|
|
|
private void Window_Closing(object sender, CancelEventArgs e)
|
2021-08-19 20:00:25 +00:00
|
|
|
|
{
|
2021-09-01 00:35:37 +00:00
|
|
|
|
e.Cancel = true;
|
|
|
|
|
WindowState = WindowState.Minimized;
|
|
|
|
|
Hide();
|
2021-08-19 20:00:25 +00:00
|
|
|
|
}
|
2021-08-08 15:12:36 +00:00
|
|
|
|
}
|
|
|
|
|
}
|