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

Fix the PaneVisible initialziation problem #1179

Merged
merged 1 commit into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -378,6 +378,7 @@ void NavigationView::OnApplyTemplate()
UpdateSingleSelectionFollowsFocusTemplateSetting();
UpdateNavigationViewUseSystemVisual();
PropagateNavigationViewAsParent();
UpdatePaneVisibility();
UpdateVisualState();
UpdatePaneTitleMargins();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,24 @@ public void ItemSourceTest()
}
}

[TestMethod]
[TestProperty("TestSuite", "A")]
public void VerifyPaneVisibleOnInit()
{
using (var setup = new TestSetupHelper(new[] { "NavigationView Tests", "NavigationView Init Test" }))
{
Log.Comment("Verify PaneIsVisibleItem is invisible");
VerifyElement.NotFound("PaneIsVisibleItem", FindBy.Name);

FindElement.ByName<Button>("ChangePaneVisible").Invoke();
Wait.ForIdle();

Log.Comment("Verify PaneIsVisibleItem is visible");
VerifyElement.Found("PaneIsVisibleItem", FindBy.Name);

}
}

[TestMethod]
[TestProperty("TestSuite", "A")]
public void VerifyNavigationViewItemResponseToClickAfterBeingMovedBetweenFrames()
Expand Down
9 changes: 8 additions & 1 deletion dev/NavigationView/TestUI/NavigationViewInitPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<Button x:Name="RemoveItemButton" AutomationProperties.Name="RemoveItemButton" Content="Remove Item" Click="RemoveButton_Click"/>
<Button x:Name="ChangeToIEnumerableButton" AutomationProperties.Name="ChangeToIEnumerableButton" Content="Make it IEnumerable" Click="ChangeToIEnumerableButton_Clicks"/>
<Button x:Name="FlipOrientation" AutomationProperties.Name="FlipOrientationButton" Content="Flip Orientation" Click="FlipOrientation_Click"/>

<StackPanel>
<Button x:Name="SwitchFrame" AutomationProperties.Name="SwitchFrame" Content="SwitchFrame" Click="SwitchFrame_Click" />
<TextBlock x:Name="MyLocationResult" AutomationProperties.Name="MyLocationResult" Text="Unknown"/>
Expand All @@ -53,6 +53,13 @@
<controls:NavigationViewItem Content="People" IsSelected="True" />
</controls:NavigationView.MenuItems>
</controls:NavigationView>
<controls:NavigationView x:Name="NavView4"
IsPaneVisible="False">
<controls:NavigationView.MenuItems>
<controls:NavigationViewItem Content="123" AutomationProperties.Name="PaneIsVisibleItem"/>
</controls:NavigationView.MenuItems>
<Button Content="Change IsPaneVisible Flag" AutomationProperties.Name="ChangePaneVisible" Click="ChangePaneVisibleButton_Click" />
</controls:NavigationView>
</StackPanel>
</Grid>

Expand Down
5 changes: 5 additions & 0 deletions dev/NavigationView/TestUI/NavigationViewInitPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,10 @@ private void NavView2_ItemInvoked(NavigationView sender, NavigationViewItemInvok
MyLocationResult.Text = "Frame2";
}
}

private void ChangePaneVisibleButton_Click(object sender, RoutedEventArgs e)
{
NavView4.IsPaneVisible = !NavView4.IsPaneVisible;
}
}
}