Skip to content

Commit

Permalink
Replace remaning references to ribbon to TabbedCommandBar (#3890)
Browse files Browse the repository at this point in the history
<!-- 🚨 Please Do Not skip any instructions and information mentioned below as they are all required and essential to evaluate and test the PR. By fulfilling all the required information you will be able to reduce the volume of questions and most likely help merge the PR faster 🚨 -->

<!-- 📝 It is preferred if you keep the "☑️ Allow edits by maintainers" checked in the Pull Request Template as it increases collaboration with the Toolkit maintainers by permitting commits to your PR branch (only) created from your fork.  This can let us quickly make fixes for minor typos or forgotten StyleCop issues during review without needing to wait on you doing extra work. Let us help you help us! 🎉 -->


## Some references to ribbon removed
<!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. -->

<!-- Add a brief overview here of the feature/bug & fix. -->
Replaces certain referecnes to ribbon with TabbedCommandBar

## PR Type
What kind of change does this PR introduce?
<!-- Please uncomment one or more that apply to this PR. -->

- Bugfix
<!-- - Feature -->
<!-- - Code style update (formatting) -->
<!-- - Refactoring (no functional changes, no api changes) -->
<!-- - Build or CI related changes -->
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
<!-- - Other... Please describe: -->


## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->


## What is the new behavior?
<!-- Describe how was this issue resolved or changed? -->


## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] Tested code with current [supported SDKs](../readme.md#supported)
- [ ] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->
- [ ] Sample in sample app has been added / updated (for bug fixes / features)
    - [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)
- [ ] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [ ] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [ ] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
- [ ] Contains **NO** breaking changes

<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. 
     Please note that breaking changes are likely to be rejected within minor release cycles or held until major versions. -->


## Other information
  • Loading branch information
msftbot[bot] authored Mar 26, 2021
2 parents b2f8fcb + a47b51d commit 5eaeeca
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ IF NOT CERTAIN ABOUT THE FEATURE AND REQUIRE MORE CLARITY THEN PLEASE POST ON "I
<!-- Please describe or link to any existing issues or discussions.
A clear and concise description of what the problem is, starting with the user story.
Provide examples of the restrictions in the current environment that hinders the work your users or you want to perform. What are the ways this new feature will help transform and deliver those results?
For example, I am currently using the InfiniteCanvas control which lacks the ribbon control feature. I am looking to improve user experience therefore i would like to use that in my project to provide ease of accessibility and a user-friendly interface. This new feature will provide quick access to the toolbar, enhance space utilization, etc [...] -->
For example, I am currently using the InfiniteCanvas control which lacks the TabbedCommandBar control feature. I am looking to improve user experience therefore i would like to use that in my project to provide ease of accessibility and a user-friendly interface. This new feature will provide quick access to the toolbar, enhance space utilization, etc [...] -->


## Describe the solution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
namespace Microsoft.Toolkit.Uwp.UI.Controls
{
/// <summary>
/// A basic ribbon control that houses <see cref="TabbedCommandBarItem"/>s
/// A basic TabbedCommandBar control that houses <see cref="TabbedCommandBarItem"/>s
/// </summary>
[ContentProperty(Name = nameof(MenuItems))]
[TemplatePart(Name = "PART_RibbonContent", Type = typeof(ContentControl))]
[TemplatePart(Name = "PART_RibbonContentBorder", Type = typeof(Border))]
[TemplatePart(Name = "PART_TabbedCommandBarContent", Type = typeof(ContentControl))]
[TemplatePart(Name = "PART_TabbedCommandBarContentBorder", Type = typeof(Border))]
[TemplatePart(Name = "PART_TabChangedStoryboard", Type = typeof(Storyboard))]
public class TabbedCommandBar : NavigationView
{
private ContentControl _ribbonContent = null;
private Border _ribbonContentBorder = null;
private ContentControl _tabbedCommandBarContent = null;
private Border _tabbedCommandBarContentBorder = null;
private Storyboard _tabChangedStoryboard = null;

/// <summary>
Expand All @@ -45,14 +45,14 @@ protected override void OnApplyTemplate()
{
base.OnApplyTemplate();

if (_ribbonContent != null)
if (_tabbedCommandBarContent != null)
{
_ribbonContent.Content = null;
_tabbedCommandBarContent.Content = null;
}

// Get RibbonContent first, since setting SelectedItem requires it
_ribbonContent = GetTemplateChild("PART_RibbonContent") as ContentControl;
_ribbonContentBorder = GetTemplateChild("PART_RibbonContentBorder") as Border;
// Get TabbedCommandBarContent first, since setting SelectedItem requires it
_tabbedCommandBarContent = GetTemplateChild("PART_TabbedCommandBarContent") as ContentControl;
_tabbedCommandBarContentBorder = GetTemplateChild("PART_TabbedCommandBarContentBorder") as Border;
_tabChangedStoryboard = GetTemplateChild("TabChangedStoryboard") as Storyboard;

SelectedItem = MenuItems.FirstOrDefault();
Expand Down Expand Up @@ -83,7 +83,7 @@ private void SelectedItemChanged(NavigationView sender, NavigationViewSelectionC
_visibilityChangedToken =
_previousSelectedItem.RegisterPropertyChangedCallback(TabbedCommandBarItem.VisibilityProperty, SelectedItemVisibilityChanged);

// Set the ribbon background and start the transition animation
// Set the TabbedCommandBar background and start the transition animation
_tabChangedStoryboard?.Begin();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,17 @@
</Grid>


<Border x:Name="PART_RibbonContentBorder"
<Border x:Name="PART_TabbedCommandBarContentBorder"
Grid.Row="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{Binding ElementName=PART_RibbonContent, Path=Content.Background}">
<ContentControl x:Name="PART_RibbonContent"
Background="{Binding ElementName=PART_TabbedCommandBarContent, Path=Content.Background}">
<ContentControl x:Name="PART_TabbedCommandBarContent"
HorizontalContentAlignment="Stretch"
Content="{TemplateBinding SelectedItem}">
<ContentControl.Resources>
<Storyboard x:Name="TabChangedStoryboard">
<PopInThemeAnimation TargetName="PART_RibbonContent" />
<PopInThemeAnimation TargetName="PART_TabbedCommandBarContent" />
</Storyboard>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public TabbedCommandBarItem()
new PropertyMetadata(string.Empty));

/// <summary>
/// Gets or sets the text or <see cref="UIElement"/> to display in the header of this ribbon tab.
/// Gets or sets the text or <see cref="UIElement"/> to display in the header of this TabbedCommandBar tab.
/// </summary>
public object Header
{
Expand Down

0 comments on commit 5eaeeca

Please sign in to comment.