添加项目文件。
This commit is contained in:
14
CapMachine.Core/CapMachine.Core.csproj
Normal file
14
CapMachine.Core/CapMachine.Core.csproj
Normal file
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWPF>true</UseWPF>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FreeSql" Version="3.2.808" />
|
||||
<PackageReference Include="Prism.DryIoc" Version="8.1.97" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
55
CapMachine.Core/DialogViewModel.cs
Normal file
55
CapMachine.Core/DialogViewModel.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using Prism.Mvvm;
|
||||
using Prism.Services.Dialogs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 弹窗基类
|
||||
/// </summary>
|
||||
public class DialogViewModel : BindableBase, IDialogAware
|
||||
{
|
||||
public string Title { get; set; }
|
||||
|
||||
public event Action<IDialogResult>? RequestClose;
|
||||
|
||||
/// <summary>
|
||||
/// 调用RequestClose
|
||||
/// </summary>
|
||||
/// <param name="dialogResult"></param>
|
||||
public void RaiseRequestClose(IDialogResult dialogResult)
|
||||
{
|
||||
RequestClose?.Invoke(dialogResult);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否关闭窗口
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool CanCloseDialog()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭时触发
|
||||
/// </summary>
|
||||
public void OnDialogClosed()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打开时触发
|
||||
/// </summary>
|
||||
/// <param name="parameters"></param>
|
||||
public virtual void OnDialogOpened(IDialogParameters parameters)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
19
CapMachine.Core/IService/INavigationMenuService.cs
Normal file
19
CapMachine.Core/IService/INavigationMenuService.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Core.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 导航服务接口
|
||||
/// </summary>
|
||||
public interface INavigationMenuService
|
||||
{
|
||||
/// <summary>
|
||||
/// 初始化
|
||||
/// </summary>
|
||||
void Initialize();
|
||||
}
|
||||
}
|
||||
46
CapMachine.Core/NavigationViewModel.cs
Normal file
46
CapMachine.Core/NavigationViewModel.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using Prism.Mvvm;
|
||||
using Prism.Regions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 导航的基类
|
||||
/// </summary>
|
||||
public class NavigationViewModel : BindableBase, INavigationAware
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否重用导航对象
|
||||
/// </summary>
|
||||
/// <param name="navigationContext"></param>
|
||||
/// <returns></returns>
|
||||
public virtual bool IsNavigationTarget(NavigationContext navigationContext)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导航被切换触发
|
||||
/// </summary>
|
||||
/// <param name="navigationContext"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public virtual void OnNavigatedFrom(NavigationContext navigationContext)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导航被执行触发
|
||||
/// </summary>
|
||||
/// <param name="navigationContext"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public virtual void OnNavigatedTo(NavigationContext navigationContext)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user