【发布时间】:2018-08-10 13:30:03
【问题描述】:
我正在尝试为附加效果的控件应用背景。
首先,我为 UWP 中具有填充或背景属性的控件应用背景效果。 但问题是很多控件在 UWP 中呈现给 FrameworkElement。并且 FrameworkElement 没有 Background 属性。 在 VisualElementRenderer Xamarin 表单中,解决了在内容后面应用背景层的问题,但这是一种效果。 有什么方法可以为附加的效果应用背景吗? 我正在应用 AcrylicBrush 所以它必须直接分配给 Control。
我之前写的代码:
try
{
Control.GetType().GetProperty("Background").SetValue(Control, brush);
}
catch
{
Control.GetType().GetProperty("Fill").SetValue(Control, brush);
}
【问题讨论】:
标签: xamarin.forms uwp background effects acrylic-material