当前位置: 首页 > news >正文

WPF使用Prism框架首页界面

1. 首先确保已经下载了NuGet包MaterialDesignThemes

2.我们通过包的项目URL可以跳转到Github上查看源码

 

 3.找到首页所在的代码位置

4.将代码复制下来,删除掉自己不需要的东西,最终如下

<materialDesign:DialogHostDialogTheme="Inherit"Identifier="RootDialog"SnackbarMessageQueue="{Binding ElementName=MainSnackbar, Path=MessageQueue}"><materialDesign:DrawerHost IsLeftDrawerOpen="{Binding ElementName=MenuToggleButton, Path=IsChecked}"><materialDesign:DrawerHost.LeftDrawerContent><!--  左侧菜单  --><DockPanel MinWidth="220" /></materialDesign:DrawerHost.LeftDrawerContent><!--  头部  --><DockPanel><materialDesign:ColorZonePadding="16"materialDesign:ElevationAssist.Elevation="Dp4"DockPanel.Dock="Top"Mode="PrimaryMid"><DockPanel><StackPanel Orientation="Horizontal"><ToggleButtonx:Name="MenuToggleButton"AutomationProperties.Name="HamburgerToggleButton"IsChecked="False"Style="{StaticResource MaterialDesignHamburgerToggleButton}" /><ButtonMargin="24,0,0,0"materialDesign:RippleAssist.Feedback="{Binding RelativeSource={RelativeSource Self}, Path=Foreground, Converter={StaticResource BrushRoundConverter}}"Command="{Binding MovePrevCommand}"Content="{materialDesign:PackIcon Kind=ArrowLeft,Size=24}"Foreground="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"Style="{StaticResource MaterialDesignToolButton}"ToolTip="Previous Item" /><ButtonMargin="16,0,0,0"materialDesign:RippleAssist.Feedback="{Binding RelativeSource={RelativeSource Self}, Path=Foreground, Converter={StaticResource BrushRoundConverter}}"Command="{Binding MoveNextCommand}"Content="{materialDesign:PackIcon Kind=ArrowRight,Size=24}"Foreground="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"Style="{StaticResource MaterialDesignToolButton}"ToolTip="Next Item" /><ButtonMargin="16,0,0,0"materialDesign:RippleAssist.Feedback="{Binding RelativeSource={RelativeSource Self}, Path=Foreground, Converter={StaticResource BrushRoundConverter}}"Command="{Binding HomeCommand}"Content="{materialDesign:PackIcon Kind=Home,Size=24}"Foreground="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"Style="{StaticResource MaterialDesignToolButton}"ToolTip="Home" /></StackPanel><TextBlockMargin="-152,0,0,0"HorizontalAlignment="Center"VerticalAlignment="Center"AutomationProperties.Name="Material Design In XAML Toolkit"FontSize="22"Text="Material Design In XAML Toolkit" /></DockPanel></materialDesign:ColorZone></DockPanel></materialDesign:DrawerHost>
</materialDesign:DialogHost>

5.运行查看效果

http://www.lryc.cn/news/477231.html

相关文章:

  • Linux中的软硬链接文件详解
  • 「Mac畅玩鸿蒙与硬件18」鸿蒙UI组件篇8 - 高级动画效果与缓动控制
  • pgsql数据量大之后可能遇到的问题
  • Android 解决MTK相机前摄镜像问题
  • 在 Oracle 数据库中,SERVICE_NAME 和 SERVICE_NAMES 有什么区别?
  • 【Maven】——基础入门,插件安装、配置和简单使用,Maven如何设置国内源
  • AIGC时代LaTeX排版的应用、技巧与未来展望
  • 二叉树的深搜
  • JUC笔记之ReentrantLock
  • 【含文档】基于ssm+jsp的图书管理系统(含源码+数据库+lw)
  • pytorch知识蒸馏测试
  • mutable用法
  • SQL语言基础
  • 在USB电源测试中如何降低测试成本?-纳米软件
  • springboot - 定时任务
  • 一篇文章理解CSS垂直布局方法
  • SpringBoot day 1105
  • MySQL 完整教程:从入门到精通
  • 【贝叶斯公式】贝叶斯公式、贝叶斯定理、贝叶斯因子,似然比
  • [libos源码学习 1] Liboc协程生产者消费者举例
  • Python OpenCV 图像改变
  • k8s按需创建 PV和创建与使用 PVC
  • 揭秘云计算 | 2、业务需求推动IT发展
  • 【系统面试篇】进程与线程类(2)(笔记)——进程调度、中断、异常、用户态、核心态
  • 基于MySQL的企业专利数据高效查询与统计实现
  • 热成像手机VS传统热成像仪:AORO A23为何更胜一筹?
  • Spring IoC——依赖注入
  • Linux 中,flock 对文件加锁
  • CentOS下载ISO镜像的方法
  • Node.js 入门指南:从零开始构建全栈应用