Skip to content

Commit

Permalink
WinUI 2 Gallery Visual Revamp (microsoft#934)
Browse files Browse the repository at this point in the history
* add imageIconPath

* home page update layout

* add uri

* update more icons on home page

* main banner placement update

* add subtitle

* update header tiles

* update icons

* update all controls page

* update info badge

* update narrow width view

* update header tile image

* add newest icons!

* Added template studio link + fixed some bugs

- Added template studio tile
- App title changing to white in dark mode --> now always black
- Changed sized of tiles
- Changed color of tiles to work in light + dark mode
- Updated corner radius

* Updated the title name

* Update XamlControlsGallery/App.xaml

Co-authored-by: Marcel Wagner <marcel.alex.wagner@outlook.com>

* Fixed headers

- removed interactions to be more consistent with WinUI 3 Gallery + interactions were often laggy
- made text black for both light and dark modes

* Additional few tweaks

Co-authored-by: Karen Lai <biilai@microsoft.com>
Co-authored-by: Karen Lai <7976322+karenbtlai@users.noreply.github.com>
Co-authored-by: Marcel Wagner <marcel.alex.wagner@outlook.com>
Co-authored-by: Bob Pulliam <bpulliam@microsoft.com>
  • Loading branch information
5 people committed May 15, 2022
1 parent c23c72c commit ad4c20c
Show file tree
Hide file tree
Showing 193 changed files with 688 additions and 277 deletions.
50 changes: 27 additions & 23 deletions XamlControlsGallery/AllControlsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="itemGridView.Padding" Value="12,0,12,36" />
<Setter Target="itemGridView.Margin" Value="0,-80,0,0" />
<Setter Target="itemGridView.Margin" Value="0,-44,0,0" />
<Setter Target="headerImageView.Margin" Value="-12,0,-12,12" />
<Setter Target="itemGridView.ItemContainerStyle" Value="{StaticResource GridViewItemStyleSmall}" />
<Setter Target="pageHeader.Visibility" Value="Collapsed" />
<Setter Target="smallHeaderText.Visibility" Value="Visible"/>
<Setter Target="smallHeaderText.Visibility" Value="Collapsed"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>

<GridView x:Name="itemGridView"
Padding="40,0,0,36"
Margin="31,0,0,0"
AutomationProperties.AutomationId="ItemGridView"
AutomationProperties.Name="Items In Group"
ContainerContentChanging="OnItemGridViewContainerContentChanging"
Expand All @@ -62,43 +62,47 @@
Loaded="OnItemGridViewLoaded"
SizeChanged="OnItemGridViewSizeChanged"
SelectionMode="None">
<interactivity:Interaction.Behaviors>
<!--<interactivity:Interaction.Behaviors>
<behavior:ImageScrollBehavior TargetControl="{Binding ElementName=pageHeader}" />
</interactivity:Interaction.Behaviors>
</interactivity:Interaction.Behaviors>-->

<GridView.Header>
<Grid Margin="-40,0,0,-60" Height="230">
<Grid Margin="12,39,43,0">
<ParallaxView
x:Name="headerImageView"
Height="250"
Margin="0,0,0,0"
Margin="0,0,0,28"
Height="200"
Source="{x:Bind itemGridView}"
VerticalShift="350">
<Image
x:Name="headerImage"
HorizontalAlignment="Center"
Source="Assets/MainPage_Banner.png"
Stretch="Uniform" />
VerticalShift="0">
<Grid CornerRadius="{StaticResource ControlCornerRadius}">
<Image
x:Name="headerImage"
HorizontalAlignment="Center"
Source="Assets/MainPage_Banner.png"
Stretch="Fill" />
</Grid>

</ParallaxView>
<Rectangle Height="60" VerticalAlignment="Bottom" Fill="{StaticResource HeroImageGradientBrush}"/>

<TextBlock x:Name="smallHeaderText"
Foreground="{ThemeResource PageHeaderForegroundBrush}"
Visibility="Collapsed"
Foreground="Black"
Visibility="Visible"
Style="{StaticResource TitleTextBlockStyle}"
Text="{StaticResource ControlsName}"
Margin="84,24,0,0" />
Text="All controls"
Margin="50,50,0,20" />
</Grid>
</GridView.Header>
</GridView>

<local:PageHeader x:Name="pageHeader"
Title="{StaticResource ControlsName}"
<!--<local:PageHeader x:Name="pageHeader"
Title= "All controls"
Margin="44,92"
VerticalAlignment="Top"
Foreground="{ThemeResource PageHeaderForegroundBrush}"
Foreground="Black"
Background="{ThemeResource HomePageBackgroundBrush}"
FontSize="28"
Padding="{ThemeResource NavigationViewHeaderMargin}"
IsHitTestVisible="False"
ShadowOpacity="0"/>
ShadowOpacity="0"/>-->
</Grid>
</local:ItemsPageBase>
6 changes: 3 additions & 3 deletions XamlControlsGallery/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<CornerRadius x:Key="ControlCornerRadius">4</CornerRadius>
<CornerRadius x:Key="ControlCornerRadius">8</CornerRadius>

<LinearGradientBrush x:Key="HeroImageGradientBrush" StartPoint="0.5,0" EndPoint="0.5,1.5">
<GradientStop Offset="0" Color="Transparent"/>
Expand Down Expand Up @@ -84,8 +84,8 @@

<SolidColorBrush x:Key="GridViewHeaderItemDividerStroke" Color="Transparent"/>

<x:String x:Key="ControlsName">All controls</x:String>
<x:String x:Key="NewControlsName">What's New</x:String>
<x:String x:Key="AppTitleName">WinUI 2 Gallery</x:String>
<x:String x:Key="WinUIVersion">SDK 2.8</x:String>

<Style x:Key="OutputTextBlockStyle" BasedOn="{StaticResource BodyTextBlockStyle}" TargetType="TextBlock">
<Setter Property="Margin" Value="8,8,0,0" />
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added XamlControlsGallery/Assets/ControlImages/Grid.png
Binary file modified XamlControlsGallery/Assets/MainPage_Banner.png
Binary file added XamlControlsGallery/Assets/gettingStarted.png
Binary file added XamlControlsGallery/Assets/githubTile.png
Binary file added XamlControlsGallery/Assets/style-1x.png
Binary file added XamlControlsGallery/Assets/template_studio.png
2 changes: 1 addition & 1 deletion XamlControlsGallery/Behaviors/ImageScrollBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ImageScrollBehavior : DependencyObject, IBehavior
private const int _alpha = 255;
private const int _maxFontSize = 28;
private const int _minFontSize = 10;
private const int scrollViewerThresholdValue = 85;
private const int scrollViewerThresholdValue = 100;

private ScrollViewer scrollViewer;
private ListViewBase listGridView;
Expand Down
8 changes: 4 additions & 4 deletions XamlControlsGallery/Common/ImageLoader.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using AppUIBasics.Data;
using AppUIBasics.Data;
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
Expand Down Expand Up @@ -27,13 +27,13 @@ private async static void OnPropertyChanged(DependencyObject d, DependencyProper
if (d is Image image)
{
var item = await ControlInfoDataSource.Instance.GetItemAsync(e.NewValue?.ToString());
if (item?.ImagePath != null)
if (item?.ImageIconPath != null)
{
Uri imageUri = new Uri(item.ImagePath, UriKind.Absolute);
Uri imageUri = new Uri(item.ImageIconPath, UriKind.Absolute);
BitmapImage imageBitmap = new BitmapImage(imageUri);
image.Source = imageBitmap;
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private void SelectControl(ControlInfoDataItem control)
{
ControlDetails.Visibility = Visibility.Visible;

BitmapImage image = new BitmapImage(new Uri(control.ImagePath));
BitmapImage image = new BitmapImage(new Uri(control.ImageIconPath));
ControlImage.Source = image;

ControlTitle.Text = control.Title;
Expand Down
2 changes: 1 addition & 1 deletion XamlControlsGallery/ControlPages/ListViewPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<Page.Resources>
<DataTemplate x:Key="IconTextTemplate" x:DataType="data:ControlInfoDataItem">
<RelativePanel>
<Image x:Name="image" Height="36" Width="36" Margin="0,8,0,8" Source="{x:Bind ImagePath}" Stretch="UniformToFill" />
<Image x:Name="image" Height="36" Width="36" Margin="0,8,0,8" Source="{x:Bind ImageIconPath}" Stretch="UniformToFill" />
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Margin="8,8,0,0" RelativePanel.RightOf="image">
<TextBlock Text="{x:Bind Title}" Style="{StaticResource BaseTextBlockStyle}" />
<TextBlock Text="{x:Bind Subtitle}" Margin="0,4,8,0" Style="{StaticResource BodyTextBlockStyle}" />
Expand Down
6 changes: 3 additions & 3 deletions XamlControlsGallery/ControlPages/SemanticZoomPage.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--
<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
Expand All @@ -25,7 +25,7 @@

<DataTemplate x:Key="ZoomedInTemplate" x:DataType="data:ControlInfoDataItem">
<StackPanel Orientation="Horizontal" MinWidth="200" Margin="12,6,12,6">
<Image Source="{x:Bind ImagePath}" Width="36"/>
<Image Source="{x:Bind ImageIconPath}" Width="36"/>
<StackPanel Margin="20,0,0,0">
<TextBlock Text="{x:Bind Title}" Style="{StaticResource BaseTextBlockStyle}"/>
<TextBlock Text="{x:Bind Subtitle}" TextWrapping="Wrap" HorizontalAlignment="Left" Width="300" Style="{StaticResource BodyTextBlockStyle}"/>
Expand Down Expand Up @@ -79,4 +79,4 @@
</local:ControlExample.Xaml>
</local:ControlExample>
</StackPanel>
</Page>
</Page>
Loading

0 comments on commit ad4c20c

Please sign in to comment.