我想,这是一个错误。主题变更不会影响Windows Phone 8.1上禁用的控制主题
要重现,请在Windows Phone上以暗色主题启动应用程序。 应用程序启动后,将主题更改为亮起。 然后点击“启用”按钮。 你会看到“Sample”按钮消失。因为它的主题依然黑暗。背后
<Page x:Class="ButtonThemeTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Button x:Name="ButtonTest"
Content="Sample"
IsEnabled="False" />
<Button Grid.Row="1"
Click="ButtonBase_OnClick"
Content="Enable" />
<Button Grid.Row="2"
Click="ButtonBase_OnClick2"
Content="Disable" />
</Grid>
</Page>
代码:
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
ButtonTest.IsEnabled = true;
}
private void ButtonBase_OnClick2(object sender, RoutedEventArgs e)
{
ButtonTest.IsEnabled = false;
}
你检查按钮的控件模板来看看它的设计不当? – WiredPrairie
按钮的控件模板是默认的 – Dmitry
我试图将按钮的RequestedTemplate更改为Light。但它无法帮助。 – Dmitry