Added Cancel and Next button to ContentArea
MODIFY
WalletWasabi.Fluent/Controls/ContentArea.axaml
WalletWasabi.Fluent/Controls/ContentArea.axaml
<ContentPresenter Name="PART_TitlePresenter" Content="{TemplateBinding Title}" />
<ContentPresenter Name="PART_CaptionPresenter" Content="{TemplateBinding Caption}" />
</StackPanel>
+ <Panel DockPanel.Dock="Bottom">
+ <Button Name="PART_CancelButton" IsVisible="{TemplateBinding EnableCancel}" Content="{TemplateBinding CancelContent}" Margin="0,10,10,10" HorizontalAlignment="Left" Command="{Binding CancelCommand}" />
+ <Button Name="PART_BextButton" IsVisible="{TemplateBinding EnableNext}" Content="{TemplateBinding NextContent}" Margin="10,10,0,10" HorizontalAlignment="Right" Command="{Binding NextCommand}" />
+ </Panel>
<ContentPresenter Name="PART_ContentPresenter"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"

MODIFY
WalletWasabi.Fluent/Controls/ContentArea.axaml.cs
WalletWasabi.Fluent/Controls/ContentArea.axaml.cs
@@ -12,6 +12,18 @@ namespace WalletWasabi.Fluent.Controls
public static readonly StyledProperty<object> CaptionProperty =
AvaloniaProperty.Register<ContentArea, object>(nameof(Caption));
+ public static readonly StyledProperty<bool> EnableCancelProperty =
+ AvaloniaProperty.Register<ContentArea, bool>(nameof(EnableCancel));
+
+ public static readonly StyledProperty<bool> EnableNextProperty =
+ AvaloniaProperty.Register<ContentArea, bool>(nameof(EnableNext));
+
+ public static readonly StyledProperty<object> CancelContentProperty =
+ AvaloniaProperty.Register<ContentArea, object>(nameof(CancelContent), "Cancel");
+
+ public static readonly StyledProperty<object> NextContentProperty =
+ AvaloniaProperty.Register<ContentArea, object>(nameof(NextContent), "Next");
+
public object Title
{
get => GetValue(TitleProperty);
@@ -24,6 +36,30 @@ namespace WalletWasabi.Fluent.Controls
set => SetValue(CaptionProperty, value);
}
+ public bool EnableCancel
+ {
+ get => GetValue(EnableCancelProperty);
+ set => SetValue(EnableCancelProperty, value);
+ }
+
+ public bool EnableNext
+ {
+ get => GetValue(EnableNextProperty);
+ set => SetValue(EnableNextProperty, value);
+ }
+
+ public object CancelContent
+ {
+ get => GetValue(CancelContentProperty);
+ set => SetValue(CancelContentProperty, value);
+ }
+
+ public object NextContent
+ {
+ get => GetValue(NextContentProperty);
+ set => SetValue(NextContentProperty, value);
+ }
+
protected override bool RegisterContentPresenter(IContentPresenter presenter)
{
var result = base.RegisterContentPresenter(presenter);

MODIFY
WalletWasabi.Fluent/Views/Dialogs/TestDialogView.axaml
WalletWasabi.Fluent/Views/Dialogs/TestDialogView.axaml
xmlns:c="clr-namespace:WalletWasabi.Fluent.Controls"
mc:Ignorable="d" Width="450" Height="200"
x:Class="WalletWasabi.Fluent.Views.Dialogs.TestDialogView">
- <c:ContentArea Title="Test Dialog" Caption="A quick example of a dialog:">
+ <c:ContentArea Title="Test Dialog" Caption="A quick example of a dialog:" EnableCancel="True" EnableNext="True">
<StackPanel HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock Text="{Binding Message}" />
- <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
- <Button Content="Cancel" Margin="10" Command="{Binding CancelCommand}" />
- <Button Content="Confirm" Margin="10" Command="{Binding NextCommand}" />
- </StackPanel>
</StackPanel>
</c:ContentArea>
</UserControl>

Added Cancel and Next button to ContentArea