feat: add Content Attribute.

This commit is contained in:
Zhang Dian
2024-09-11 21:30:15 +08:00
parent 62a277cc16
commit 70d0f236d6
4 changed files with 10 additions and 2 deletions

View File

@@ -16,7 +16,9 @@
<u:Notification Content="Hello, Ursa!" />
</u:NotificationCard>
<u:NotificationCard NotificationType="Error" Classes="Light">
<u:Notification Title="Welcome" Content="Hello, Ursa!" />
<u:Notification Title="Welcome">
Hello, Ursa!
</u:Notification>
</u:NotificationCard>
</ReversibleStackPanel>
</ThemeVariantScope>

View File

@@ -10,7 +10,9 @@
Hello, Ursa!
</u:ToastCard>
<u:ToastCard NotificationType="Success" Classes="Light">
<u:Toast Content="Hello, Ursa!" />
<u:Toast>
Hello, Ursa!
</u:Toast>
</u:ToastCard>
</ReversibleStackPanel>
</ThemeVariantScope>

View File

@@ -1,6 +1,7 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Avalonia.Controls.Notifications;
using Avalonia.Metadata;
namespace Ursa.Controls;
@@ -66,6 +67,7 @@ public class Notification : INotification, INotifyPropertyChanged
}
/// <inheritdoc/>
[Content]
public string? Content
{
get => _content;

View File

@@ -1,6 +1,7 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Avalonia.Controls.Notifications;
using Avalonia.Metadata;
namespace Ursa.Controls;
@@ -49,6 +50,7 @@ public class Toast : IToast, INotifyPropertyChanged
}
/// <inheritdoc/>
[Content]
public string? Content
{
get => _content;