コード例 #1
0
        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;
            }
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: yonatan-mitmit/EarTrumpet
 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, () => { });
     }
 }
コード例 #3
0
 public static void ActivateSingleInstance()
 {
     if (Instance == null)
     {
         var window = new SettingsWindow();
         window.Show();
         WindowAnimationLibrary.BeginWindowEntranceAnimation(window, () => { });
     }
     else
     {
         Instance.RaiseWindow();
     }
 }
コード例 #4
0
        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();
            }
        }
コード例 #5
0
ファイル: App.xaml.cs プロジェクト: yonatan-mitmit/EarTrumpet
 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, () => { });
     }
 }