CmdPal: Extension Gallery - Move storyboards used to show/hide breadcrumbs to XAML#47900
Open
jiripolasek wants to merge 2 commits into
Open
Conversation
10 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the CmdPal settings window breadcrumb show/hide animations by moving the storyboard definitions from code-behind into SettingsWindow.xaml resources, and updating navigation handling to decide whether breadcrumbs should be visible per page.
Changes:
- Added XAML
Storyboardresources for breadcrumb fade-in and fade-out (including visibility collapse). - Updated
SettingsWindow.xaml.csto fetch and use those storyboard resources instead of constructing animations in code. - Refactored navigation logic to compute
shouldShowBreadcrumband invoke show/hide once per navigation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/SettingsWindow.xaml.cs | Uses XAML-defined storyboards for breadcrumb transitions and refactors breadcrumb visibility logic on navigation. |
| src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/SettingsWindow.xaml | Adds storyboard resources for breadcrumb fade-in/fade-out and collapsing visibility. |
Comment on lines
336
to
346
| private void ShowBreadcrumb() | ||
| { | ||
| _breadcrumbStoryboard?.Stop(); | ||
| _breadcrumbStoryboard = null; | ||
| _breadcrumbFadeInStoryboard.Stop(); | ||
| _breadcrumbFadeOutStoryboard.Stop(); | ||
|
|
||
| if (BreadcrumbContainer.Visibility == Visibility.Collapsed) | ||
| { | ||
| BreadcrumbContainer.Opacity = 0; | ||
| BreadcrumbContainer.Visibility = Visibility.Visible; | ||
|
|
||
| var fadeIn = new DoubleAnimation | ||
| { | ||
| To = 1, | ||
| Duration = new Duration(TimeSpan.FromMilliseconds(250)), | ||
| EasingFunction = new CubicEase { EasingMode = EasingMode.EaseOut }, | ||
| }; | ||
| Storyboard.SetTarget(fadeIn, BreadcrumbContainer); | ||
| Storyboard.SetTargetProperty(fadeIn, "Opacity"); | ||
|
|
||
| _breadcrumbStoryboard = new Storyboard(); | ||
| _breadcrumbStoryboard.Children.Add(fadeIn); | ||
| _breadcrumbStoryboard.Completed += (_, _) => _breadcrumbStoryboard = null; | ||
| _breadcrumbStoryboard.Begin(); | ||
| _breadcrumbFadeInStoryboard.Begin(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
This PR moves storyboard that handles showing and hiding breadcrumbs in Settings windows to a XAML resources.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed