【发布时间】:2015-11-27 13:53:50
【问题描述】:
弹出按钮不会将其主题从浅色更改为深色。我不知道为什么。 请参阅下面的示例代码。您可以在此处更改主题,然后弹出按钮将保持为浅色主题。
MainPage.xaml
<Page>
<Page.BottomAppBar>
<CommandBar>
<AppBarButton Icon="Emoji">
<AppBarButton.Flyout>
<Flyout/>
</AppBarButton.Flyout>
</AppBarButton>
<AppBarToggleButton Checked="Checked" Unchecked="Unchecked">
<AppBarToggleButton.Icon>
<FontIcon Glyph="" />
</AppBarToggleButton.Icon>
</AppBarToggleButton>
</CommandBar>
</Page.BottomAppBar>
</Page>
MainPage.cs
public sealed partial class MainPage : Page
{
private void Checked(object sender, RoutedEventArgs e)
{
this.RequestedTheme = ElementTheme.Dark;
}
private void Unchecked(object sender, RoutedEventArgs e)
{
this.RequestedTheme = ElementTheme.Light;
}
}
【问题讨论】:
-
检查我的答案并标记它是否解决了您的问题。
标签: xaml themes uwp appbar flyout