月更
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
internal class AlertViewModel : Screen
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
using System.ComponentModel.Composition;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
internal class AvatarViewModel : Screen
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
internal class BadgeViewModel : Screen
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using AntdWpf.Controls;
|
||||
using AntDesignWPF.Controls;
|
||||
|
||||
using Caliburn.Micro;
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.ComponentModel.Composition;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
internal class ButtonViewModel : Screen
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
internal class CheckBoxViewModel : Screen
|
||||
|
||||
63
AntdWpfDemo/ViewModels/DataGridViewModel.cs
Normal file
63
AntdWpfDemo/ViewModels/DataGridViewModel.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
using Caliburn.Micro;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
class DataGridViewModel : Screen
|
||||
{
|
||||
private ObservableCollection<TestDataModel> _testData;
|
||||
public ObservableCollection<TestDataModel> TestData
|
||||
{
|
||||
get => _testData;
|
||||
set
|
||||
{
|
||||
_testData = value;
|
||||
NotifyOfPropertyChange(() => TestData);
|
||||
}
|
||||
}
|
||||
|
||||
public DataGridViewModel()
|
||||
{
|
||||
DisplayName = "DataGrid";
|
||||
InitializeTestData();
|
||||
}
|
||||
|
||||
private void InitializeTestData()
|
||||
{
|
||||
var random = new Random();
|
||||
TestData = new ObservableCollection<TestDataModel>();
|
||||
|
||||
string[] names = { "张三", "李四", "王五", "赵六", "钱七" };
|
||||
string[] addresses = { "北京市海淀区", "上海市浦东新区", "广州市天河区", "深圳市南山区", "杭州市西湖区" };
|
||||
|
||||
for (int i = 1; i <= 20; i++)
|
||||
{
|
||||
TestData.Add(new TestDataModel
|
||||
{
|
||||
Id = i,
|
||||
Name = names[random.Next(names.Length)],
|
||||
Age = random.Next(18, 60),
|
||||
Address = addresses[random.Next(addresses.Length)],
|
||||
CreateTime = DateTime.Now.AddDays(-random.Next(1, 365))
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class TestDataModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int Age { get; set; }
|
||||
public string Address { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
public class IconViewModel : Screen
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
using System;
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
internal class InputViewModel : Screen
|
||||
|
||||
87
AntdWpfDemo/ViewModels/NotificationViewModel.cs
Normal file
87
AntdWpfDemo/ViewModels/NotificationViewModel.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
using AntDesignWPF.Controls;
|
||||
|
||||
using Caliburn.Micro;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
internal class NotificationViewModel : Screen
|
||||
{
|
||||
public NotificationViewModel()
|
||||
{
|
||||
DisplayName = "Notification";
|
||||
}
|
||||
public void SuccessClick()
|
||||
{
|
||||
NotificationManager.Show(
|
||||
"操作成功",
|
||||
"您的设置已保存,并已成功应用到系统中。",
|
||||
NotificationType.Success);
|
||||
}
|
||||
|
||||
public void InfoClick()
|
||||
{
|
||||
NotificationManager.Show(
|
||||
"系统提示",
|
||||
"这是一条普通的信息提示,用于通知用户。",
|
||||
NotificationType.Info,
|
||||
NotificationPlacement.BottomRight);
|
||||
}
|
||||
|
||||
public void WarningClick()
|
||||
{
|
||||
NotificationManager.Show(
|
||||
"警告",
|
||||
"您的磁盘空间即将用尽,请及时清理文件。",
|
||||
NotificationType.Warning,
|
||||
NotificationPlacement.BottomLeft);
|
||||
}
|
||||
|
||||
public void ErrorClick()
|
||||
{
|
||||
NotificationManager.Show(
|
||||
"发生错误",
|
||||
"无法连接到服务器,请检查您的网络连接。",
|
||||
NotificationType.Error,
|
||||
NotificationPlacement.TopLeft,
|
||||
durationSeconds: 5); // 自定义持续时间
|
||||
}
|
||||
public void thisSuccessClick()
|
||||
{
|
||||
NotificationManager.Show(
|
||||
"操作成功",
|
||||
"您的设置已保存,并已成功应用到系统中。",
|
||||
NotificationType.Success);
|
||||
}
|
||||
|
||||
public void thisInfoClick()
|
||||
{
|
||||
NotificationManager.Show(
|
||||
"系统提示",
|
||||
"这是一条普通的信息提示,用于通知用户。",
|
||||
NotificationType.Info,
|
||||
NotificationPlacement.BottomRight);
|
||||
}
|
||||
|
||||
public void thisWarningClick()
|
||||
{
|
||||
NotificationManager.Show(
|
||||
"警告",
|
||||
"您的磁盘空间即将用尽,请及时清理文件。",
|
||||
NotificationType.Warning,
|
||||
NotificationPlacement.BottomLeft);
|
||||
}
|
||||
|
||||
public void thisErrorClick()
|
||||
{
|
||||
NotificationManager.Show(
|
||||
"发生错误",
|
||||
"无法连接到服务器,请检查您的网络连接。",
|
||||
NotificationType.Error,
|
||||
NotificationPlacement.TopLeft,
|
||||
durationSeconds: 5); // 自定义持续时间
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
internal class ProgressViewModel : Screen
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
public class RadioButtonViewModel : Screen
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
internal class SelectViewModel : Screen
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IShell))]
|
||||
internal class ShellViewModel : Conductor<IScreen>.Collection.OneActive
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
internal class SpinViewModel : Screen
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
internal class SwitchViewModel : Screen
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
using System.ComponentModel.Composition;
|
||||
using System.Windows;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
internal class TagViewModel : Screen
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
using System.ComponentModel.Composition;
|
||||
|
||||
namespace AntdWpfDemo.ViewModels
|
||||
namespace AntDesignWPFDemo.ViewModels
|
||||
{
|
||||
[Export(typeof(IScreen))]
|
||||
internal class ToolTipViewModel : Screen
|
||||
|
||||
Reference in New Issue
Block a user