From 77635eeadbd9055473aad4162fde8356081b9b58 Mon Sep 17 00:00:00 2001 From: Niels Laute Date: Thu, 12 Dec 2024 22:05:35 +0100 Subject: [PATCH] [UX] Pageheader improvements (#1679) ![image](https://github.com/user-attachments/assets/ee4b7050-934a-468a-a495-b48e08441da8) This PR moves the `Namespace` and `Inheritance` information in a flyout. Closes #1678 --------- Co-authored-by: Jay <65828559+Jay-o-Way@users.noreply.github.com> --- WinUIGallery/Controls/PageHeader.xaml | 218 +++++++++++++++-------- WinUIGallery/Controls/PageHeader.xaml.cs | 8 + WinUIGallery/ItemPage.xaml | 85 +++------ 3 files changed, 173 insertions(+), 138 deletions(-) diff --git a/WinUIGallery/Controls/PageHeader.xaml b/WinUIGallery/Controls/PageHeader.xaml index 8205084a5..666e08d54 100644 --- a/WinUIGallery/Controls/PageHeader.xaml +++ b/WinUIGallery/Controls/PageHeader.xaml @@ -10,6 +10,7 @@ xmlns:data="using:WinUIGallery.Data" xmlns:local="using:WinUIGallery.DesktopWap.Controls" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + Loaded="UserControl_Loaded" mc:Ignorable="d"> @@ -17,31 +18,81 @@ x:Name="collectionConverter" EmptyValue="Collapsed" NotEmptyValue="Visible" /> + - - - - - + + + + + - + @@ -78,19 +131,19 @@ - + - - + + - + @@ -98,65 +151,72 @@ - - - - - - + - - - - + - + diff --git a/WinUIGallery/Controls/PageHeader.xaml.cs b/WinUIGallery/Controls/PageHeader.xaml.cs index 9543a56e0..b1d4478e2 100644 --- a/WinUIGallery/Controls/PageHeader.xaml.cs +++ b/WinUIGallery/Controls/PageHeader.xaml.cs @@ -91,5 +91,13 @@ public async void OnFeedBackButtonClick(object sender, RoutedEventArgs e) { await Windows.System.Launcher.LaunchUriAsync(new Uri("https://github.com/microsoft/WinUI-Gallery/issues/new/choose")); } + + private void UserControl_Loaded(object sender, RoutedEventArgs e) + { + if (Item == null || (string.IsNullOrEmpty(Item.ApiNamespace) && Item.BaseClasses == null)) + { + APIDetailsBtn.Visibility = Visibility.Collapsed; + } + } } } diff --git a/WinUIGallery/ItemPage.xaml b/WinUIGallery/ItemPage.xaml index f1bfc4f64..c172ab707 100644 --- a/WinUIGallery/ItemPage.xaml +++ b/WinUIGallery/ItemPage.xaml @@ -34,6 +34,32 @@ + + + + + + + + + + + + + @@ -62,64 +88,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -