refactor question control to take content.
MODIFY
WalletWasabi.Fluent/Controls/QuestionControl.axaml
WalletWasabi.Fluent/Controls/QuestionControl.axaml
<Button Name="PART_NoButton" HorizontalAlignment="Left" Content="No" Classes="yesNo" Command="{TemplateBinding NoCommand}" />
<Button Name="PART_YesButton" HorizontalAlignment="Right" Content="Yes" Classes="yesNo" IsDefault="True" Command="{TemplateBinding YesCommand}" />
</DockPanel>
- <TextBlock Name="PART_Question"
- Text="{TemplateBinding Text}"
+ <ContentControl Content="{TemplateBinding QuestionContent}"
+ HorizontalContentAlignment="Center"
FontSize="{TemplateBinding FontSize}"
- TextWrapping="Wrap"
- TextAlignment="Center"
- HorizontalAlignment="Center"
DockPanel.Dock="Bottom"
Margin="0 10 0 50" />
<Viewbox MaxHeight="150" DockPanel.Dock="Top">

MODIFY
WalletWasabi.Fluent/Controls/QuestionControl.axaml.cs
WalletWasabi.Fluent/Controls/QuestionControl.axaml.cs
@@ -24,8 +24,8 @@ namespace WalletWasabi.Fluent.Controls
public static readonly StyledProperty<IImage> IconProperty =
AvaloniaProperty.Register<QuestionControl, IImage>(nameof(Icon));
- public static readonly StyledProperty<string> TextProperty =
- AvaloniaProperty.Register<QuestionControl, string>(nameof(Text));
+ public static readonly StyledProperty<object?> QuestionContentProperty =
+ AvaloniaProperty.Register<QuestionControl, object?>(nameof(QuestionContent));
public static readonly StyledProperty<HighlightedButton> HighlightButtonProperty =
AvaloniaProperty.Register<QuestionControl, HighlightedButton>(nameof(HighlightButton));
@@ -48,10 +48,10 @@ namespace WalletWasabi.Fluent.Controls
set => SetValue(IconProperty, value);
}
- public string Text
+ public object? QuestionContent
{
- get => GetValue(TextProperty);
- set => SetValue(TextProperty, value);
+ get => GetValue(QuestionContentProperty);
+ set => SetValue(QuestionContentProperty, value);
}
public HighlightedButton HighlightButton

MODIFY
WalletWasabi.Fluent/Controls/TagControl.axaml
WalletWasabi.Fluent/Controls/TagControl.axaml
Margin="12,6,12,6"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
- DockPanel.Dock="Left"
- />
+ DockPanel.Dock="Left" />
</DockPanel>
</Panel>
</Panel>
</Setter>
</Style>
- <Style Selector="c|TagControl /template/ Panel#PART_TagPanel LayoutTransformControl#PART_DeleteButtonLayoutTransformer">
+ <Style
+ Selector="c|TagControl /template/ Panel#PART_TagPanel LayoutTransformControl#PART_DeleteButtonLayoutTransformer">
<Setter Property="LayoutTransform" Value="scaleX(0)" />
</Style>
<Setter Property="Opacity" Value="0" />
</Style>
- <Style Selector="c|TagsBox:not(:readonly) c|TagControl /template/ Panel#PART_TagPanel:pointerover LayoutTransformControl#PART_DeleteButtonLayoutTransformer">
+ <Style
+ Selector="c|TagsBox:not(:readonly) c|TagControl /template/ Panel#PART_TagPanel:pointerover LayoutTransformControl#PART_DeleteButtonLayoutTransformer">
<Setter Property="LayoutTransform" Value="scaleX(1)" />
</Style>
- <Style Selector="c|TagsBox:not(:readonly) c|TagControl /template/ Panel#PART_TagPanel:pointerover Button#PART_DeleteButton">
+ <Style
+ Selector="c|TagsBox:not(:readonly) c|TagControl /template/ Panel#PART_TagPanel:pointerover Button#PART_DeleteButton">
<Setter Property="Opacity" Value="1" />
</Style>
</Styles>
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Controls/TagsBox.axaml
WalletWasabi.Fluent/Controls/TagsBox.axaml
<Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" />
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" />
<Setter Property="Padding" Value="{DynamicResource TagsBoxBorderPadding}" />
+ <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Cursor" Value="IBeam" />
<Setter Property="Template">
<ControlTemplate>
- <DataValidationErrors>
+ <DataValidationErrors VerticalContentAlignment="{TemplateBinding VerticalAlignment}">
<Border x:Name="PART_Border" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Items="{TemplateBinding Items}">
<ItemsPresenter.ItemsPanel>
<ItemsPanelTemplate>
- <c:ConcatenatingWrapPanel Focusable="False">
+ <c:ConcatenatingWrapPanel Focusable="False" VerticalAlignment="{TemplateBinding VerticalAlignment}">
<c:ConcatenatingWrapPanel.ConcatenatedChildren>
<AutoCompleteBox x:Name="PART_AutoCompleteBox"
MaxDropDownHeight="90"
<Style Selector="c|TagsBox:readonly /template/ Border#PART_Border">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
+ <Setter Property="BorderThickness" Value="0" />
</Style>
<Style Selector="c|TagsBox:readonly AutoCompleteBox">
</Style>
<Style Selector="c|TagsBox c|TagControl">
- <Setter Property="Margin" Value="0,0,4,4" />
+ <Setter Property="Margin" Value="0,0,4,0" />
</Style>
<Style Selector="c|TagsBox AutoCompleteBox">

MODIFY
WalletWasabi.Fluent/Views/AddWallet/HardwareWallet/DetectedHardwareWalletView.axaml
WalletWasabi.Fluent/Views/AddWallet/HardwareWallet/DetectedHardwareWalletView.axaml
EnableNext="False"
ScrollViewer.VerticalScrollBarVisibility="Disabled">
- <c:QuestionControl Text="{Binding TypeName, StringFormat={}{0} was detected. Is this correct?}"
+ <c:QuestionControl QuestionContent="{Binding TypeName, StringFormat={}{0} was detected. Is this correct?}"
YesCommand="{Binding NextCommand}"
NoCommand="{Binding NoCommand}"
Icon="{Binding Type, Converter={x:Static conv:WalletIconConverter.WalletTypeToImage}}"

MODIFY
WalletWasabi.Fluent/Views/Dialogs/ConfirmHideAddressView.axaml
WalletWasabi.Fluent/Views/Dialogs/ConfirmHideAddressView.axaml
x:Class="WalletWasabi.Fluent.Views.Dialogs.ConfirmHideAddressView">
<c:ContentArea Title="{Binding Title}"
ScrollViewer.VerticalScrollBarVisibility="Disabled">
- <c:QuestionControl Text="{Binding Text}"
- YesCommand="{Binding NextCommand}"
+ <c:QuestionControl YesCommand="{Binding NextCommand}"
NoCommand="{Binding CancelCommand}"
HighlightButton="YesButton">
+ <c:QuestionControl.QuestionContent>
+ <StackPanel>
+ <StackPanel Orientation="Horizontal" Spacing="10">
+ <TextBlock Text="Are you sure you wish to hide the BTC address labelled" />
+ <c:TagsBox IsReadOnly="True" Items="{Binding Label}" />
+ </StackPanel>
+ <TextBlock Text="This can not be undone." />
+ </StackPanel>
+ </c:QuestionControl.QuestionContent>
<Viewbox MaxHeight="150" Margin="40">
<PathIcon Data="{StaticResource delete_regular}" Opacity="0.6" />
</Viewbox>

MODIFY
WalletWasabi.Fluent/Views/Dialogs/InsufficientBalanceDialogView.axaml
WalletWasabi.Fluent/Views/Dialogs/InsufficientBalanceDialogView.axaml
x:Class="WalletWasabi.Fluent.Views.Dialogs.InsufficientBalanceDialogView">
<c:ContentArea Title="{Binding Title}"
Caption="{Binding Caption}">
- <c:QuestionControl Text="Would you like to do this instead?"
+ <c:QuestionControl QuestionContent="Would you like to do this instead?"
YesCommand="{Binding NextCommand}"
NoCommand="{Binding CancelCommand}"
HighlightButton="YesButton">

MODIFY
WalletWasabi.Fluent/Views/Login/PasswordFinder/ContainsNumbersView.axaml
WalletWasabi.Fluent/Views/Login/PasswordFinder/ContainsNumbersView.axaml
EnableBack="{Binding EnableBack}"
ScrollViewer.VerticalScrollBarVisibility="Disabled">
- <c:QuestionControl Text="Does your password contains numbers?"
+ <c:QuestionControl QuestionContent="Does your password contains numbers?"
YesCommand="{Binding YesCommand}"
NoCommand="{Binding NoCommand}"
Icon="{Binding Icon}"

MODIFY
WalletWasabi.Fluent/Views/Login/PasswordFinder/ContainsSymbolsView.axaml
WalletWasabi.Fluent/Views/Login/PasswordFinder/ContainsSymbolsView.axaml
EnableBack="{Binding EnableBack}"
ScrollViewer.VerticalScrollBarVisibility="Disabled">
- <c:QuestionControl Text="Does your password contains special characters?"
+ <c:QuestionControl QuestionContent="Does your password contains special characters?"
YesCommand="{Binding YesCommand}"
NoCommand="{Binding NoCommand}"
Icon="{Binding Icon}"

MODIFY
WalletWasabi.Fluent/Views/Login/PasswordFinder/PasswordNotFoundView.axaml
WalletWasabi.Fluent/Views/Login/PasswordFinder/PasswordNotFoundView.axaml
<c:ContentArea Title="{Binding Title}"
ScrollViewer.VerticalScrollBarVisibility="Disabled">
- <c:QuestionControl Text="We have not found your password, would you like to try again? "
+ <c:QuestionControl QuestionContent="We have not found your password, would you like to try again? "
YesCommand="{Binding NextCommand}"
NoCommand="{Binding CancelCommand}"
HighlightButton="YesButton">

refactor question control to take content.