Core - Added fading in and out of profiles

This commit is contained in:
Diogo Trindade committed 2022-11-27 15:20:17 +00:00
1 parent f30cc31ead
commit 194780b25c
6 files changed
+87 -3

No files matched your search

@@ -127,6 +127,9 @@
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
<CheckBox VerticalAlignment="Bottom" IsChecked="{CompiledBinding FadeInAndOut}" ToolTip.Tip="Smoothly animates in and out when the profile activation conditions change.">Fade when enabling and disabling</CheckBox>
</StackPanel>
</Border>
@@ -30,6 +30,7 @@ public class ProfileConfigurationEditViewModel : DialogViewModelBase<ProfileConf
private readonly IWindowService _windowService;
private Hotkey? _disableHotkey;
private Hotkey? _enableHotkey;
private bool _fadeInAndOut;
private ProfileConfigurationHotkeyMode _hotkeyMode;
private ProfileConfigurationIconType _iconType;
private ObservableCollection<ProfileIconViewModel>? _materialIcons;
@@ -57,6 +58,7 @@ public class ProfileConfigurationEditViewModel : DialogViewModelBase<ProfileConf
_profileName = _profileConfiguration.Name;
_iconType = _profileConfiguration.Icon.IconType;
_hotkeyMode = _profileConfiguration.HotkeyMode;
_fadeInAndOut = _profileConfiguration.FadeInAndOut;
if (_profileConfiguration.EnableHotkey != null)
_enableHotkey = new Hotkey {Key = _profileConfiguration.EnableHotkey.Key, Modifiers = _profileConfiguration.EnableHotkey.Modifiers};
if (_profileConfiguration.DisableHotkey != null)
@@ -117,6 +119,12 @@ public class ProfileConfigurationEditViewModel : DialogViewModelBase<ProfileConf
set => RaiseAndSetIfChanged(ref _disableHotkey, value);
}
public bool FadeInAndOut
{
get => _fadeInAndOut;
set => RaiseAndSetIfChanged(ref _fadeInAndOut, value);
}
public ObservableCollection<ProfileModuleViewModel?> Modules { get; }
public ProfileModuleViewModel? SelectedModule
@@ -155,6 +163,7 @@ public class ProfileConfigurationEditViewModel : DialogViewModelBase<ProfileConf
ProfileConfiguration.HotkeyMode = HotkeyMode;
ProfileConfiguration.EnableHotkey = EnableHotkey;
ProfileConfiguration.DisableHotkey = DisableHotkey;
ProfileConfiguration.FadeInAndOut = FadeInAndOut;
await SaveIcon();