我正在创建XamarinFroms解决方案,我想在我的UWP应用中实现Fluent Design或pats。您可能知道,大多数Fluent Design构建块都是ThemeResources。所以我尝试做:
if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.AcrylicBrush"))
{
var brush = Windows.UI.Xaml.Application.Current.Resources["SystemControlAltHighAcrylicWindowBrush"] as AcrylicBrush;
var tint = brush.TintColor;
var opacity = brush.TintOpacity;
var fallbackColor = brush.FallbackColor;
var source = brush.BackgroundSource;
}
但由于非偶然性,我得到了
System.Exception: 'Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))' on the brush creating line of code.
如果我无法在UWP项目的代码中检索到那些主题资源,我将无法访问任何预定义的笔刷,或者永远无法实现显示样式
答案 0 :(得分:0)
对于UWP流利设计,它仅在UWP中可用,您不能直接在xamarin Forms中实现它。当前Xamarin Forms还没有提供这样的界面。 =因为这是UWP的特定设计。而且几乎没有抽象出适用于每个平台的统一接口。因此,更好的方法是分别使用Custom Renderer来实现。例如,按照您的情况,要使count_colname
# [1] "derived_name_letr_count"
sym(count_colname)
# derived_name_letr_count
qq_show(count_colname)
# count_colname
qq_show(sym(count_colname))
# sym(count_colname)
qq_show(!! sym(count_colname))
# derived_name_letr_count
qq_show(!! count_colname)
# "derived_name_letr_count"
在Xamarin.UWP中工作,您可以自定义SystemControlAltHighAcrylicWindowBrush
。以下段代码实现了LayoutRenderer
的{{1}}。
AcrylicWindowBrush