一个系统框架除了功能菜单导航,有系统内容显示区域,系统状态栏。
Silver:
Blue:
Black:
系统界面设计,就不进行技术细节介绍了,主题以框架设计为主,Xaml源码参考:
<Fluent:RibbonWindow x:Class="TLAgent.SecurityManager.WPF.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent" Title="用户权限管理系统" Height="350" Width="525" Icon="/TLAgent.SecurityManager.WPF;component/Images/usergroup.ico"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Fluent:Ribbon Grid.Row="0" AutomaticStateManagement="True" x:Name="ribbon"> <Fluent:Ribbon.QuickAccessItems> <Fluent:QuickAccessMenuItem Target="{Binding ElementName=BtnSecManager}"/> <Fluent:QuickAccessMenuItem Target="{Binding ElementName=BtnModifyPassword}"/> </Fluent:Ribbon.QuickAccessItems> <Fluent:RibbonTabItem Header="用户管理" ReduceOrder="(P),(P),(P),(P),(P)"> <Fluent:RibbonGroupBox Header="User Group"> <Fluent:Button Header="查询用户" Command="{Binding OpenCommand}" Icon="Images\Gray.png" LargeIcon="Images\GrayLarge.png" Name="BtnQueryUser" /> <Fluent:Button Header="添加用户" Command="{Binding AddFunctionCommand}" Icon="Images\Green.png" LargeIcon="Images\GreenLarge.png" Name="BtnAddUser" /> <Fluent:Button Header="更新用户" Command="{Binding OpenCommand}" Icon="Images\Gray.png" LargeIcon="Images\GrayLarge.png" Name="BtnModifyUser" /> </Fluent:RibbonGroupBox> </Fluent:RibbonTabItem> <Fluent:RibbonTabItem Header="角色管理" ReduceOrder="(P),(P),(P),(P),(P)"> <Fluent:RibbonGroupBox Header="Role Group"> <Fluent:Button Header="查询角色" Command="{Binding OpenCommand}" Icon="Images\Gray.png" LargeIcon="Images\GrayLarge.png" Name="BtnQueryRole" /> <Fluent:Button Header="添加角色" Command="{Binding AddFunctionCommand}" Icon="Images\Green.png" LargeIcon="Images\GreenLarge.png" Name="BtnAddRole" /> <Fluent:Button Header="更新角色" Command="{Binding OpenCommand}" Icon="Images\Gray.png" LargeIcon="Images\GrayLarge.png" Name="BtnModifyRole" /> </Fluent:RibbonGroupBox> </Fluent:RibbonTabItem> <Fluent:RibbonTabItem Header="部门管理" ReduceOrder="(P),(P),(P),(P),(P)"> <Fluent:RibbonGroupBox Header="Department Group"> <Fluent:Button Header="查询部门" Command="{Binding OpenCommand}" Icon="Images\Gray.png" LargeIcon="Images\GrayLarge.png" Name="BtnQueryDept" /> <Fluent:Button Header="添加部门" Command="{Binding AddFunctionCommand}" Icon="Images\Green.png" LargeIcon="Images\GreenLarge.png" Name="BtnAddDept" /> <Fluent:Button Header="更新部门" Command="{Binding OpenCommand}" Icon="Images\Gray.png" LargeIcon="Images\GrayLarge.png" Name="BtnModifyDept" /> </Fluent:RibbonGroupBox> </Fluent:RibbonTabItem> <Fluent:RibbonTabItem Header="系统管理" ReduceOrder="(P),(P),(P),(P),(P)"> <Fluent:RibbonGroupBox Header="Security Group"> <Fluent:Button Header="系统日志" Command="{Binding AddFunctionCommand}" Icon="Images\systemlog.ico" LargeIcon="Images\systemlog.ico" Name="BtnSecManager" /> <Fluent:Button Header="更改密码" Command="{Binding OpenCommand}" Icon="Images\changePassword.ico" LargeIcon="Images\changePassword.ico" Name="BtnModifyPassword" /> </Fluent:RibbonGroupBox> <Fluent:RibbonGroupBox Header="System Group"> <Fluent:Button Header=" 退出系统 " Width="80" Command="{Binding AddFunctionCommand}" Icon="Images\close.png" LargeIcon="Images\close.png"/> </Fluent:RibbonGroupBox> </Fluent:RibbonTabItem> </Fluent:Ribbon> <Fluent:StatusBar HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Grid.Row="2"> <Fluent:StatusBarItem Title="Words Width" Value="150" HorizontalAlignment="Left"> <TextBlock Text="Message" /> </Fluent:StatusBarItem> </Fluent:StatusBar> </Grid> </Fluent:RibbonWindow>
换肤还是调接口ChangeTheme来实现换肤功能。
namespace TLAgent.SecurityManager.WPF { /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { ThemeManager.ChangeTheme(ThemeStyle.Black); base.OnStartup(e); } } }
后续总结一些关于MVVM的技术。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· SQL Server 2025 AI相关能力初探
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库