mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Profile editor - Fixed play on focus loss functionality
This commit is contained in:
1 parent
b82db7f453
commit
563389cab6
8 files changed
+124
-4
No files matched your search
@@ -157,6 +157,9 @@ public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvi
|
||||
/// <inheritdoc />
|
||||
public bool IsMainWindowOpen => _lifeTime.MainWindow != null;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsMainWindowFocused { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void OpenMainWindow()
|
||||
{
|
||||
@@ -181,12 +184,30 @@ public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvi
|
||||
{
|
||||
Dispatcher.UIThread.Post(() => { _lifeTime.MainWindow?.Close(); });
|
||||
}
|
||||
|
||||
public void Focused()
|
||||
{
|
||||
IsMainWindowFocused = true;
|
||||
OnMainWindowFocused();
|
||||
}
|
||||
|
||||
public void Unfocused()
|
||||
{
|
||||
IsMainWindowFocused = false;
|
||||
OnMainWindowUnfocused();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public event EventHandler? MainWindowOpened;
|
||||
|
||||
/// <inheritdoc />
|
||||
public event EventHandler? MainWindowClosed;
|
||||
|
||||
/// <inheritdoc />
|
||||
public event EventHandler? MainWindowFocused;
|
||||
|
||||
/// <inheritdoc />
|
||||
public event EventHandler? MainWindowUnfocused;
|
||||
|
||||
protected virtual void OnMainWindowOpened()
|
||||
{
|
||||
@@ -197,6 +218,16 @@ public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvi
|
||||
{
|
||||
MainWindowClosed?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
protected virtual void OnMainWindowFocused()
|
||||
{
|
||||
MainWindowFocused?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
protected virtual void OnMainWindowUnfocused()
|
||||
{
|
||||
MainWindowUnfocused?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user