众所周知 窗口设置effect的阴影打开时是没有效果的
那么如何能让窗口在打开时有阴影效果呢??
有两种解决方法:
1、使用一张做好的带阴影效果的图片1653做为窗体背景;
2、窗口没有阴影效果并不是没有, 而是被窗口背身遮住了,所以我们只需要让它能显示出来就大功告成了
本文采用的是第二种(第一种就不用说了吧),简单来说就是主Grid模拟整个窗口 包括标题栏 再设置grid的阴影 最后设置窗口的边框宽度到能显示阴影的程度 。 直接上代码:
<Window
x:Class="LaserPointCloud.Views.LiningComputerDlg2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:LaserPointCloud.Views"
xmlns:models="clr-namespace:LaserPointCloudCore.Models;assembly=LaserPointCloudCore"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:valuecovert="clr-namespace:CustomControlLibrary.ValueCovert;assembly=CustomControlLibrary"