源码Demo下载链接:https://download.csdn.net/download/liyu3519/16620649
复制这段内容后打开百度网盘手机App,操作更方便哦

使用C#-WPF实现抽屉式风格源码,应用MaterialDesignThemes实现炫酷漂亮的界面效果

1.使用Nuget安装MaterialDesignThemes

2.在App.xaml的<Application.Resources>中的添加以下代码

<ResourceDictionary><ResourceDictionary.MergedDictionaries><ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml"/><ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml"/><ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Blue.xaml"/><ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Indigo.xaml"/></ResourceDictionary.MergedDictionaries></ResourceDictionary>

3.界面中添加以下代码

 <Window.Resources><Storyboard x:Key="MenuOpen"><DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu"><EasingDoubleKeyFrame KeyTime="0" Value="60"/><EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="200"/></DoubleAnimationUsingKeyFrames></Storyboard><Storyboard x:Key="MenuClose"><DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu"><EasingDoubleKeyFrame KeyTime="0" Value="200"/><EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="60"/></DoubleAnimationUsingKeyFrames></Storyboard></Window.Resources><Window.Triggers><EventTrigger RoutedEvent="ButtonBase.Click" SourceName="ButtonOpenMenu"><BeginStoryboard Storyboard="{StaticResource MenuOpen}"/></EventTrigger><EventTrigger RoutedEvent="ButtonBase.Click" SourceName="ButtonCloseMenu"><BeginStoryboard Storyboard="{StaticResource MenuClose}"/></EventTrigger></Window.Triggers><Grid Background="LightGray"><Grid x:Name="GridTitle" Height="50" VerticalAlignment="Top" Background="#FF1368BD" MouseDown="GridTitle_MouseDown" Margin="60,0,0,0"><TextBlock Text="智慧工程管理监控系统" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="22" Foreground="White"/><StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Right"><TextBlock Text="欢迎使用" VerticalAlignment="Center" FontSize="14" Foreground="White"/><materialDesign:PopupBox Foreground="White" Margin="10" PlacementMode="BottomAndAlignRightEdges" StaysOpen="False"><StackPanel Width="150"><Button Content="账号"/><Button Content="设置"/><Button Content="帮助"/><Separator/><Button Content="最小化"/><Button Content="最大化"/><Button x:Name="ButtonPopUpLogout" Content="退出" Click="ButtonPopUpLogout_Click"/></StackPanel></materialDesign:PopupBox></StackPanel></Grid><Grid x:Name="gdMian" Background="White" MouseDown="GridTitle_MouseDown" Margin="60,50,0,0"></Grid><Grid x:Name="GridMenu" Width="60" HorizontalAlignment="Left" Background="#FF1B3861" Margin="0" SizeChanged="GridMenu_SizeChanged"><StackPanel><Grid Background="#FF1368BD"><Button x:Name="ButtonCloseMenu" Width="60" Height="50" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Top" HorizontalAlignment="Right" Visibility="Collapsed" Click="ButtonCloseMenu_Click"><materialDesign:PackIcon Kind="ArrowLeft" Foreground="#FF1B3861" Width="25" Height="25"/></Button><Button x:Name="ButtonOpenMenu" Width="60" Height="50" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Top" HorizontalAlignment="Right" Click="ButtonOpenMenu_Click"><materialDesign:PackIcon Kind="Menu" Foreground="#FF1B3861" Width="25" Height="25"/></Button></Grid><ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="#FF1368BD"><ListViewItem Height="60" MouseLeftButtonUp="ListViewItem_MouseLeftButtonUp"><StackPanel Orientation="Horizontal"><materialDesign:PackIcon Kind="ViewDashboard" Width="25" Height="25" Margin="10" VerticalAlignment="Center" /><TextBlock Text="首页" VerticalAlignment="Center" Margin="20 10" Foreground="White"/></StackPanel></ListViewItem><ListViewItem Height="60" MouseLeftButtonUp="ListViewItem_MouseLeftButtonUp"><StackPanel Orientation="Horizontal"><materialDesign:PackIcon Kind="Pencil" Width="25" Height="25" Margin="10" VerticalAlignment="Center"/><TextBlock Text="设备管理" VerticalAlignment="Center" Margin="20 10" Foreground="White"/></StackPanel></ListViewItem><ListViewItem Height="60" MouseLeftButtonUp="ListViewItem_MouseLeftButtonUp"><StackPanel Orientation="Horizontal"><materialDesign:PackIcon Kind="Ticket" Width="25" Height="25" Margin="10" VerticalAlignment="Center"/><TextBlock Text="策略模式" VerticalAlignment="Center" Margin="20 10" Foreground="White"/></StackPanel></ListViewItem><ListViewItem Height="60" MouseLeftButtonUp="ListViewItem_MouseLeftButtonUp"><StackPanel Orientation="Horizontal"><materialDesign:PackIcon Kind="Message" Width="25" Height="25" Margin="10" VerticalAlignment="Center"/><TextBlock Text="数据统计" VerticalAlignment="Center" Margin="20 10" Foreground="White"/></StackPanel></ListViewItem><ListViewItem Height="60" MouseLeftButtonUp="ListViewItem_MouseLeftButtonUp"><StackPanel Orientation="Horizontal"><materialDesign:PackIcon Kind="Account" Width="25" Height="25" Margin="10" VerticalAlignment="Center"/><TextBlock Text="个人中心" VerticalAlignment="Center" Margin="20 10" Foreground="White"/></StackPanel></ListViewItem></ListView></StackPanel></Grid></Grid>

4.在代码中添加事件定义代码

private void ButtonPopUpLogout_Click(object sender, RoutedEventArgs e){Application.Current.Shutdown();}private void ButtonOpenMenu_Click(object sender, RoutedEventArgs e){ButtonOpenMenu.Visibility = Visibility.Collapsed;ButtonCloseMenu.Visibility = Visibility.Visible;}private void ButtonCloseMenu_Click(object sender, RoutedEventArgs e){ButtonOpenMenu.Visibility = Visibility.Visible;ButtonCloseMenu.Visibility = Visibility.Collapsed;}private void GridTitle_MouseDown(object sender, MouseButtonEventArgs e){DragMove();}private void GridMenu_SizeChanged(object sender, SizeChangedEventArgs e){gdMian.Margin = new Thickness(e.NewSize.Width, 50, 0, 0);            }private void ListViewItem_MouseLeftButtonUp(object sender, MouseButtonEventArgs e){}

5.程序效果源码Demo下载地址:https://www.90pan.com/b1917131

C#-WPF实现抽屉效果抽屉式风格主题框架源码-使用MaterialDesignThemes实现WPF炫酷漂亮的效果-提供Demo下载相关推荐

  1. html 滤镜制作线条,PS滤镜简单制作炫酷的线条效果

    今天为大家分享利用PS滤镜制作炫酷线条效果方法,教程很不错,值得大家学习,推荐过来,喜欢的朋友快快来学习吧! 步骤 启动PS软件 ctrl+n新建一空白文档,尺寸为 800x600px,背景色设置为黑 ...

  2. iOS动画开发之五——炫酷的粒子效果

    iOS动画开发之五--炫酷的粒子效果 在上几篇博客中,我们对UIView层的动画以及iOS的核心动画做了介绍,基本已经可以满足iOS应用项目中所有的动画需求,如果你觉得那些都还不够炫酷,亦或是你灵光一 ...

  3. [译] CSS 变量实现炫酷鼠标悬浮效果

    原文: Stunning hover effects with CSS variables 我的博客:[译] CSS 变量实现炫酷鼠标悬浮效果 我最近从Grover网站上的有趣的悬停动画中获得灵感.将 ...

  4. css3个性loading,css3 中实现炫酷的loading效果

    •今天实现了一个炫酷的loading效果,基本全用css来实现,主要练习一下css3的熟练运用 •js需要引入jquery 只用到了一点点js •先看效果图 html: 加载中 . . . css: ...

  5. 开源Blog系统-欧式风格家具网站源码v1.5.4

    介绍: 欧式风格家具网站源码是一款开源的THinkphp5.0 的 Blog系统,其衍生于优秀的内容管理系统易优cms. 欧式风格家具网站源码秉承了易优CMS的先进设计理念,并且专注于家居行业. 网站 ...

  6. 百度SEO站群流光风格个人主页HTML源码

    预览图片: 一款好看流光风格个人主页HTML源码,感觉挺喜欢的,需要的自行下载! 下载地址: http://www.bytepan.com/nMAtuh35UHo

  7. Emlog资源网下载主题模板源码

    全新资源网/教程网/下载站网站Emlog主题模板源码,Emlog资源网模板,网站快速秒开!首先模板采用了一键安装,无需操作数据库:模板外观整体升级 最新文章支持无限加载文章无刷新切换分类. 首页幻灯支 ...

  8. android svg动画框架,Android实现炫酷SVG动画效果

    svg是目前十分流行的图像文件格式了,svg严格来说应该是一种开放标准的矢量图形语言,使用svg格式我们可以直接用代码来描绘图像,可以用任何文字处理工具打开svg图像,通过改变部分代码来使图像具有交互 ...

  9. android 赛车 源码,android 3D风格赛车游戏源码

    android 3D风格赛车游戏源码,基于Libgdx 框架开发,三维视觉,包含20量敌方车辆和10量我方车辆,支持Admob广告插件,带游戏排行榜和成就系统 ,兼容手机.平板电脑等多种屏幕尺寸 ,游 ...

  10. WordPress总裁CeoMax主题模板源码3.9.1无需授权

    正文: WordPress总裁CeoMax主题模板源码3.9.1无需授权,总裁主题是一个非常不错的WP模板,支持非常多样化的搭建,可以构建自己独一无二的页面,模板功能也非常的强大,完整演示图在压缩包. ...

最新文章

  1. PyTorch 自动微分示例
  2. TensorFlow多元线性回归实现
  3. leetcode算法题--Reverse Words in a String
  4. CentOs配置网卡
  5. hash 建表 query 统计重复个数
  6. Linux yum 命令
  7. C++常用函数的使用方法小结
  8. 高性能服务器开发之C++定时器
  9. Spring学习笔记十二---泛型依赖注入
  10. [缓存]迅雷下载原理
  11. myeclipse试用小记----Hibernate多对一双向关联(2)
  12. 需求阶段如何书写Use Case
  13. 用MATLAB玩转机器人--第六章 用MATLAB玩转单关节机器人
  14. 七款非常好用的电脑数据恢复软件推荐
  15. 软件构造笔记——Java基本数据类型和对象数据类型
  16. 物联网ARM开发高级
  17. 跟父亲一样伟大的程序员,请照顾好自己!
  18. VB:SysInfo控件
  19. puts和fputs函数及其区别,C语言puts和fputs函数详解
  20. Guice的scope

热门文章

  1. Sql Server数据库查询去重数据,并保留最新的数据,以及删除重复数据
  2. Win系统 - 如何解决 Windows + P 键无法切换双显复制模式?
  3. java 编译java文件_如何编译JAVA文件
  4. 【学习笔记】尚硅谷大数据项目之Flink实时数仓---DWM层
  5. 随手查_AD画板粗略步骤
  6. Git学代码之学会运行别人的代码
  7. 开源截图录屏软件Captura
  8. 威纶触摸屏EB8000编程软件V4.65.14 官方最新版
  9. Java 复制文件并改名
  10. 对称加密算法之Java SM4算法应用 附可用工具类