Skip to content

Commit a5dcccd

Browse files
authored
Merge branch 'dev' into PrimaryMonitor
2 parents 55b247f + f2717be commit a5dcccd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
using ModernWpf.Controls;
2626
using Key = System.Windows.Input.Key;
2727
using System.Threading;
28+
using System.Media;
29+
2830

2931
namespace Flow.Launcher
3032
{
@@ -38,8 +40,8 @@ public partial class MainWindow
3840
private NotifyIcon _notifyIcon;
3941
private ContextMenu contextMenu;
4042
private MainViewModel _viewModel;
41-
private readonly MediaPlayer animationSound = new();
4243
private bool _animating;
44+
SoundPlayer animationSound = new SoundPlayer(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav");
4345

4446
#endregion
4547

@@ -50,8 +52,7 @@ public MainWindow(Settings settings, MainViewModel mainVM)
5052
_settings = settings;
5153

5254
InitializeComponent();
53-
InitializePosition();
54-
animationSound.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav"));
55+
InitializePosition();
5556
}
5657

5758
public MainWindow()
@@ -115,7 +116,6 @@ private void OnLoaded(object sender, RoutedEventArgs _)
115116
{
116117
if (_settings.UseSound)
117118
{
118-
animationSound.Position = TimeSpan.Zero;
119119
animationSound.Play();
120120
}
121121
UpdatePosition();

0 commit comments

Comments
 (0)