Files
Pilz/Pilz.UI.AvaloniaUI/Dialogs/AvaloniaFlyoutBase.axaml
2025-11-16 08:44:04 +01:00

90 lines
3.1 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="https://git.pilzinsel64.de/pilz-framework/pilz"
xmlns:dialogs="clr-namespace:Pilz.UI.AvaloniaUI.Dialogs"
xmlns:symbols="clr-namespace:Pilz.UI.Symbols;assembly=Pilz.UI"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
x:Class="Pilz.UI.AvaloniaUI.Dialogs.AvaloniaFlyoutBase">
<Grid
ColumnDefinitions="*"
RowDefinitions="Auto,*,Auto"
>
<!-- StackPanel: Header -->
<StackPanel
x:Name="StackPanelHeader"
Grid.Row="0"
Orientation="Horizontal"
HorizontalAlignment="Stretch"
Margin="3"
IsVisible="False"
>
<Image
x:Name="ImageTitle"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Width="{x:Static symbols:SymbolGlobals.DefaultImageSmallSize}"
Height="{x:Static symbols:SymbolGlobals.DefaultImageSmallSize}"
/>
<TextBlock
HorizontalAlignment="Left"
VerticalAlignment="Center"
x:Name="LabelTitle"
/>
</StackPanel>
<!-- Panel: Content -->
<ContentPresenter
Grid.Row="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="3"
Content="{Binding MainContent, RelativeSource={RelativeSource AncestorType=dialogs:AvaloniaFlyoutBase}}"
/>
<!-- StackPanel: Footer -->
<Grid
x:Name="StackPanelFooter"
Grid.Row="2"
RowDefinitions="Auto"
ColumnDefinitions="*,Auto,Auto"
HorizontalAlignment="Stretch"
>
<ContentPresenter
Grid.Column="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="3"
Content="{Binding FooterContent, RelativeSource={RelativeSource AncestorType=dialogs:AvaloniaFlyoutBase}}"
/>
<!-- Button: Okay -->
<controls:ImageButton
Grid.Column="1"
x:Name="ButtonOkay"
HorizontalAlignment="Right"
Margin="3"
Text="Okay"
Click="ButtonOkay_OnClick"
/>
<!-- Button: Cancel -->
<controls:ImageButton
Grid.Column="2"
x:Name="ButtonCancel"
HorizontalAlignment="Right"
Margin="3"
Text="Cancel"
Click="ButtonCancel_OnClick"
/>
</Grid>
</Grid>
</UserControl>