初始化上传
This commit is contained in:
29
常用工具集/Views/MainView.axaml.cs
Normal file
29
常用工具集/Views/MainView.axaml.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Ursa.Controls;
|
||||
using 常用工具集.Base;
|
||||
using 常用工具集.ViewModels;
|
||||
|
||||
namespace 常用工具集.Views;
|
||||
|
||||
public partial class MainView : UserControl
|
||||
{
|
||||
public MainView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
||||
{
|
||||
base.OnAttachedToVisualTree(e);
|
||||
var topLevel = TopLevel.GetTopLevel(this);
|
||||
if (topLevel is null)
|
||||
return;
|
||||
GlobalValues.StorageProvider = topLevel?.StorageProvider;
|
||||
GlobalValues.Clipboard = topLevel.Clipboard;
|
||||
GlobalValues.NotificationManager = WindowNotificationManager.TryGetNotificationManager(topLevel, out var manager) ? manager : new WindowNotificationManager(topLevel);
|
||||
GlobalValues.NotificationManager.Position = Avalonia.Controls.Notifications.NotificationPosition.BottomRight;
|
||||
GlobalValues.NotificationManager.MaxItems = 5;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user