Files
UWP-Visual-Asset-Generator/Views/MainView.xaml
2021-08-25 11:01:19 -04:00

213 lines
9.0 KiB
XML

<Page
x:Class="UWP_Visual_Asset_Generator.Views.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
xmlns:animations="using:Microsoft.Toolkit.Uwp.UI.Animations"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:UWP_Visual_Asset_Generator.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:uc="using:UWP_Visual_Asset_Generator.UserControls"
Background="{ThemeResource SystemControlAcrylicWindowMediumHighBrush}"
Loaded="Page_Loaded"
mc:Ignorable="d">
<Page.Resources>
<Storyboard x:Name="animationOpacityPulse">
<DoubleAnimation
AutoReverse="True"
RepeatBehavior="Forever"
Storyboard.TargetName="LoadingLogo"
Storyboard.TargetProperty="Opacity"
From="1"
To="0.5"
Duration="0:0:1" />
</Storyboard>
</Page.Resources>
<Grid>
<Grid Tag="Main Content Area">
<Grid.RowDefinitions>
<RowDefinition Height="32" />
<RowDefinition Height="*" />
<!--<RowDefinition Height="auto"/>-->
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="3*" />
</Grid.ColumnDefinitions>
<!-- Titlebar -->
<Grid
Grid.Row="0"
Grid.ColumnSpan="2"
Canvas.ZIndex="400">
<StackPanel Orientation="Horizontal">
<!-- App icon (Hidden for now) -->
<Image
x:Name="imgAppIcon"
Width="16"
Height="16"
Margin="16,0"
Source="ms-appx:///Assets/Square44x44Logo.altform-unplated_targetsize-256.png"
Visibility="Collapsed" />
</StackPanel>
</Grid>
<!-- End of Titlebar -->
<!-- Sidebar -->
<uc:SidebarUserControl Grid.RowSpan="2" Grid.Column="0" />
<!-- Assetsbrowser -->
<uc:AssetBrowserUserControl
Grid.Row="1"
Grid.Column="1"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch" />
<!-- Assets editor -->
<uc:AssetEditUserControl
Grid.Row="1"
Grid.Column="1"
Visibility="{x:Bind mainViewModel.ShowEditCurrentImage, Mode=OneWay}" />
<!-- Commandbar -->
<controls:DropShadowPanel
Grid.Row="1"
Grid.Column="1"
Margin="24"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
BlurRadius="10"
Canvas.ZIndex="200"
OffsetX="4"
OffsetY="4"
ShadowOpacity="0.3"
Color="Black">
<CommandBar DefaultLabelPosition="Right">
<CommandBar.PrimaryCommands>
<!-- Primary Command -->
<AppBarButton
x:Name="btn_Save"
x:Uid="Save"
Windows10version1809:CornerRadius="2,0,0,2"
Background="{ThemeResource SystemControlBackgroundAccentBrush}"
Click="Btn_Save_Click"
Foreground="{ThemeResource SystemControlForegroundChromeWhiteBrush}"
Icon="Save"
IsEnabled="{x:Bind mainViewModel.SaveEnabled, Mode=OneWay}"
Label="Save assets"
ToolTipService.ToolTip="Save Assets" />
<!-- Secondary Commands -->
<!-- Hide the label of these items and show what they do in the tooltip -->
</CommandBar.PrimaryCommands>
<!-- Overflow Commands -->
<CommandBar.SecondaryCommands>
<!-- App info -->
<Windows10version1809:AppBarElementContainer>
<TextBlock
x:Uid="AppInfo"
Margin="12,6"
Text="App info" />
</Windows10version1809:AppBarElementContainer>
<Windows10version1809:AppBarSeparator />
<AppBarButton
x:Name="hmi_ShowWelcomeUSerControl"
x:Uid="WelcomeBtn"
Icon="Home"
Label="Welcome"
Tapped="Hmi_ShowWelcomeUSerControl_Tapped" />
<AppBarButton Icon="World" Label="{x:Bind mainViewModel.Settings.AppVersion, Mode=OneWay}" />
<AppBarSeparator />
<AppBarButton
x:Name="hmi_ZeroOutPadding"
Icon="Cancel"
Label="0 out all Pading"
Tapped="hmi_ZeroOutPadding_Tapped" />
<AppBarButton
x:Name="hmi_ApplyRecommendedPadding"
Icon="Crop"
Label="Apply recommended padding"
Tapped="hmi_ApplyRecommendedPadding_Tapped" />
<AppBarToggleButton
x:Name="hmi_ToggleAccentColour"
x:Uid="ToggleAccentColour"
Icon="Bold"
Label="View Assets with Accent colour"
Tapped="Hmi_ToggleAccentColour_Tapped"
ToolTipService.ToolTip="View Assets with Accent colour" />
</CommandBar.SecondaryCommands>
</CommandBar>
</controls:DropShadowPanel>
<!-- End of CommandBar -->
</Grid>
<uc:WelcomeUserControl x:Name="WelcomeControl" x:Load="{x:Bind mainViewModel.Settings.ShowWelcomePage, Mode=OneWay}">
<animations:Implicit.ShowAnimations>
<animations:OpacityAnimation
From="0.0"
To="1.0"
Duration="0:0:0.5" />
</animations:Implicit.ShowAnimations>
<animations:Implicit.HideAnimations>
<animations:OpacityAnimation
From="1.0"
To="0.0"
Duration="0:0:0.5" />
</animations:Implicit.HideAnimations>
</uc:WelcomeUserControl>
<controls:Loading
Margin="0"
Background="{ThemeResource SystemControlBackgroundAccentBrush}"
IsLoading="{x:Bind mainViewModel.Thinking, Mode=OneWay}"
Opacity="0.8">
<StackPanel Padding="12">
<controls:DropShadowPanel
Grid.Row="0"
Margin="12"
HorizontalAlignment="Center"
VerticalAlignment="Center"
BlurRadius="8"
OffsetX="2"
OffsetY="2"
ShadowOpacity="0.7"
Color="{ThemeResource SystemColorButtonFaceColor}">
<Image
x:Name="LoadingLogo"
Height="100"
Source="/Assets/SmallTile.scale-200.png" />
</controls:DropShadowPanel>
<controls:DropShadowPanel
Grid.Row="0"
Margin="8"
VerticalAlignment="Center"
BlurRadius="8"
OffsetX="2"
OffsetY="2"
ShadowOpacity="0.7"
Color="{ThemeResource SystemColorButtonFaceColor}">
<TextBlock
x:Name="tbLoadingText"
MinWidth="180"
VerticalAlignment="Center"
Style="{StaticResource SubtitleTextBlockStyle}"
Text="{x:Bind mainViewModel.ThinkingText, Mode=OneWay}"
TextAlignment="Center" />
</controls:DropShadowPanel>
</StackPanel>
</controls:Loading>
</Grid>
</Page>