我正在按照Microsoft Band SDK文档中的示例进行操作,以使用主题色填充按钮,但由于Color和ThemeColor.BandBase不存在于任何软件包中,因此代码无法编译。示例中的代码如下:
FilledPanel panel = new FilledPanel
{
Rect = new PageRect(0, 0, 245, 102),
Color = ThemeColor.BandBase
};
我假设“Color”应该是“BackgroundColor”,因为该属性存在,但我找不到任何类似于“ThemeColor”的可用选项。有人知道我可以使用什么吗?
更新:我认为我可能已经解决了这个问题:
BandTheme theme = await bandClient.PersonalizationManager.GetThemeAsync();
// create a filled rectangle to provide the background for a button
FilledPanel panel = new FilledPanel
{
Rect = new PageRect(0, 0, 245, 102,
BackgroundColor = theme.Base
};
尚未测试。如果有效,将添加为答案。