XAML parse Exception: Attribute {StaticResource PhoneAccentBrush} value is out of range

后端 未结 1 1546
离开以前
离开以前 2021-01-17 02:30

I have a problem with an Exception, couldn\'t find the answer on how to fix it. Attribute {StaticResource PhoneAccentBrush} value is out of range.

System.Win         


        
相关标签:
1条回答
  • 2021-01-17 02:50

    The problem is in this line:

    <TextBlock Height="311" HorizontalAlignment="Center" 
               Margin="25,32,0,0" Name="textBlock1" 
               Text="This Application is designed ...." 
               VerticalAlignment="Center" Width="425" 
               Style="{StaticResource PhoneAccentBrush}" />
    

    You are trying to set a brush resource value to a style, which is what is causing the exception. You could try changing the XAML to:

    <TextBlock Height="311" HorizontalAlignment="Center" 
               Margin="25,32,0,0" Name="textBlock1" 
               Text="This Application is designed ...." 
               VerticalAlignment="Center" Width="425" 
               Style="{StaticResource PhoneTextNormalStyle}"
               Foreground="{StaticResource PhoneAccentBrush}" />
    
    0 讨论(0)
提交回复
热议问题