private void OnStateChanged(object sender, object e) { switch (_viewModel.State) { case FlyoutViewState.Opening: var taskbar = WindowsTaskbar.Current; Show(); EnableAcrylicIfApplicable(taskbar); PositionWindowRelativeToTaskbar(taskbar); WindowAnimationLibrary.BeginWindowEntranceAnimation(this, () => { _viewModel.ChangeState(FlyoutViewState.Open); }); break; case FlyoutViewState.Closing_Stage1: WindowAnimationLibrary.BeginWindowExitAnimation(this, () => { this.Cloak(); AccentPolicyLibrary.DisableAcrylic(this); _viewModel.ChangeState(FlyoutViewState.Hidden); }); break; } }
private void OpenSettings() { if (_openSettingsWindow != null) { _openSettingsWindow.RaiseWindow(); } else { var viewModel = new SettingsViewModel(); viewModel.OpenAddonManager = new RelayCommand(() => { var window = new DialogWindow { Owner = _openSettingsWindow }; var addonManagerViewModel = new AddonManagerViewModel(AddonManager.Current); window.DataContext = addonManagerViewModel; window.ShowDialog(); }); _openSettingsWindow = new SettingsWindow(); _openSettingsWindow.DataContext = viewModel; _openSettingsWindow.Closing += (_, __) => _openSettingsWindow = null; _openSettingsWindow.Show(); WindowAnimationLibrary.BeginWindowEntranceAnimation(_openSettingsWindow, () => { }); } }
public static void ActivateSingleInstance() { if (Instance == null) { var window = new SettingsWindow(); window.Show(); WindowAnimationLibrary.BeginWindowEntranceAnimation(window, () => { }); } else { Instance.RaiseWindow(); } }
public static void ActivateSingleInstance(MainViewModel mainViewModel) { Trace.WriteLine("FullWindow ActivateSingleInstance"); if (Instance == null) { var window = new FullWindow(mainViewModel); window.Show(); WindowAnimationLibrary.BeginWindowEntranceAnimation(window, () => { }); } else { Instance.RaiseWindow(); } }
private void OpenMixer() { if (_openMixerWindow != null) { _openMixerWindow.RaiseWindow(); } else { var viewModel = new FullWindowViewModel(PlaybackDevicesViewModel); _openMixerWindow = new FullWindow(); _openMixerWindow.DataContext = viewModel; _openMixerWindow.Closing += (_, __) => { _openMixerWindow = null; viewModel.Close(); }; _openMixerWindow.Show(); WindowAnimationLibrary.BeginWindowEntranceAnimation(_openMixerWindow, () => { }); } }