private void OpenSettingPanel() { if (workingResources.IsSettingPanelOpen) { return; } SettingPanelBackground.Visibility = Visibility.Visible; SettingPanel.Visibility = Visibility.Visible; SettingPanelBackground.BeginAnimation(WidthProperty, null); SettingPanel.BeginAnimation(OpacityProperty, null); SettingPanel.Opacity = 1; DoubleAnimation slideInAnimation = new DoubleAnimation(0, 500, TimeSpan.FromSeconds(0.25), FillBehavior.HoldEnd); SettingPanelBackground.BeginAnimation(WidthProperty, slideInAnimation); workingResources.IsSettingPanelOpen = true; }
private void CommandBinding_Executed_1(object sender, ExecutedRoutedEventArgs e) { if (!workingResources.IsSettingPanelOpen) { return; } SettingPanelBackground.BeginAnimation(WidthProperty, null); SettingPanel.BeginAnimation(OpacityProperty, null); DoubleAnimation slideInAnimation = new DoubleAnimation(500, 0, TimeSpan.FromSeconds(0.25), FillBehavior.HoldEnd); DoubleAnimation fadeOut = new DoubleAnimation(1, 0, TimeSpan.FromSeconds(0.25), FillBehavior.HoldEnd); fadeOut.Completed += FadeOut_Completed; SettingPanelBackground.BeginAnimation(WidthProperty, slideInAnimation); SettingPanel.BeginAnimation(OpacityProperty, fadeOut); workingResources.IsSettingPanelOpen = false; }