284 строки
16 KiB
XML
284 строки
16 KiB
XML
<Page x:Class="CommunityToolkit.WinUI.SampleApp.Shell"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:xamarin="http://uno/xamarin"
|
|
xmlns:banner="using:Uno.UI.Sample.Banner"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:animations="using:CommunityToolkit.WinUI.UI.Animations"
|
|
xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="using:CommunityToolkit.WinUI.SampleApp"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:media="using:CommunityToolkit.WinUI.UI.Media"
|
|
xmlns:ui="using:CommunityToolkit.WinUI.UI"
|
|
xmlns:winui="using:Microsoft.UI.Xaml.Controls"
|
|
ui:TitleBarExtensions.BackgroundColor="{StaticResource Brand-Color}"
|
|
ui:TitleBarExtensions.ButtonBackgroundColor="{StaticResource Brand-Color}"
|
|
ui:TitleBarExtensions.ButtonForegroundColor="{StaticResource Titlebar-Foreground}"
|
|
ui:TitleBarExtensions.ForegroundColor="{StaticResource Titlebar-Foreground}"
|
|
SizeChanged="Page_SizeChanged"
|
|
mc:Ignorable="d">
|
|
<Page.Resources>
|
|
<DataTemplate x:Key="CategoryTemplate"
|
|
x:DataType="local:SampleCategory">
|
|
<Grid>
|
|
<TextBlock VerticalAlignment="Center"
|
|
FontFamily="Segoe UI"
|
|
FontSize="15px"
|
|
FontWeight="Normal"
|
|
Text="{x:Bind Name}" />
|
|
</Grid>
|
|
</DataTemplate>
|
|
</Page.Resources>
|
|
<banner:BannerControl
|
|
LinkToUnoPlatformApp="https://github.com/unoplatform/Uno.WindowsCommunityToolkit"
|
|
LinkToOriginalApp="https://github.com/windows-toolkit/WindowsCommunityToolkit"
|
|
AppName="Windows Community Toolkit"
|
|
AppAuthor="Microsoft">
|
|
<Grid>
|
|
<winui:NavigationView x:Name="NavView"
|
|
IsSettingsVisible="False"
|
|
ItemInvoked="NavView_ItemInvoked"
|
|
MenuItemTemplate="{StaticResource CategoryTemplate}"
|
|
PaneDisplayMode="Top"
|
|
SelectionFollowsFocus="Disabled">
|
|
<winui:NavigationView.Resources>
|
|
<CornerRadius x:Key="NavigationViewContentGridCornerRadius">0,0,0,0</CornerRadius>
|
|
</winui:NavigationView.Resources>
|
|
<winui:NavigationView.AutoSuggestBox>
|
|
<AutoSuggestBox x:Name="SearchBox"
|
|
MinWidth="150"
|
|
VerticalAlignment="Center"
|
|
KeyDown="SearchBox_KeyDown"
|
|
QueryIcon="Find"
|
|
QuerySubmitted="SearchBox_QuerySubmitted"
|
|
TextChanged="SearchBox_TextChanged" />
|
|
</winui:NavigationView.AutoSuggestBox>
|
|
<winui:NavigationView.PaneFooter>
|
|
<!-- Not sure why we can't get to display properly with FooterMenuItems -->
|
|
<winui:NavigationViewItem x:Name="SettingsTopNavPaneItem"
|
|
Icon="Home"
|
|
PointerReleased="SettingsTopNavPaneItem_PointerReleased"
|
|
Style="{ThemeResource MUX_NavigationViewSettingsItemStyleWhenOnTopPane}" />
|
|
</winui:NavigationView.PaneFooter>
|
|
<Grid>
|
|
<winui:ParallaxView x:Name="Parallax"
|
|
VerticalShift="50">
|
|
<Image Source="Assets/Photos/Backgrounds/hero.jpg"
|
|
Stretch="UniformToFill" />
|
|
</winui:ParallaxView>
|
|
<Frame x:Name="NavigationFrame" />
|
|
<Grid>
|
|
<!-- UNO TODO: UIElementExtensions.VisualFactory issue-->
|
|
<win:Border x:Name="ContentShadow"
|
|
Background="{ThemeResource BackingTint}"
|
|
Tapped="ContentShadow_Tapped"
|
|
Visibility="{Binding Visibility, ElementName=SamplePickerGrid}">
|
|
<media:UIElementExtensions.VisualFactory>
|
|
<media:PipelineVisualFactory Source="{media:BackdropSource}">
|
|
<media:BlurEffect Amount="8" />
|
|
</media:PipelineVisualFactory>
|
|
</media:UIElementExtensions.VisualFactory>
|
|
<animations:Implicit.ShowAnimations>
|
|
<animations:OpacityAnimation From="0"
|
|
To="1"
|
|
Duration="0:0:0.3" />
|
|
</animations:Implicit.ShowAnimations>
|
|
<animations:Implicit.HideAnimations>
|
|
<animations:OpacityAnimation From="1"
|
|
To="0"
|
|
Duration="0:0:0.2" />
|
|
</animations:Implicit.HideAnimations>
|
|
</win:Border>
|
|
|
|
<Grid x:Name="SamplePickerGrid"
|
|
VerticalAlignment="Top"
|
|
x:DeferLoadStrategy="Lazy"
|
|
Visibility="Collapsed">
|
|
<controls:DropShadowPanel Margin="0,0,0,-3"
|
|
VerticalAlignment="Bottom"
|
|
HorizontalContentAlignment="Stretch"
|
|
VerticalContentAlignment="Stretch"
|
|
BlurRadius="10"
|
|
ShadowOpacity="0.7"
|
|
Color="Black">
|
|
<Border Height="1" />
|
|
</controls:DropShadowPanel>
|
|
|
|
<Border Background="{ThemeResource Menu-DropDown-Background}" />
|
|
|
|
<GridView x:Name="SamplePickerGridView"
|
|
animations:ItemsReorderAnimation.Duration="0:0:0.200"
|
|
ChoosingItemContainer="SamplePickerGridView_ChoosingItemContainer"
|
|
IsItemClickEnabled="True"
|
|
ItemClick="SamplePickerGridView_ItemClick"
|
|
ItemContainerStyle="{StaticResource SamplePickerItemStyle}"
|
|
win:ItemContainerTransitions="{x:Null}"
|
|
ItemTemplate="{StaticResource SampleTemplate}"
|
|
SelectionMode="Single"
|
|
win:Transitions="{x:Null}">
|
|
<GridView.GroupStyle>
|
|
<GroupStyle>
|
|
<GroupStyle.HeaderTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Key}" />
|
|
</DataTemplate>
|
|
</GroupStyle.HeaderTemplate>
|
|
</GroupStyle>
|
|
</GridView.GroupStyle>
|
|
<animations:Implicit.ShowAnimations>
|
|
<animations:OpacityAnimation Delay="0:0:0.2"
|
|
From="0"
|
|
To="1"
|
|
Duration="0:0:0.3" />
|
|
</animations:Implicit.ShowAnimations>
|
|
</GridView>
|
|
<!--
|
|
UNO TODO https://github.com/unoplatform/uno/issues/5376
|
|
<animations:Implicit.ShowAnimations>
|
|
<animations:OpacityAnimation From="0"
|
|
To="1"
|
|
Duration="0:0:0.3" />
|
|
<animations:TranslationAnimation From="0, -1000, 0"
|
|
To="0"
|
|
Duration="0:0:0.3" />
|
|
</animations:Implicit.ShowAnimations>
|
|
<animations:Implicit.HideAnimations>
|
|
<animations:OpacityAnimation From="1"
|
|
To="0"
|
|
Duration="0:0:0.5" />
|
|
<animations:TranslationAnimation From="0"
|
|
To="0, -1000, 0"
|
|
Duration="0:0:0.5" />
|
|
</animations:Implicit.HideAnimations>
|
|
-->
|
|
</Grid>
|
|
|
|
</Grid>
|
|
</Grid>
|
|
</winui:NavigationView>
|
|
<Canvas x:Name="MoreInfoCanvas"
|
|
Grid.RowSpan="2"
|
|
Background="Transparent"
|
|
Tapped="MoreInfoCanvas_Tapped"
|
|
Visibility="Collapsed">
|
|
|
|
<Grid x:Name="MoreInfoContent"
|
|
Width="260"
|
|
Height="320"
|
|
ui:VisualExtensions.NormalizedCenterPoint="0.5">
|
|
<Grid VerticalAlignment="Top">
|
|
<controls:DropShadowPanel HorizontalContentAlignment="Stretch"
|
|
VerticalContentAlignment="Stretch"
|
|
BlurRadius="60"
|
|
OffsetY="6"
|
|
ShadowOpacity="0.6"
|
|
Color="Black">
|
|
<Border Background="{ThemeResource Menu-DropDown-Background}"
|
|
Opacity="0.96">
|
|
<!-- UNO TODO: UIElementExtensions.VisualFactory issue
|
|
<media:UIElementExtensions.VisualFactory>
|
|
<media:PipelineVisualFactory Source="{media:BackdropSource}">
|
|
<media:BlurEffect Amount="8" />
|
|
</media:PipelineVisualFactory>
|
|
</media:UIElementExtensions.VisualFactory>
|
|
-->
|
|
</Border>
|
|
</controls:DropShadowPanel>
|
|
|
|
<Grid Padding="10">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="160" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid Grid.Row="0"
|
|
Background="{ThemeResource SampleIconBacking}">
|
|
<Image x:Name="MoreInfoImage"
|
|
Width="240"
|
|
Height="160"
|
|
Source="{Binding Icon}" />
|
|
</Grid>
|
|
|
|
<StackPanel Grid.Row="1">
|
|
<TextBlock Margin="0,10"
|
|
FontSize="14"
|
|
FontWeight="SemiBold"
|
|
Text="{Binding Name}"
|
|
TextTrimming="CharacterEllipsis" />
|
|
|
|
<TextBlock FontSize="12"
|
|
Text="{Binding About}"
|
|
TextWrapping="Wrap" />
|
|
|
|
<Border Margin="0,10,0,0"
|
|
HorizontalAlignment="Left"
|
|
Background="{StaticResource Brush-Blue-01}"
|
|
Opacity="1"
|
|
Visibility="{Binding BadgeUpdateVersionRequired, Converter={StaticResource EmptyStringToObject}}">
|
|
<TextBlock Margin="2"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Bottom"
|
|
FontSize="10"
|
|
Foreground="{ThemeResource Brush-Main}"
|
|
Text="{Binding BadgeUpdateVersionRequired}" />
|
|
<!--
|
|
UNO TODO https://github.com/unoplatform/uno/issues/5376
|
|
<animations:Implicit.HideAnimations>
|
|
<animations:OpacityAnimation To="0"
|
|
Duration="0:0:0.01" />
|
|
</animations:Implicit.HideAnimations>
|
|
<animations:Implicit.ShowAnimations>
|
|
<animations:OpacityAnimation Delay="0:0:0.2"
|
|
From="0"
|
|
To="1"
|
|
Duration="0:0:0.4" />
|
|
<animations:TranslationAnimation Delay="0:0:0.2"
|
|
From="0, 20, 0"
|
|
To="0"
|
|
Duration="0:0:0.3" />
|
|
</animations:Implicit.ShowAnimations>
|
|
-->
|
|
</Border>
|
|
|
|
<!--
|
|
UNO TODO https://github.com/unoplatform/uno/issues/5376
|
|
<animations:Implicit.ShowAnimations>
|
|
<animations:OpacityAnimation Delay="0:0:0.2"
|
|
From="0"
|
|
To="1"
|
|
Duration="0:0:0.4" />
|
|
<animations:TranslationAnimation Delay="0:0:0.2"
|
|
From="0, 20, 0"
|
|
To="0"
|
|
Duration="0:0:0.3" />
|
|
</animations:Implicit.ShowAnimations>
|
|
-->
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
|
|
<!--
|
|
UNO TODO https://github.com/unoplatform/uno/issues/5376
|
|
<animations:Implicit.ShowAnimations>
|
|
<animations:OpacityAnimation From="0"
|
|
To="1"
|
|
Duration="0:0:0.3" />
|
|
<animations:ScaleAnimation From="0.5"
|
|
To="1"
|
|
Duration="0:0:0.3" />
|
|
</animations:Implicit.ShowAnimations>
|
|
<animations:Implicit.HideAnimations>
|
|
<animations:OpacityAnimation From="1"
|
|
To="0"
|
|
Duration="0:0:0.2" />
|
|
<animations:ScaleAnimation From="1"
|
|
To="0.5"
|
|
Duration="0:0:0.2" />
|
|
</animations:Implicit.HideAnimations>
|
|
-->
|
|
</Grid>
|
|
</Canvas>
|
|
</Grid>
|
|
</banner:BannerControl>
|
|
</Page> |