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

投资我赢网seo优化网站

投资,我赢网seo优化网站,网站空间商推荐,网站系统管理计划常规的无边框方法设计 常规的WPF无边框设计方法都是通过AllowsTransparency="True"和WindowStyle=“None”,并且使用WindowChrome样式来实现,但是这样会有问题就是,窗体最大化的时候将底部任务栏给挡住了,另外最大化的时候不能拖动窗体。参考这个大佬的设计@ 若…

常规的无边框方法设计

常规的WPF无边框设计方法都是通过AllowsTransparency="True"和WindowStyle=“None”,并且使用WindowChrome样式来实现,但是这样会有问题就是,窗体最大化的时候将底部任务栏给挡住了,另外最大化的时候不能拖动窗体。参考这个大佬的设计@ 若汝棋茗 WPF制作无边框窗体、圆角窗体、支持改变大小、拖动分屏等(一)
但是感觉好麻烦啊。

比较完美的无边框设计

参照这个大佬的设计:梦机器工作室。保留了原改生的最小化、最大化、关闭、拖拽、伸缩窗体大小等操作。
在这里插入图片描述
可以看到在设计器内还是保留了默认的WindowStyle。

运行效果

在这里插入图片描述
完整的源码。

资源字典

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApp1"><Style x:Key="BorderlessButton" TargetType="Button"><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="Button"><Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Background="{TemplateBinding Background}"><Border x:Name="bg" Background="{StaticResource TransparentColor}" /><Path x:Name="content"Width="{TemplateBinding local:Icon.Width}"Height="{TemplateBinding local:Icon.Height}"Data="{TemplateBinding local:Icon.Geometry}"Fill="{TemplateBinding Foreground}"Stretch="Fill"UseLayoutRounding="True" /></Grid><ControlTemplate.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter TargetName="bg" Property="Background" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(local:Mouse.OverBackColor)}" /></Trigger><Trigger Property="IsPressed" Value="True"><Setter Property="Opacity" Value="0.8" /></Trigger></ControlTemplate.Triggers></ControlTemplate></Setter.Value></Setter></Style><!--#region 系统窗口--><Style x:Key="BorderlessWindowStyle" TargetType="{x:Type local:BorderlessWindow}"><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="{x:Type local:BorderlessWindow}"><Border Background="{TemplateBinding Background}"BorderBrush="{TemplateBinding BorderBrush}"BorderThickness="{TemplateBinding BorderThickness}"SnapsToDevicePixels="True"><Grid Margin="{TemplateBinding Padding}"><Grid.RowDefinitions><RowDefinition Height="Auto" /><RowDefinition /></Grid.RowDefinitions><AdornerDecorator x:Name="content" Grid.Row="1"><ContentPresenter /></AdornerDecorator><ResizeGrip x:Name="ResizeGrip"Grid.Row="1"Margin="0,0,5,5"HorizontalAlignment="Right"VerticalAlignment="Bottom"IsTabStop="False"Visibility="Collapsed"WindowChrome.ResizeGripDirection="BottomRight" /><Grid Background="{TemplateBinding CaptionBackground}"><Grid.ColumnDefinitions><ColumnDefinition /><ColumnDefinition Width="Auto" /></Grid.ColumnDefinitions><ContentPresenter Content="{TemplateBinding TitleContent}" /><StackPanel Grid.Column="1" Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True"><!--  最小化按钮  --><Button x:Name="ButtonMin"Width="{TemplateBinding SystemButtonSize}"Height="{TemplateBinding SystemButtonSize}"local:Icon.Geometry="F1M0,6L0,9 9,9 9,6 0,6z"local:Icon.Height="3"local:Mouse.OverBackColor="{TemplateBinding SystemButtonOverColor}"Background="{TemplateBinding SystemButtonColor}"Command="SystemCommands.MinimizeWindowCommand"Foreground="{TemplateBinding SystemButtonForeground}"IsTabStop="False"Style="{StaticResource BorderlessButton}" /><!--  最大化按钮  --><Button x:Name="ButtonMax"Width="{TemplateBinding SystemButtonSize}"Height="{TemplateBinding SystemButtonSize}"local:Icon.Geometry="F1M0,0L0,9 9,9 9,0 0,0 0,3 8,3 8,8 1,8 1,3z"local:Mouse.OverBackColor="{TemplateBinding SystemButtonOverColor}"Background="{TemplateBinding SystemButtonColor}"Command="SystemCommands.MaximizeWindowCommand"Foreground="{TemplateBinding SystemButtonForeground}"IsTabStop="False"Style="{StaticResource BorderlessButton}" /><!--  恢复按钮  --><Button x:Name="ButtonRestore"Width="{TemplateBinding SystemButtonSize}"Height="{TemplateBinding SystemButtonSize}"local:Icon.Geometry="F1M0,10L0,3 3,3 3,0 10,0 10,2 4,2 4,3 7,3 7,6 6,6 6,5 1,5 1,10z M1,10L7,10 7,7 10,7 10,2 9,2 9,6 6,6 6,9 1,9z"local:Mouse.OverBackColor="{TemplateBinding SystemButtonOverColor}"Background="{TemplateBinding SystemButtonColor}"Command="SystemCommands.RestoreWindowCommand"Foreground="{TemplateBinding SystemButtonForeground}"IsTabStop="False"Style="{StaticResource BorderlessButton}" /><!--  关闭窗口按钮  --><Button x:Name="ButtonClose"Width="{TemplateBinding SystemButtonSize}"Height="{TemplateBinding SystemButtonSize}"local:Icon.Geometry="M453.44 512L161.472 220.032a41.408 41.408 0 0 1 58.56-58.56L512 453.44 803.968 161.472a41.408 41.408 0 0 1 58.56 58.56L570.56 512l291.968 291.968a41.408 41.408 0 0 1-58.56 58.56L512 570.56 220.032 862.528a41.408 41.408 0 0 1-58.56-58.56L453.44 512z"local:Mouse.OverBackColor="{TemplateBinding SystemButtonCloseOverColor}"Background="{TemplateBinding SystemButtonColor}"Command="SystemCommands.CloseWindowCommand"Foreground="{TemplateBinding SystemButtonForeground}"IsTabStop="False"Style="{StaticResource BorderlessButton}" /></StackPanel></Grid></Grid></Border><ControlTemplate.Triggers><Trigger Property="FitSystemWindow" Value="True"><Setter TargetName="content" Property="Grid.Row" Value="0" /><Setter TargetName="content" Property="Grid.RowSpan" Value="2" /></Trigger><Trigger Property="WindowState" Value="Maximized"><Setter Property="Padding" Value="8" /><Setter TargetName="ButtonMax" Property="Visibility" Value="Collapsed" /><Setter TargetName="ButtonRestore" Property="Visibility" Value="Visible" /></Trigger><Trigger Property="WindowState" Value="Normal"><Setter TargetName="ButtonMax" Property="Visibility" Value="Visible" /><Setter TargetName="ButtonRestore" Property="Visibility" Value="Collapsed" /></Trigger><Trigger Property="ResizeMode" Value="NoResize"><Setter TargetName="ButtonMin" Property="Visibility" Value="Collapsed" /><Setter TargetName="ButtonMax" Property="Visibility" Value="Collapsed" /><Setter TargetName="ButtonRestore" Property="Visibility" Value="Collapsed" /></Trigger><Trigger Property="ResizeMode" Value="CanMinimize"><Setter TargetName="ButtonMax" Property="Visibility" Value=
http://www.dtcms.com/wzjs/405109.html

相关文章:

  • php和java做网站哪个好做外贸怎么推广
  • 高校网站建设近期情况说明在百度上做广告推广要多少钱
  • 网站内页做友链淘宝推广工具
  • 企业网站资料大全超云seo优化
  • 出口网站建设方案百度影响力排名顺序
  • 招聘网站评估怎么做郑州免费做网站
  • 网站基础建设和管理暂行办法为企业策划一次网络营销活动
  • 新疆建设职业技术学院招生信息网站seo工作流程
  • java网站开发思维导图怎样在百度上做广告
  • 如何在对方网站上做外链深圳网站建设公司
  • 视频上到什么地方可以做网站链接中文网站排名
  • 多地优化调整疫情防控措施seo的方法
  • 公司网站如何更改内容企业seo如何优化
  • 网站推广页面 英语体验营销
  • 上海网站空间合肥做网站公司哪家好
  • 南昌网站建设公司价位适合小学生的最新新闻
  • 网站建设培训哪家好有创意的网络营销案例
  • lamp wordpress主题太原百度快速优化排名
  • 品牌推广部河南网站seo
  • 哈尔滨大型网站制作开发站长素材网站
  • ppt网站超链接怎么做企业seo顾问服务阿亮
  • 论坛门户网站开发企业自助建站
  • 如何承接设计网站建设英语seo什么意思
  • 数字广东网络建设有限公司电话杭州网络排名优化
  • 沈阳网站建设多少钱邵阳网站seo
  • 推荐几个没封的正能量网站产品市场营销策划方案
  • ubuntu中wordpressseo推广系统
  • 容桂营销网站建设建站公司最新报价
  • 网站邮箱接口怎么设置搜索推广公司
  • 网站的横幅怎么做吸引人的软文