Changeset - a8c7548cacbb
[Not reviewed]
default
0 2 0
Jason Maltzen - 3 years ago 2021-09-09 23:58:43
jason@hiddenachievement.com
Add a secondary message to the EmbeddedWarningBox
2 files changed with 9 insertions and 0 deletions:
0 comments (0 inline, 0 general)
Views/EmbeddedWarningBox.axaml
Show inline comments
...
 
@@ -5,24 +5,25 @@
 
             xmlns:view="clr-namespace:DesertPaintCodex.Views"
 
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
 
             x:Class="DesertPaintCodex.Views.EmbeddedWarningBox">
 
    
 
    <UserControl.Styles>
 
        <Style Selector="view|EmbeddedWarningBox">
 
            <Setter Property="Template">
 
                <ControlTemplate>
 
                    <Border Name="PART_Border">
 
                        <StackPanel>
 
                            <TextBlock Name="PART_Title" Text="{TemplateBinding Title}"/>
 
                            <TextBlock Name="PART_Message" Text="{TemplateBinding Message}"/>
 
                            <TextBlock Name="PART_Message2" Text="{TemplateBinding Message2}"/>
 
                            <ContentPresenter Content="{TemplateBinding Content}"/>
 
                        </StackPanel>
 
                    </Border>                   
 
                </ControlTemplate>
 
            </Setter>
 
        </Style>
 
        
 
        <Style Selector="view|EmbeddedWarningBox /template/ Border#PART_Border">
 
            <Setter Property="Background" Value="#E1AD56"/>
 
            <Setter Property="CornerRadius" Value="3"/>
 
            <Setter Property="Padding" Value="10"/>
 
        </Style>
...
 
@@ -37,24 +38,29 @@
 
            <Setter Property="Foreground" Value="#000000"/>
 
        </Style>
 
        
 
        <Style Selector="view|EmbeddedWarningBox /template/  TextBlock#PART_Title">
 
            <Setter Property="FontSize" Value="16"/>
 
            <Setter Property="FontWeight" Value="Bold"/>
 
        </Style>
 
        
 
        <Style Selector="view|EmbeddedWarningBox /template/  TextBlock#PART_Message">
 
            <Setter Property="TextWrapping" Value="Wrap"/>
 
        </Style>
 
        
 
        <Style Selector="view|EmbeddedWarningBox /template/  TextBlock#PART_Message2">
 
          <Setter Property="FontSize" Value="12"/>
 
          <Setter Property="TextWrapping" Value="Wrap"/>
 
        </Style>
 

	
 
        <Style Selector="view|EmbeddedWarningBox Button">
 
            <Setter Property="Padding" Value="5"/>
 
            <Setter Property="Background" Value="#5E443F"/>
 
        </Style>
 
        
 
        <Style Selector="view|EmbeddedWarningBox Button:pointerover">
 
            <Setter Property="Background" Value="#8C594A"/>
 
        </Style>
 
        
 
        <Style Selector="view|EmbeddedWarningBox Button:pressed">
 
            <Setter Property="Background" Value="#5E443F"/>
 
        </Style>
Views/EmbeddedWarningBox.axaml.cs
Show inline comments
...
 
@@ -4,24 +4,27 @@ using Avalonia.Markup.Xaml;
 

	
 
namespace DesertPaintCodex.Views
 
{
 
    public class EmbeddedWarningBox : UserControl
 
    {
 
        public static readonly StyledProperty<string> TitleProperty =
 
            AvaloniaProperty.Register<EmbeddedWarningBox, string>(nameof(Title));
 
        public string Title { get => GetValue(TitleProperty); set => SetValue(TitleProperty, value); }
 
        
 
        public static readonly StyledProperty<string> MessageProperty =
 
            AvaloniaProperty.Register<EmbeddedWarningBox, string>(nameof(Message));
 
        public string Message { get => GetValue(MessageProperty); set => SetValue(MessageProperty, value); }
 
        public static readonly StyledProperty<string> Message2Property =
 
            AvaloniaProperty.Register<EmbeddedWarningBox, string>(nameof(Message2));
 
        public string Message2 { get => GetValue(Message2Property); set => SetValue(Message2Property, value); }
 
        
 
        
 
        public EmbeddedWarningBox()
 
        {
 
            InitializeComponent();
 
        }
 

	
 
        private void InitializeComponent()
 
        {
 
            AvaloniaXamlLoader.Load(this);
 
        }
 
    }
0 comments (0 inline, 0 general)