Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavView Hamburger btn and header overlap on launch in minimal mode #652

Merged
merged 6 commits into from
May 6, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev/NavigationView/NavigationView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2586,6 +2586,7 @@ void NavigationView::OnPropertyChanged(const winrt::DependencyPropertyChangedEve
if (property == s_IsPaneOpenProperty)
{
OnIsPaneOpenChanged();
UpdateVisualStateForDisplayModeGroup(DisplayMode());
}
else if (property == s_CompactModeThresholdWidthProperty ||
property == s_ExpandedModeThresholdWidthProperty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3803,6 +3803,28 @@ public void EnsureDisplayModeGroupUpdatesWhenBackButtonVisibilityChanged()
}
}

[TestMethod]
[TestProperty("NavViewTestSuite", "D")]
public void EnsureDisplayModeGroupUpdatesOnPaneClosedToMinimalWithBackButton()
{
using (var setup = new TestSetupHelper(new[] { "NavigationView Tests", "Navigation Minimal Test" }))
{
Log.Comment("Click on ToggleButton");
Button navButton = new Button(FindElement.ById("TogglePaneButton"));
ojhad marked this conversation as resolved.
Show resolved Hide resolved
navButton.Invoke();
Wait.ForIdle();

Log.Comment("Get NavView Active VisualStates");
var getNavViewActiveVisualStatesButton = new Button(FindElement.ByName("GetNavViewActiveVisualStates"));
getNavViewActiveVisualStatesButton.Invoke();
Wait.ForIdle();

const string visualStateName = "MinimalWithBackButton";
var result = new TextBlock(FindElement.ByName("NavViewActiveVisualStatesResult"));
Verify.IsTrue(result.GetText().Contains(visualStateName), "Active VisualStates should not include " + visualStateName);
}
}

// Test for issue 450 https://github.com/Microsoft/microsoft-ui-xaml/issues/450
[TestMethod]
[TestProperty("NavViewTestSuite", "D")]
Expand Down
1 change: 1 addition & 0 deletions dev/NavigationView/TestUI/NavigationViewCaseBundle.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<Button x:Name="NavigateToTopNavPage" AutomationProperties.Name="Top Nav Test" Margin="2" HorizontalAlignment="Stretch">Top Nav Test</Button>
<Button x:Name="NavigateToAnimationPage" AutomationProperties.Name="Navigation Animation Test" Margin="2" HorizontalAlignment="Stretch">Navigation Animation Test</Button>
<Button x:Name="NavigateToIsPaneOpenPage" AutomationProperties.Name="Navigation IsPaneOpen Test" Margin="2" HorizontalAlignment="Stretch">Navigation IsPaneOpen Test</Button>
<Button x:Name="NavigateToMinimalPage" AutomationProperties.Name="Navigation Minimal Test" Margin="2" HorizontalAlignment="Stretch">Navigation Minimal Test</Button>
</StackPanel>
</Grid>
</local:TestPage>
1 change: 1 addition & 0 deletions dev/NavigationView/TestUI/NavigationViewCaseBundle.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public NavigationViewCaseBundle()
NavigateToTopNavPage.Click += delegate { Frame.NavigateWithoutAnimation(typeof(NavigationViewTopNavStorePage), 0); };
NavigateToAnimationPage.Click += delegate { Frame.NavigateWithoutAnimation(typeof(NavigationViewAnimationPage), 0); };
NavigateToIsPaneOpenPage.Click += delegate { Frame.NavigateWithoutAnimation(typeof(NavigationViewIsPaneOpenPage), 0); };
NavigateToMinimalPage.Click += delegate { Frame.NavigateWithoutAnimation(typeof(NavigationViewMinimalPage), 0); };
}

}
Expand Down
26 changes: 26 additions & 0 deletions dev/NavigationView/TestUI/NavigationViewMinimalPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<local:TestPage
x:Class="MUXControlsTestApp.NavigationViewMinimalPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MUXControlsTestApp"
xmlns:muxcontrols="using:Microsoft.UI.Xaml.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<Grid>
<muxcontrols:NavigationView x:Name="NavView" AutomationProperties.Name="NavView" AutomationProperties.AutomationId="NavView"
IsBackEnabled="True" Header="Minimal Test Page" PaneDisplayMode="LeftMinimal">
<muxcontrols:NavigationView.MenuItems>
<muxcontrols:NavigationViewItem x:Name="HomeItem" Content="Home" Icon="Home"/>
chrisglein marked this conversation as resolved.
Show resolved Hide resolved
<muxcontrols:NavigationViewItem x:Name="AppsItem" Content="Apps" Icon="Shop" />
</muxcontrols:NavigationView.MenuItems>
<StackPanel>
<TextBlock x:Name="NavViewActiveVisualStatesResult" AutomationProperties.Name="NavViewActiveVisualStatesResult"/>
<Button x:Name="GetNavViewActiveVisualStates" AutomationProperties.Name="GetNavViewActiveVisualStates" Content="GetNavViewActiveVisualStates" Click="GetNavViewActiveVisualStates_Click"/>
</StackPanel>
</muxcontrols:NavigationView>
</Grid>
</local:TestPage>
20 changes: 20 additions & 0 deletions dev/NavigationView/TestUI/NavigationViewMinimalPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Windows.UI.Xaml;

namespace MUXControlsTestApp
{
public sealed partial class NavigationViewMinimalPage : TestPage
{
public NavigationViewMinimalPage()
{
this.InitializeComponent();
}

private void GetNavViewActiveVisualStates_Click(object sender, RoutedEventArgs e)
{
var visualstates = Utilities.VisualStateHelper.GetCurrentVisualStateName(NavView);
NavViewActiveVisualStatesResult.Text = string.Join(",", visualstates);
}
}
}
10 changes: 10 additions & 0 deletions dev/NavigationView/TestUI/NavigationView_TestUI.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)NavigationViewMinimalPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)NavigationViewStretchPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -84,6 +88,7 @@
<Compile Include="$(MSBuildThisFileDirectory)NavigationViewIsPaneOpenPage.xaml.cs">
<DependentUpon>NavigationViewIsPaneOpenPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)NavigationViewMinimalPage.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)NavigationViewStretchPage.xaml.cs">
<DependentUpon>NavigationViewStretchPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -118,4 +123,9 @@
<DependentUpon>NavigationViewTopNavStorePage.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Update="D:\microsoft-ui-xaml\dev\NavigationView\TestUI\NavigationViewMinimalPage.xaml.cs">
ojhad marked this conversation as resolved.
Show resolved Hide resolved
<DependentUpon>NavigationViewMinimalPage.xaml</DependentUpon>
</Compile>
</ItemGroup>
</Project>