模块化
This commit is contained in:
19
SettingModule/SettingModule.cs
Normal file
19
SettingModule/SettingModule.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using SettingModule.Views;
|
||||
using System.Reflection;
|
||||
|
||||
namespace SettingModule
|
||||
{
|
||||
public class SettingModule : IModule
|
||||
{
|
||||
public void OnInitialized(IContainerProvider containerProvider)
|
||||
{
|
||||
IRegionManager regionManager = containerProvider.Resolve<IRegionManager>();
|
||||
regionManager.RegisterViewWithRegion("ShellViewManager", typeof(SettingView));
|
||||
}
|
||||
|
||||
public void RegisterTypes(IContainerRegistry containerRegistry)
|
||||
{
|
||||
containerRegistry.RegisterForNavigation<SettingView>("SettingView");
|
||||
}
|
||||
}
|
||||
}
|
||||
23
SettingModule/SettingModule.csproj
Normal file
23
SettingModule/SettingModule.csproj
Normal file
@@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\UIShare\UIShare.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Views\LoginView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\SettingView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
28
SettingModule/ViewModels/SettingViewModel.cs
Normal file
28
SettingModule/ViewModels/SettingViewModel.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using UIShare.ViewModelBase;
|
||||
|
||||
namespace SettingModule.ViewModels
|
||||
{
|
||||
public class SettingViewModel : NavigateViewModelBase
|
||||
{
|
||||
#region 属性
|
||||
|
||||
|
||||
#endregion
|
||||
#region 命令
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
public SettingViewModel(IContainerProvider containerProvider) : base(containerProvider)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
#region 命令处理
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
15
SettingModule/Views/SettingView.xaml
Normal file
15
SettingModule/Views/SettingView.xaml
Normal file
@@ -0,0 +1,15 @@
|
||||
<UserControl x:Class="SettingModule.Views.SettingView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
d:DesignHeight="1080"
|
||||
d:DesignWidth="1920">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
SettingModule/Views/SettingView.xaml.cs
Normal file
28
SettingModule/Views/SettingView.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace SettingModule.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// SettingView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SettingView : UserControl
|
||||
{
|
||||
public SettingView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user