Note that there are some explanatory texts on larger screens.

plurals
  1. POAttribute value out of range exception
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/5006100/xaml-parse-exception-attribute-staticresource-phoneaccentbrush-value-is-out-o">XAML parse Exception: Attribute {StaticResource PhoneAccentBrush} value is out of range</a> </p> </blockquote> <p>recently i am starting win phone 7 programing in c#. for first time i take a button and textbox only.In button click function i wrote:</p> <pre><code>private void ClickMeButton_Click(object sender, RoutedEventArgs e) { BannerTextBlock.Text = MessageTextBox.Text; MessageTextBox.Text = String.Empty; } </code></pre> <p>then i receive an error message **in file:**MainPage.g.i.cs</p> <blockquote> <p><strong>in line:</strong> System.Windows.Application.LoadComponent(this, new System.Uri("/WindowsPhoneApplication2;component/MainPage.xaml", System.UriKind.Relative));</p> <p><strong>error message:</strong> Attribute {StaticResource PhoneAccentBrush} value is out of range. [Line: 39 Position: 138]</p> </blockquote> <p>I can not find any solution in Microsoft's own site. what can I do? </p> <p><strong>XAML content of UI:</strong> </p> <pre><code> &lt;phone:PhoneApplicationPage x:Class="WindowsPhoneApplication2.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="Portrait" Orientation="Portrait" shell:SystemTray.IsVisible="True"&gt; &lt;!--LayoutRoot is the root grid where all page content is placed--&gt; &lt;Grid x:Name="LayoutRoot" Background="Transparent"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;RowDefinition Height="*"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;!--TitlePanel contains the name of the application and page title--&gt; &lt;StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"&gt; &lt;TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/&gt; &lt;TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style=" {StaticResource PhoneTextTitle1Style}"/&gt; &lt;/StackPanel&gt; &lt;!--ContentPanel - place additional content here--&gt; &lt;Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="*" /&gt; &lt;ColumnDefinition Width="Auto"/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;TextBox Name="MessageTextBox" FontSize="{StaticResource PhoneFontSizeExtraLarge}" Margin="20,20,10,477"/&gt; &lt;Button Grid.Column="1" Name="ClickMeButton" Content="Click Me" HorizontalAlignment="Right" Padding="4" Margin="0,20,20,477" Style="{StaticResource PhoneAccentBrush}" DataContext="{Binding}" Click="ClickMeButton_Click" /&gt; &lt;Grid Margin="0,0,0,477"&gt; &lt;TextBlock Name="BannerTextBlock" Style="{StaticResource PhoneTextExtraLargeStyle}" Foreground="#FFFF9A00" HorizontalAlignment="Stretch" TextWrapping="Wrap" TextAlignment="Center" FontWeight="Bold" Margin="12,0,12,491" /&gt; &lt;/Grid&gt; &lt;/Grid&gt; &lt;/Grid&gt; &lt;!--Sample code showing usage of ApplicationBar--&gt; &lt;!--&lt;phone:PhoneApplicationPage.ApplicationBar&gt; &lt;shell:ApplicationBar IsVisible="True" IsMenuEnabled="True"&gt; &lt;shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/&gt; &lt;shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/&gt; &lt;shell:ApplicationBar.MenuItems&gt; &lt;shell:ApplicationBarMenuItem Text="MenuItem 1"/&gt; &lt;shell:ApplicationBarMenuItem Text="MenuItem 2"/&gt; &lt;/shell:ApplicationBar.MenuItems&gt; &lt;/shell:ApplicationBar&gt; &lt;/phone:PhoneApplicationPage.ApplicationBar&gt;--&gt; &lt;/phone:PhoneApplicationPage&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload