public
Last active

XAML that demonstrates issue with CaretBrush and shared resources

  • Download Gist
CaretBrushResourceExample
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
<phone:PhoneApplicationPage
x:Class="CaretBrushTest.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"
SupportedOrientations="Portrait"
shell:SystemTray.IsVisible="True">
 
<phone:PhoneApplicationPage.Resources>
<SolidColorBrush Color="#FF00FF" x:Key="MyColor" />
</phone:PhoneApplicationPage.Resources>
 
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
 
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="CARETBRUSH SHARED RESOURCE TEST" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
</StackPanel>
 
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBox CaretBrush="{StaticResource MyColor}" />
<Button Grid.Column="1" Content="something" Foreground="{StaticResource MyColor}" />
<TextBlock Grid.Row="1" Grid.ColumnSpan="2" Foreground="{StaticResource MyColor}" Style="{StaticResource PhoneTextLargeStyle}">do i flash?</TextBlock>
<TextBlock Grid.Row="2" Grid.ColumnSpan="2" Foreground="#FF00FF" Style="{StaticResource PhoneTextLargeStyle}">another flasher?</TextBlock>
<Rectangle Grid.Row="3" Grid.ColumnSpan="2" Fill="{StaticResource MyColor}" Height="50" />
</Grid>
</Grid>
 
</phone:PhoneApplicationPage>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.