diff --git a/windows/ReactTestApp/MainPage.cpp b/windows/ReactTestApp/MainPage.cpp index 6140d60ca1..d14024a6a4 100644 --- a/windows/ReactTestApp/MainPage.cpp +++ b/windows/ReactTestApp/MainPage.cpp @@ -11,6 +11,7 @@ using winrt::Windows::ApplicationModel::Core::CoreApplication; using winrt::Windows::ApplicationModel::Core::CoreApplicationViewTitleBar; using winrt::Windows::Foundation::IAsyncAction; +using winrt::Windows::UI::Colors; using winrt::Windows::UI::ViewManagement::ApplicationView; using winrt::Windows::UI::Xaml::RoutedEventArgs; using winrt::Windows::UI::Xaml::Window; @@ -38,7 +39,7 @@ namespace winrt::ReactTestApp::implementation auto &components = manifest.value().components; for (auto &&c : components) { - MenuFlyoutItem newMenuItem = GetComponentMenuButton(c); + MenuFlyoutItem newMenuItem = MakeComponentMenuButton(c); menuItems.Append(newMenuItem); } @@ -78,12 +79,12 @@ namespace winrt::ReactTestApp::implementation ReactRootView().ComponentName(s.as()->AppKey()); } - void MainPage::OpenReactMenu(IInspectable const &, RoutedEventArgs) + void MainPage::OnReactMenuClick(IInspectable const &, RoutedEventArgs) { - ReactButton().Flyout().ShowAt(ReactButton()); + ReactMenuButton().Flyout().ShowAt(ReactMenuButton()); } - MenuFlyoutItem MainPage::GetComponentMenuButton(::ReactTestApp::Component &component) + MenuFlyoutItem MainPage::MakeComponentMenuButton(::ReactTestApp::Component &component) { hstring componentDisplayName = to_hstring(component.displayName.value_or(component.appKey)); hstring appKey = to_hstring(component.appKey); @@ -101,18 +102,18 @@ namespace winrt::ReactTestApp::implementation { // Set close, minimize and maximize icons background to transparent auto appView = ApplicationView::GetForCurrentView().TitleBar(); - appView.ButtonBackgroundColor(winrt::Windows::UI::Colors::Transparent()); - appView.BackgroundColor(winrt::Windows::UI::Colors::Transparent()); + appView.ButtonBackgroundColor(Colors::Transparent()); + appView.BackgroundColor(Colors::Transparent()); auto coreTitleBar = CoreApplication::GetCurrentView().TitleBar(); - coreTitleBar.LayoutMetricsChanged({this, &MainPage::CoreTitleBarLayoutMetricsChanged}); + coreTitleBar.LayoutMetricsChanged({this, &MainPage::OnCoreTitleBarLayoutMetricsChanged}); coreTitleBar.ExtendViewIntoTitleBar(true); Window::Current().SetTitleBar(BackgroundElement()); } // Adjust height of custom title bar to match close, minimize and maximize icons - void MainPage::CoreTitleBarLayoutMetricsChanged(CoreApplicationViewTitleBar const &sender, - IInspectable const &) + void MainPage::OnCoreTitleBarLayoutMetricsChanged(CoreApplicationViewTitleBar const &sender, + IInspectable const &) { TitleBar().Height(sender.Height()); } diff --git a/windows/ReactTestApp/MainPage.h b/windows/ReactTestApp/MainPage.h index 080f985754..fafffc43ea 100644 --- a/windows/ReactTestApp/MainPage.h +++ b/windows/ReactTestApp/MainPage.h @@ -13,8 +13,8 @@ namespace winrt::ReactTestApp::implementation Windows::UI::Xaml::RoutedEventArgs); void LoadFromDevServer(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs); - void OpenReactMenu(Windows::Foundation::IInspectable const &, - winrt::Windows::UI::Xaml::RoutedEventArgs); + void OnReactMenuClick(Windows::Foundation::IInspectable const &, + Windows::UI::Xaml::RoutedEventArgs); Windows::Foundation::IAsyncAction OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs const &e); using Base = MainPageT; @@ -25,8 +25,8 @@ namespace winrt::ReactTestApp::implementation void SetReactComponentName(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs); Windows::UI::Xaml::Controls::MenuFlyoutItem - GetComponentMenuButton(::ReactTestApp::Component &component); - void CoreTitleBarLayoutMetricsChanged( + MakeComponentMenuButton(::ReactTestApp::Component &component); + void OnCoreTitleBarLayoutMetricsChanged( Windows::ApplicationModel::Core::CoreApplicationViewTitleBar const &sender, Windows::Foundation::IInspectable const &); void SetUpTitleBar(); diff --git a/windows/ReactTestApp/MainPage.xaml b/windows/ReactTestApp/MainPage.xaml index 70850f973c..228f053ac3 100644 --- a/windows/ReactTestApp/MainPage.xaml +++ b/windows/ReactTestApp/MainPage.xaml @@ -10,14 +10,7 @@ - - - - - - - - + @@ -30,15 +23,13 @@ - - - + -