feat: introducing background and foreground setting for loading container.
This commit is contained in:
@@ -93,6 +93,8 @@
|
||||
|
||||
<ControlTheme x:Key="{x:Type u:LoadingContainer}" TargetType="u:LoadingContainer">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="MessageForeground" Value="{DynamicResource TextBlockDefaultForeground}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource LoadingMaskBackground}" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Indicator">
|
||||
<Template>
|
||||
@@ -109,6 +111,8 @@
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
<u:Loading
|
||||
Background="{TemplateBinding Background}"
|
||||
Foreground="{TemplateBinding MessageForeground}"
|
||||
Content="{TemplateBinding LoadingMessage}"
|
||||
ContentTemplate="{TemplateBinding LoadingMessageTemplate}"
|
||||
Indicator="{TemplateBinding Indicator}"
|
||||
|
||||
@@ -2,6 +2,7 @@ using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Metadata;
|
||||
using Avalonia.Controls.Templates;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace Ursa.Controls;
|
||||
|
||||
@@ -28,6 +29,15 @@ public class LoadingContainer: ContentControl
|
||||
set => SetValue(LoadingMessageProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<IBrush?> MessageForegroundProperty = AvaloniaProperty.Register<LoadingContainer, IBrush?>(
|
||||
nameof(MessageForeground));
|
||||
|
||||
public IBrush? MessageForeground
|
||||
{
|
||||
get => GetValue(MessageForegroundProperty);
|
||||
set => SetValue(MessageForegroundProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<IDataTemplate> LoadingMessageTemplateProperty = AvaloniaProperty.Register<LoadingContainer, IDataTemplate>(
|
||||
nameof(LoadingMessageTemplate));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user