Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: XAML Silverlight Style
iam practice the silverlight examples
so in my application have a grid having stles so this styles is (Assets/Styles.xaml)
in codebehind iam wrote like this
           ResourceDictionary r = new ResourceDictionary();
           r.Source = new Uri("/Assets/Styles.xaml", UriKind.Relative);
           Style s = (Style)r["BigGridStyle"];
           PageContainer.Style = s;
in styles.xaml page wrote like this
<Style x:Key="BigGridStyle" TargetType="Grid">
           <Setter Property="Background">
                   <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                       <GradientStop Color="Blue"></GradientStop>
                       <GradientStop Color="Yellow" Offset="1"></GradientStop>
in xaml page binding staticresource like this
<Grid x:Name="PageContainer" Margin="47,224,49,207" Style="{StaticResource BigGridStyle}"   />
but it's not working for me it's giving error
like this
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See

So can you any one tell me where i wrong?
Thanks & Advance
Posted 24-Apr-12 20:29pm
Edited 24-Apr-12 21:34pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The XAML looks fine. Have you installed the Silverlight Developer Runtime?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 305
1 OriginalGriff 225
2 DamithSL 130
3 Kornfeld Eliyahu Peter 130
4 Peter Leow 95
0 OriginalGriff 7,355
1 DamithSL 5,199
2 Sergey Alexandrovich Kryukov 4,942
3 Maciej Los 4,906
4 Kornfeld Eliyahu Peter 4,514

Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 1 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100