mirror of
https://github.com/PacktPublishing/Learn-WinUI-3-Second-Edition.git
synced 2026-06-20 12:23:09 +00:00
100 lines
5.0 KiB
XML
100 lines
5.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Page
|
|
x:Class="MyMediaCollection.Views.ItemDetailsPage"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:local="using:MyMediaCollection.Views"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
mc:Ignorable="d">
|
|
|
|
<Page.Resources>
|
|
<Style x:Key="AttributeTitleStyle" TargetType="TextBlock">
|
|
<Setter Property="HorizontalAlignment" Value="Right"/>
|
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
</Style>
|
|
<Style x:Key="AttributeValueStyle" TargetType="TextBox">
|
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
|
<Setter Property="Margin" Value="8"/>
|
|
</Style>
|
|
<Style x:Key="AttributeComboxValueStyle" TargetType="ComboBox">
|
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
|
<Setter Property="Margin" Value="8"/>
|
|
</Style>
|
|
</Page.Resources>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
<SymbolIcon Symbol="Edit" Margin="8"/>
|
|
<TextBlock Text="Item Details"
|
|
Style="{StaticResource SubheaderTextBlockStyle}"
|
|
Margin="8"/>
|
|
</StackPanel>
|
|
|
|
<Grid Grid.Row="1"
|
|
BorderBrush="{ThemeResource SystemAccentColor}"
|
|
BorderThickness="0,1,0,1"
|
|
Margin="4,0,4,8">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="200"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Text="Name:" Style="{StaticResource AttributeTitleStyle}"/>
|
|
<TextBox Grid.Column="1" Style="{StaticResource AttributeValueStyle}" Text="{x:Bind ViewModel.ItemName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
|
|
|
|
<TextBlock Text="Media Type:" Grid.Row="1" Style="{StaticResource AttributeTitleStyle}"/>
|
|
<ComboBox Grid.Row="1" Grid.Column="1" Style="{StaticResource AttributeComboxValueStyle}" ItemsSource="{x:Bind ViewModel.ItemTypes}" SelectedValue="{x:Bind ViewModel.SelectedItemType, Mode=TwoWay}"/>
|
|
|
|
<TextBlock Text="Medium:" Grid.Row="2" Style="{StaticResource AttributeTitleStyle}"/>
|
|
<ComboBox Grid.Row="2" Grid.Column="1" Style="{StaticResource AttributeComboxValueStyle}" ItemsSource="{x:Bind ViewModel.Mediums}" SelectedValue="{x:Bind ViewModel.SelectedMedium, Mode=TwoWay}"/>
|
|
|
|
<TextBlock Text="Location:" Grid.Row="3" Style="{StaticResource AttributeTitleStyle}"/>
|
|
<ComboBox Grid.Row="3" Grid.Column="1" Style="{StaticResource AttributeComboxValueStyle}" ItemsSource="{x:Bind ViewModel.LocationTypes}" SelectedValue="{x:Bind ViewModel.SelectedLocation, Mode=TwoWay}"/>
|
|
</Grid>
|
|
|
|
<StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Right">
|
|
<SplitButton x:Name="SaveButton"
|
|
Content="Save and Return"
|
|
Margin="8,8,0,8"
|
|
Click="{x:Bind ViewModel.SaveItemAndReturnAsync}"
|
|
IsEnabled="{x:Bind ViewModel.IsDirty, Mode=OneWay}">
|
|
<SplitButton.Flyout>
|
|
<Flyout>
|
|
<StackPanel>
|
|
<Button Content="Save and Create New"
|
|
Click="{x:Bind ViewModel.SaveItemAndContinueAsync}"
|
|
IsEnabled="{x:Bind ViewModel.IsDirty, Mode=OneWay}"
|
|
Background="Transparent"/>
|
|
<Button Content="Save and Return"
|
|
Click="{x:Bind ViewModel.SaveItemAndReturnAsync}"
|
|
IsEnabled="{x:Bind ViewModel.IsDirty, Mode=OneWay}"
|
|
Background="Transparent"/>
|
|
</StackPanel>
|
|
</Flyout>
|
|
</SplitButton.Flyout>
|
|
<SplitButton.Resources>
|
|
<TeachingTip x:Name="SavingTip"
|
|
Target="{x:Bind SaveButton}"
|
|
Title="Save and create new"
|
|
Subtitle="Use the dropdown button option to save your item and create another.">
|
|
</TeachingTip>
|
|
</SplitButton.Resources>
|
|
</SplitButton>
|
|
<Button Content="Cancel" Margin="8" Command="{x:Bind ViewModel.CancelCommand}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Page>
|