130 lines
5.6 KiB
XML
130 lines
5.6 KiB
XML
<Window xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:wpf="clr-namespace:Material.Styles.Assists;assembly=Material.Styles"
|
|
xmlns:material="clr-namespace:Material.Styles;assembly=Material.Styles"
|
|
xmlns:assists="clr-namespace:Material.Styles.Assists;assembly=Material.Styles"
|
|
xmlns:main="clr-namespace:Material.Dialog"
|
|
xmlns:icons="clr-namespace:Material.Dialog.Icons"
|
|
xmlns:model="clr-namespace:Material.Dialog.ViewModels.TextField"
|
|
xmlns:viewModels="clr-namespace:Material.Dialog.ViewModels"
|
|
x:Class="Material.Dialog.Views.TextFieldDialog"
|
|
SizeToContent="WidthAndHeight"
|
|
Title="{CompiledBinding WindowTitle}"
|
|
CanResize="False"
|
|
WindowStartupLocation="{CompiledBinding WindowStartupLocation}"
|
|
HorizontalContentAlignment="Stretch"
|
|
x:DataType="viewModels:TextFieldDialogViewModel">
|
|
<Window.Styles>
|
|
<StyleInclude Source="avares://Material.Dialog/Icons/DialogIconStyle.axaml"/>
|
|
<Style Selector="Window[SystemDecorations=None]">
|
|
<Setter Property="Padding" Value="32"/>
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="TransparencyLevelHint" Value="Transparent"/>
|
|
</Style>
|
|
</Window.Styles>
|
|
|
|
<material:Card Name="PART_ContentRoot" Padding="0"
|
|
assists:ShadowAssist.ShadowDepth="CenterDepth4">
|
|
<Grid Name="PART_Root"
|
|
Width="{CompiledBinding Width}"
|
|
MaxWidth="{CompiledBinding MaxWidth}"
|
|
HorizontalAlignment="Stretch">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="24"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="24"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="24"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="14"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="16"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid Grid.Column="1" Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<ContentPresenter Width="32" Height="32" Margin="0,0,8,0"
|
|
IsVisible="{CompiledBinding !!DialogIcon}"
|
|
Content="{CompiledBinding DialogIcon}"/>
|
|
|
|
<TextBlock Name="PART_Header"
|
|
Classes="Headline6"
|
|
Grid.Column="1"
|
|
VerticalAlignment="Center"
|
|
IsVisible="{CompiledBinding !!ContentHeader.Length}"
|
|
Text="{CompiledBinding ContentHeader, FallbackValue='Dialog header'}"/>
|
|
</Grid>
|
|
|
|
<StackPanel Grid.Column="1" Grid.Row="3">
|
|
<TextBlock Name="PART_SupportingText"
|
|
Classes="Body1"
|
|
TextWrapping="Wrap"
|
|
IsVisible="{CompiledBinding !!ContentMessage.Length}"
|
|
Text="{CompiledBinding ContentMessage, FallbackValue='Dialog supporting text'}"/>
|
|
|
|
<ItemsControl Name="PART_Fields" HorizontalAlignment="Stretch"
|
|
Items="{CompiledBinding TextFields}"
|
|
Margin="4">
|
|
<ItemsControl.Styles>
|
|
<Style Selector="TextBox">
|
|
<Setter Property="Margin" Value="4"/>
|
|
</Style>
|
|
</ItemsControl.Styles>
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel/>
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate DataType="model:TextFieldViewModel">
|
|
<TextBox Name="PART_Field" PasswordChar="{CompiledBinding MaskChar}"
|
|
HorizontalAlignment="Stretch"
|
|
MaxLength="{CompiledBinding MaxCountChars}"
|
|
Text="{CompiledBinding Text, Mode=TwoWay}"
|
|
Watermark="{CompiledBinding PlaceholderText}"
|
|
UseFloatingWatermark="True"
|
|
wpf:TextFieldAssist.Hints="{CompiledBinding Error}"
|
|
wpf:TextFieldAssist.Label="{CompiledBinding Label}"/>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</StackPanel>
|
|
|
|
<Grid Grid.Column="0"
|
|
Grid.ColumnSpan="3"
|
|
Grid.Row="5">
|
|
<ItemsControl HorizontalAlignment="Stretch"
|
|
Items="{CompiledBinding DialogButtons}"
|
|
Margin="4">
|
|
<ItemsControl.Styles>
|
|
<Style Selector="Button">
|
|
<Setter Property="Margin" Value="4"/>
|
|
</Style>
|
|
</ItemsControl.Styles>
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="{CompiledBinding ButtonsStackOrientation}"
|
|
HorizontalAlignment="Right"/>
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate DataType="main:DialogResultButton">
|
|
<Button Classes="Flat" Tag="{CompiledBinding Result}"
|
|
Content="{CompiledBinding Content, FallbackValue=Null}"
|
|
Command="{Binding ElementName=PART_Root,
|
|
Path=DataContext.ButtonClick}"
|
|
CommandParameter="{CompiledBinding }"/>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</Grid>
|
|
</Grid>
|
|
</material:Card>
|
|
</Window>
|