我有一个 WPF 页面,我的样式如下:
当我将源设置为 WPF 页面时,它看起来像是在加载。但是,阴影背景样式消失了。
该按钮只是主窗口上的一个测试。背景保留在 Window 中,并且不继承 Page 背景。
有任何想法吗?
框架:
<Frame Source="{Binding ProductFrameSource}" Name="frameProducts" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Column="0" Grid.RowSpan="2" />
private Uri _ProductFrameSource = new Uri("pack://application:,,,/<omitted>.<omitted>.UI;component/Views/Products/<omitted>/Products_<omitted>.xaml");
/// <summary>
/// Gets or sets a property indicating the current product page to display
/// </summary>
public Uri ProductFrameSource
{
get { return _ProductFrameSource; }
set
{
_ProductFrameSource = value;
RaisePropertyChanged("ProductFrameSource");
}
}
页面样式:
<Style TargetType="{x:Type Page}">
<Setter Property="Background">
<Setter.Value>
<DrawingBrush TileMode="Tile" Viewport="0 0 40 40" ViewportUnits="Absolute" Viewbox="0 0 100 100" ViewboxUnits="Absolute">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="#FF1C1C1C" Geometry="M 0 0 L 100 0 L 100 100 L 0 100 Z" />
<GeometryDrawing Geometry="M -10 77.5 L 22.5 110
M -10 52.5 L 47.5 110
M -10 27.5 L 72.5 110
M -10 2.5 L 97.5 110
M 2.5 -10 L 110 97.5
M 27.5 -10 L 110 72.5
M 52.5 -10 L 110 47.5
M 77.5 -10 L 110 22.5">
<GeometryDrawing.Pen>
<Pen Brush="#FF908B91" Thickness=".5" />
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Setter.Value>
</Setter>
</Style>