初始化上传

This commit is contained in:
2025-08-26 08:37:44 +08:00
commit 31d81b91b6
448 changed files with 80981 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace .Base
{
public class DelegateCommand : ICommand
{
public Action<object> ExecuteCommand = null;
public Func<object, bool> CanExecuteCommand = null;
public event EventHandler CanExecuteChanged;
public DelegateCommand()
{
}
public DelegateCommand(Action<object> Command)
{
ExecuteCommand = Command;
}
public bool CanExecute(object paramter)
{
if (CanExecuteCommand != null)
{
return CanExecuteCommand(paramter);
}
else
{
return true;
}
}
public void Execute(object paramter)
{
if (ExecuteCommand != null)
ExecuteCommand(paramter);
}
public void RaiseCanExecuteChanged()
{
if (CanExecuteChanged != null)
CanExecuteChanged(this, EventArgs.Empty);
}
}
}

View File

@@ -0,0 +1,51 @@
using Avalonia.Controls;
using Avalonia.Controls.Notifications;
using Avalonia.Input.Platform;
using Avalonia.Platform.Storage;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace .Base
{
internal class GlobalValues
{
public static Ursa.Controls.WindowNotificationManager? NotificationManager { get; set; }
public static Window MainWindow { get; internal set; }
public static IStorageProvider StorageProvider { get; internal set; }
public static IClipboard Clipboard { get; internal set; }
public static void ShowNotification(string title, string message, NotificationType type)
{
if (NotificationManager != null)
{
NotificationManager?.Show(new Notification(title, message), showIcon: true, showClose: false, type: type);
}
}
public static void Error(string message)
{
if (NotificationManager != null)
{
NotificationManager?.Show(message, NotificationType.Error, TimeSpan.FromSeconds(1), true, false);
}
}
public static void Warning(string message)
{
if (NotificationManager != null)
{
NotificationManager?.Show(message, NotificationType.Warning, TimeSpan.FromSeconds(1), true, false);
}
}
public static void Success(string message)
{
if (NotificationManager != null)
{
NotificationManager?.Show(message, NotificationType.Success, TimeSpan.FromSeconds(1), true, false);
}
}
}
}

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace .Base
{
public class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public void NotifyPropertyChanged([CallerMemberName] string propertyname = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));
}
}
}