From 5ebf95811c3d5971bf89429fe17e89a073fd49d0 Mon Sep 17 00:00:00 2001 From: Dilip Ojha Date: Fri, 3 Apr 2020 18:10:05 -0700 Subject: [PATCH] Update HNav based on API Review (#2196) * changed api, added tests, fixed bugs * fixed test * addressed comments * fixed test failure * fixed test issue (leftclick on wrong point) Co-authored-by: Keith Mahoney --- dev/Generated/NavigationView.properties.cpp | 4 +- dev/Generated/NavigationView.properties.h | 8 +-- dev/NavigationView/NavigationView.cpp | 53 ++++------------- dev/NavigationView/NavigationView.idl | 22 +++---- dev/NavigationView/NavigationView.vcxitems | 8 +-- .../NavigationViewCollapsedEventArgs.cpp | 16 ----- .../NavigationViewCollapsedEventArgs.h | 18 ------ .../NavigationViewExpandingEventArgs.cpp | 16 ----- .../NavigationViewExpandingEventArgs.h | 17 ------ .../NavigationViewItemCollapsedEventArgs.cpp | 37 ++++++++++++ .../NavigationViewItemCollapsedEventArgs.h | 23 ++++++++ .../NavigationViewItemExpandingEventArgs.cpp | 37 ++++++++++++ .../NavigationViewItemExpandingEventArgs.h | 23 ++++++++ .../NavigationViewTests.cs | 59 ++++++++++++++++++- ...HierarchicalNavigationViewDataBinding.xaml | 32 +++++++++- ...rarchicalNavigationViewDataBinding.xaml.cs | 42 ++++++------- .../HierarchicalNavigationViewMarkup.xaml | 32 +++++++++- .../HierarchicalNavigationViewMarkup.xaml.cs | 42 ++++++------- 18 files changed, 311 insertions(+), 178 deletions(-) delete mode 100644 dev/NavigationView/NavigationViewCollapsedEventArgs.cpp delete mode 100644 dev/NavigationView/NavigationViewCollapsedEventArgs.h delete mode 100644 dev/NavigationView/NavigationViewExpandingEventArgs.cpp delete mode 100644 dev/NavigationView/NavigationViewExpandingEventArgs.h create mode 100644 dev/NavigationView/NavigationViewItemCollapsedEventArgs.cpp create mode 100644 dev/NavigationView/NavigationViewItemCollapsedEventArgs.h create mode 100644 dev/NavigationView/NavigationViewItemExpandingEventArgs.cpp create mode 100644 dev/NavigationView/NavigationViewItemExpandingEventArgs.h diff --git a/dev/Generated/NavigationView.properties.cpp b/dev/Generated/NavigationView.properties.cpp index a7c87f1ea7..dc26330cd3 100644 --- a/dev/Generated/NavigationView.properties.cpp +++ b/dev/Generated/NavigationView.properties.cpp @@ -1148,7 +1148,7 @@ void NavigationViewProperties::BackRequested(winrt::event_token const& token) m_backRequestedEventSource.remove(token); } -winrt::event_token NavigationViewProperties::Collapsed(winrt::TypedEventHandler const& value) +winrt::event_token NavigationViewProperties::Collapsed(winrt::TypedEventHandler const& value) { return m_collapsedEventSource.add(value); } @@ -1168,7 +1168,7 @@ void NavigationViewProperties::DisplayModeChanged(winrt::event_token const& toke m_displayModeChangedEventSource.remove(token); } -winrt::event_token NavigationViewProperties::Expanding(winrt::TypedEventHandler const& value) +winrt::event_token NavigationViewProperties::Expanding(winrt::TypedEventHandler const& value) { return m_expandingEventSource.add(value); } diff --git a/dev/Generated/NavigationView.properties.h b/dev/Generated/NavigationView.properties.h index c9e237d508..66dabb6b8e 100644 --- a/dev/Generated/NavigationView.properties.h +++ b/dev/Generated/NavigationView.properties.h @@ -188,11 +188,11 @@ class NavigationViewProperties winrt::event_token BackRequested(winrt::TypedEventHandler const& value); void BackRequested(winrt::event_token const& token); - winrt::event_token Collapsed(winrt::TypedEventHandler const& value); + winrt::event_token Collapsed(winrt::TypedEventHandler const& value); void Collapsed(winrt::event_token const& token); winrt::event_token DisplayModeChanged(winrt::TypedEventHandler const& value); void DisplayModeChanged(winrt::event_token const& token); - winrt::event_token Expanding(winrt::TypedEventHandler const& value); + winrt::event_token Expanding(winrt::TypedEventHandler const& value); void Expanding(winrt::event_token const& token); winrt::event_token ItemInvoked(winrt::TypedEventHandler const& value); void ItemInvoked(winrt::event_token const& token); @@ -208,9 +208,9 @@ class NavigationViewProperties void SelectionChanged(winrt::event_token const& token); event_source> m_backRequestedEventSource; - event_source> m_collapsedEventSource; + event_source> m_collapsedEventSource; event_source> m_displayModeChangedEventSource; - event_source> m_expandingEventSource; + event_source> m_expandingEventSource; event_source> m_itemInvokedEventSource; event_source> m_paneClosedEventSource; event_source> m_paneClosingEventSource; diff --git a/dev/NavigationView/NavigationView.cpp b/dev/NavigationView/NavigationView.cpp index 819fcdec8c..e757dae6ab 100644 --- a/dev/NavigationView/NavigationView.cpp +++ b/dev/NavigationView/NavigationView.cpp @@ -27,8 +27,8 @@ #include "ElementFactoryGetArgs.h" #include "ElementFactoryRecycleArgs.h" #include -#include "NavigationViewExpandingEventArgs.h" -#include "NavigationViewCollapsedEventArgs.h" +#include "NavigationViewItemExpandingEventArgs.h" +#include "NavigationViewItemCollapsedEventArgs.h" static constexpr auto c_togglePaneButtonName = L"TogglePaneButton"sv; static constexpr auto c_paneTitleHolderFrameworkElement = L"PaneTitleHolder"sv; @@ -2434,44 +2434,14 @@ winrt::IInspectable NavigationView::MenuItemFromContainer(winrt::DependencyObjec { if (container) { - if (IsTopNavigationView()) + if (auto const nvib = container.try_as()) { - // Search topnav first, if not found, search overflow - if (auto ir = m_topNavRepeater.get()) - { - if (auto element = container.try_as()) - { - auto index = ir.GetElementIndex(element); - if (index != -1) - { - return GetItemFromIndex(ir, index); - } - } - } - - if (auto ir = m_topNavRepeaterOverflowView.get()) + if (auto const parentRepeater = GetParentItemsRepeaterForContainer(nvib)) { - if (auto element = container.try_as()) + auto const containerIndex = parentRepeater.GetElementIndex(nvib); + if (containerIndex >= 0) { - auto index = ir.GetElementIndex(element); - if (index != -1) - { - return GetItemFromIndex(ir, index); - } - } - } - } - else - { - if (auto ir = m_leftNavRepeater.get()) - { - if (auto element = container.try_as()) - { - int index = ir.GetElementIndex(element); - if (index != -1) - { - return GetItemFromIndex(ir, index); - } + return GetItemFromIndex(parentRepeater, containerIndex); } } } @@ -2941,10 +2911,7 @@ void NavigationView::SelectOverflowItem(winrt::IInspectable const& item, winrt:: { if (ip.GetSize() > 1) { - auto indexOfParentInOverflow = m_topDataProvider.ConvertOriginalIndexToIndex(ip.GetAt(0)); - // We want to make sure that container is collapsed before movement - CollapseAllMenuItemsUnderRepeater(m_topNavRepeaterOverflowView.get()); - return GetItemFromIndex(m_topNavRepeaterOverflowView.get(), indexOfParentInOverflow); + return GetItemFromIndex(m_topNavRepeaterOverflowView.get(), m_topDataProvider.ConvertOriginalIndexToIndex(ip.GetAt(0))); } return item; }(); @@ -4840,14 +4807,14 @@ void NavigationView::CollapseAllMenuItemsUnderRepeater(const winrt::ItemsRepeate void NavigationView::RaiseExpandingEvent(const winrt::NavigationViewItemBase& container) { - auto eventArgs = winrt::make_self(); + auto eventArgs = winrt::make_self(*this); eventArgs->ExpandingItemContainer(container); m_expandingEventSource(*this, *eventArgs); } void NavigationView::RaiseCollapsedEvent(const winrt::NavigationViewItemBase& container) { - auto eventArgs = winrt::make_self(); + auto eventArgs = winrt::make_self(*this); eventArgs->CollapsedItemContainer(container); m_collapsedEventSource(*this, *eventArgs); } diff --git a/dev/NavigationView/NavigationView.idl b/dev/NavigationView/NavigationView.idl index 7b755bedfe..7f6475afcb 100644 --- a/dev/NavigationView/NavigationView.idl +++ b/dev/NavigationView/NavigationView.idl @@ -111,18 +111,20 @@ runtimeclass NavigationViewBackRequestedEventArgs { } -[WUXC_VERSION_PREVIEW] +[WUXC_VERSION_MUXONLY] [webhosthidden] -runtimeclass NavigationViewExpandingEventArgs +runtimeclass NavigationViewItemExpandingEventArgs { NavigationViewItemBase ExpandingItemContainer { get; }; + Object ExpandingItem{ get; }; } -[WUXC_VERSION_PREVIEW] +[WUXC_VERSION_MUXONLY] [webhosthidden] -runtimeclass NavigationViewCollapsedEventArgs +runtimeclass NavigationViewItemCollapsedEventArgs { NavigationViewItemBase CollapsedItemContainer { get; }; + Object CollapsedItem{ get; }; } [WUXC_VERSION_RS5] @@ -284,11 +286,11 @@ unsealed runtimeclass NavigationView : Windows.UI.Xaml.Controls.ContentControl Boolean IsTitleBarAutoPaddingEnabled { get; set; }; static Windows.UI.Xaml.DependencyProperty IsTitleBarAutoPaddingEnabledProperty { get; }; - - [WUXC_VERSION_PREVIEW] + + [WUXC_VERSION_MUXONLY] { - event Windows.Foundation.TypedEventHandler Expanding; - event Windows.Foundation.TypedEventHandler Collapsed; + event Windows.Foundation.TypedEventHandler Expanding; + event Windows.Foundation.TypedEventHandler Collapsed; void Expand(NavigationViewItem item); void Collapse(NavigationViewItem item); @@ -302,7 +304,7 @@ unsealed runtimeclass NavigationView : Windows.UI.Xaml.Controls.ContentControl [default_interface] unsealed runtimeclass NavigationViewItemBase : Windows.UI.Xaml.Controls.ContentControl { - [WUXC_VERSION_PREVIEW] + [WUXC_VERSION_MUXONLY] { Boolean IsSelected{ get; set; }; static Windows.UI.Xaml.DependencyProperty IsSelectedProperty { get; }; @@ -334,7 +336,7 @@ unsealed runtimeclass NavigationViewItem : NavigationViewItemBase static Windows.UI.Xaml.DependencyProperty SelectsOnInvokedProperty { get; }; } - [WUXC_VERSION_PREVIEW] + [WUXC_VERSION_MUXONLY] { [MUX_DEFAULT_VALUE("false")] Boolean IsExpanded{ get; set; }; diff --git a/dev/NavigationView/NavigationView.vcxitems b/dev/NavigationView/NavigationView.vcxitems index 7a7dfb3cdc..cedc503d63 100644 --- a/dev/NavigationView/NavigationView.vcxitems +++ b/dev/NavigationView/NavigationView.vcxitems @@ -22,8 +22,8 @@ - - + + @@ -42,8 +42,8 @@ - - + + diff --git a/dev/NavigationView/NavigationViewCollapsedEventArgs.cpp b/dev/NavigationView/NavigationViewCollapsedEventArgs.cpp deleted file mode 100644 index 4b335eeb67..0000000000 --- a/dev/NavigationView/NavigationViewCollapsedEventArgs.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -#include "pch.h" -#include "common.h" -#include "NavigationViewCollapsedEventArgs.h" - -winrt::NavigationViewItemBase NavigationViewCollapsedEventArgs::CollapsedItemContainer() -{ - return m_collapsedItemContainer.get(); -} - -void NavigationViewCollapsedEventArgs::CollapsedItemContainer(winrt::NavigationViewItemBase const& value) -{ - m_collapsedItemContainer.set(value); -} diff --git a/dev/NavigationView/NavigationViewCollapsedEventArgs.h b/dev/NavigationView/NavigationViewCollapsedEventArgs.h deleted file mode 100644 index ed31418e64..0000000000 --- a/dev/NavigationView/NavigationViewCollapsedEventArgs.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -#pragma once - -#include "NavigationViewCollapsedEventArgs.g.h" -#include "NavigationViewItemBase.h" - -class NavigationViewCollapsedEventArgs : - public ReferenceTracker -{ -public: - winrt::NavigationViewItemBase CollapsedItemContainer(); - void CollapsedItemContainer(winrt::NavigationViewItemBase const& value); - -private: - tracker_ref m_collapsedItemContainer{ this }; -}; diff --git a/dev/NavigationView/NavigationViewExpandingEventArgs.cpp b/dev/NavigationView/NavigationViewExpandingEventArgs.cpp deleted file mode 100644 index 14f62910ea..0000000000 --- a/dev/NavigationView/NavigationViewExpandingEventArgs.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -#include "pch.h" -#include "common.h" -#include "NavigationViewExpandingEventArgs.h" - -winrt::NavigationViewItemBase NavigationViewExpandingEventArgs::ExpandingItemContainer() -{ - return m_expandingItemContainer.get(); -} - -void NavigationViewExpandingEventArgs::ExpandingItemContainer(winrt::NavigationViewItemBase const& value) -{ - m_expandingItemContainer.set(value); -} diff --git a/dev/NavigationView/NavigationViewExpandingEventArgs.h b/dev/NavigationView/NavigationViewExpandingEventArgs.h deleted file mode 100644 index afa28b62e4..0000000000 --- a/dev/NavigationView/NavigationViewExpandingEventArgs.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -#pragma once - -#include "NavigationViewExpandingEventArgs.g.h" - -class NavigationViewExpandingEventArgs : - public ReferenceTracker -{ -public: - winrt::NavigationViewItemBase ExpandingItemContainer(); - void ExpandingItemContainer(winrt::NavigationViewItemBase const& value); - -private: - tracker_ref m_expandingItemContainer{ this }; -}; diff --git a/dev/NavigationView/NavigationViewItemCollapsedEventArgs.cpp b/dev/NavigationView/NavigationViewItemCollapsedEventArgs.cpp new file mode 100644 index 0000000000..ff2bfc7124 --- /dev/null +++ b/dev/NavigationView/NavigationViewItemCollapsedEventArgs.cpp @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +#include "pch.h" +#include "common.h" +#include "NavigationViewItemCollapsedEventArgs.h" + +NavigationViewItemCollapsedEventArgs::NavigationViewItemCollapsedEventArgs(const winrt::NavigationView& navigationView) +{ + m_navigationView.set(navigationView); +} + +winrt::NavigationViewItemBase NavigationViewItemCollapsedEventArgs::CollapsedItemContainer() +{ + return m_collapsedItemContainer.get(); +} + +void NavigationViewItemCollapsedEventArgs::CollapsedItemContainer(winrt::NavigationViewItemBase const& value) +{ + m_collapsedItemContainer.set(value); +} + +winrt::IInspectable NavigationViewItemCollapsedEventArgs::CollapsedItem() +{ + if (auto const collapsedItem = m_collapsedItem.get()) + { + return collapsedItem; + } + + if (auto const nv = m_navigationView.get()) + { + m_collapsedItem.set(nv.MenuItemFromContainer(m_collapsedItemContainer.get())); + return m_collapsedItem.get(); + } + + return nullptr; +} diff --git a/dev/NavigationView/NavigationViewItemCollapsedEventArgs.h b/dev/NavigationView/NavigationViewItemCollapsedEventArgs.h new file mode 100644 index 0000000000..f56a703e43 --- /dev/null +++ b/dev/NavigationView/NavigationViewItemCollapsedEventArgs.h @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +#pragma once + +#include "NavigationViewItemCollapsedEventArgs.g.h" + +class NavigationViewItemCollapsedEventArgs : + public ReferenceTracker +{ +public: + NavigationViewItemCollapsedEventArgs(const winrt::NavigationView& navigationView); + + winrt::NavigationViewItemBase CollapsedItemContainer(); + void CollapsedItemContainer(winrt::NavigationViewItemBase const& value); + + winrt::IInspectable CollapsedItem(); + +private: + tracker_ref m_collapsedItemContainer{ this }; + tracker_ref m_collapsedItem{ this }; + tracker_ref m_navigationView{ this }; +}; diff --git a/dev/NavigationView/NavigationViewItemExpandingEventArgs.cpp b/dev/NavigationView/NavigationViewItemExpandingEventArgs.cpp new file mode 100644 index 0000000000..c083b966bf --- /dev/null +++ b/dev/NavigationView/NavigationViewItemExpandingEventArgs.cpp @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +#include "pch.h" +#include "common.h" +#include "NavigationViewItemExpandingEventArgs.h" + +NavigationViewItemExpandingEventArgs::NavigationViewItemExpandingEventArgs(const winrt::NavigationView& navigationView) +{ + m_navigationView.set(navigationView); +} + +winrt::NavigationViewItemBase NavigationViewItemExpandingEventArgs::ExpandingItemContainer() +{ + return m_expandingItemContainer.get(); +} + +void NavigationViewItemExpandingEventArgs::ExpandingItemContainer(winrt::NavigationViewItemBase const& value) +{ + m_expandingItemContainer.set(value); +} + +winrt::IInspectable NavigationViewItemExpandingEventArgs::ExpandingItem() +{ + if (auto const expandingItem = m_expandingItem.get()) + { + return expandingItem; + } + + if (auto const nv = m_navigationView.get()) + { + m_expandingItem.set(nv.MenuItemFromContainer(m_expandingItemContainer.get())); + return m_expandingItem.get(); + } + + return nullptr; +} diff --git a/dev/NavigationView/NavigationViewItemExpandingEventArgs.h b/dev/NavigationView/NavigationViewItemExpandingEventArgs.h new file mode 100644 index 0000000000..9d69f78632 --- /dev/null +++ b/dev/NavigationView/NavigationViewItemExpandingEventArgs.h @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +#pragma once + +#include "NavigationViewItemExpandingEventArgs.g.h" + +class NavigationViewItemExpandingEventArgs : + public ReferenceTracker +{ +public: + NavigationViewItemExpandingEventArgs(const winrt::NavigationView& navigationView); + + winrt::NavigationViewItemBase ExpandingItemContainer(); + void ExpandingItemContainer(winrt::NavigationViewItemBase const& value); + + winrt::IInspectable ExpandingItem(); + +private: + tracker_ref m_expandingItemContainer{ this }; + tracker_ref m_expandingItem{ this }; + tracker_ref m_navigationView{ this }; +}; diff --git a/dev/NavigationView/NavigationView_InteractionTests/NavigationViewTests.cs b/dev/NavigationView/NavigationView_InteractionTests/NavigationViewTests.cs index bb77e5aa85..1f224e21a0 100644 --- a/dev/NavigationView/NavigationView_InteractionTests/NavigationViewTests.cs +++ b/dev/NavigationView/NavigationView_InteractionTests/NavigationViewTests.cs @@ -4223,7 +4223,19 @@ public void VerifyExpandCollpaseFunctionality() { using (var setup = new TestSetupHelper(new[] { "NavigationView Tests", testScenario.TestPageName })) { + + TextBlock textblockExpandingItemAndContainerMatch = new TextBlock(FindElement.ByName("TextblockExpandingItemAndContainerMatch")); + TextBlock textblockCollapsedItemAndContainerMatch = new TextBlock(FindElement.ByName("TextblockCollapsedItemAndContainerMatch")); + TextBlock textBlockExpandingItem = new TextBlock(FindElement.ByName("TextBlockExpandingItem")); + TextBlock textBlockCollapsedItem = new TextBlock(FindElement.ByName("TextBlockCollapsedItem")); + Log.Comment("Verify that first menu item is not expanded."); + // Verify through test page elements + Verify.AreEqual(textblockExpandingItemAndContainerMatch.DocumentText, "N/A"); + Verify.AreEqual(textblockCollapsedItemAndContainerMatch.DocumentText, "N/A"); + Verify.AreEqual(textBlockExpandingItem.DocumentText, "N/A"); + Verify.AreEqual(textBlockCollapsedItem.DocumentText, "N/A"); + // Verify that second menu item is not in tree var firstItem = FindElement.ByName("Menu Item 1"); var childItem = FindElement.ByName("Menu Item 2"); Verify.IsNull(childItem); @@ -4232,9 +4244,52 @@ public void VerifyExpandCollpaseFunctionality() InputHelper.LeftClick(firstItem); Wait.ForIdle(); + Log.Comment("Verify that first menu item was expanded correctly."); + // Verify through test page elements + Verify.AreEqual(textblockExpandingItemAndContainerMatch.DocumentText, "true"); + Verify.AreEqual(textblockCollapsedItemAndContainerMatch.DocumentText, "N/A"); + Verify.AreEqual(textBlockExpandingItem.DocumentText, "Menu Item 1"); + Verify.AreEqual(textBlockCollapsedItem.DocumentText, "N/A"); + // Verify that second menu item is in tree childItem = FindElement.ByName("Menu Item 2"); Verify.IsNotNull(childItem, "Child item should be visible after expanding parent item."); + Log.Comment("Expand child of first menu item."); + InputHelper.LeftClick(childItem); + Wait.ForIdle(); + + Log.Comment("Verify that child of first menu item was expanded correctly."); + // Verify through test page elements + Verify.AreEqual(textblockExpandingItemAndContainerMatch.DocumentText, "true"); + Verify.AreEqual(textblockCollapsedItemAndContainerMatch.DocumentText, "N/A"); + Verify.AreEqual(textBlockExpandingItem.DocumentText, "Menu Item 2"); + Verify.AreEqual(textBlockCollapsedItem.DocumentText, "N/A"); + // Verify that third child menu item is in tree + var secondChildItem = FindElement.ByName("Menu Item 4"); + Verify.IsNotNull(secondChildItem, "Child item should be visible after expanding parent item."); + + Log.Comment("Collapse child of first menu item."); + InputHelper.LeftClick(childItem, 5, 5); + Wait.ForIdle(); + + Log.Comment("Verify that child of first menu item was collapsed correctly."); + // Verify through test page elements + Verify.AreEqual(textblockExpandingItemAndContainerMatch.DocumentText, "true"); + Verify.AreEqual(textblockCollapsedItemAndContainerMatch.DocumentText, "true"); + Verify.AreEqual(textBlockExpandingItem.DocumentText, "Menu Item 2"); + Verify.AreEqual(textBlockCollapsedItem.DocumentText, "Menu Item 2"); + + + Log.Comment("Collapse first menu item."); + InputHelper.LeftClick(firstItem, 5, 5); + Wait.ForIdle(); + + Log.Comment("Verify that first menu item was collapsed correctly."); + // Verify through test page elements + Verify.AreEqual(textblockExpandingItemAndContainerMatch.DocumentText, "true"); + Verify.AreEqual(textblockCollapsedItemAndContainerMatch.DocumentText, "true"); + Verify.AreEqual(textBlockExpandingItem.DocumentText, "Menu Item 2"); + Verify.AreEqual(textBlockCollapsedItem.DocumentText, "Menu Item 1"); } } } @@ -4315,8 +4370,8 @@ public void CanSelectItemInFlyoutAndNVIGetsCollapsedOnFlyoutClose() Verify.AreEqual(displayModeTextBox.DocumentText, "Menu Item 14"); Log.Comment("Verify that parent has been collapsed"); - TextBlock collapsedItemLabel = new TextBlock(FindElement.ByName("CollapsedItemLabel")); - Verify.AreEqual(collapsedItemLabel.DocumentText, "Last Collapsed: Menu Item 11"); + TextBlock textBlockCollapsedItem = new TextBlock(FindElement.ByName("TextBlockCollapsedItem")); + Verify.AreEqual(textBlockCollapsedItem.DocumentText, "Menu Item 11"); } } diff --git a/dev/NavigationView/TestUI/HierarchicalNavigationViewDataBinding.xaml b/dev/NavigationView/TestUI/HierarchicalNavigationViewDataBinding.xaml index b3afcacb82..f40188c266 100644 --- a/dev/NavigationView/TestUI/HierarchicalNavigationViewDataBinding.xaml +++ b/dev/NavigationView/TestUI/HierarchicalNavigationViewDataBinding.xaml @@ -18,16 +18,42 @@ + ItemInvoked="{x:Bind ClickedItem}" Expanding="OnItemExpanding" Collapsed="OnItemCollapsed" PaneDisplayMode="Left">