![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Color Hi, I have an application with a color for some parts of the UI and I want that the user is able to change that color so I tried to create a "style" of that color and in code I have only to change that color and it would change all the UI, so I did: <GradientStop Color="{StaticResource bglight}" Offset="1"/> .... <Window.Resources> <SolidColorBrush x:Key="bglight" Color="#1A6CAA" /> </Window.Resources> but the problem here is that it says that it can't find bglight, what am I doing wrong here? Thanks Bruno Silva |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Color Doug wrote: > I have noticed in the November CTP that you have to define resources > before you use them (literally before they are referenced in the XAML > file). > > I'm sure this has changed from earlier versions, and as yet I haven't > seen any mention as to why. Yeah, this is a change specifically in the Nov. CTP actually. StaticResource no longer supports forward looking resource resolution. They are resolved according what resources are available in the current lexical scope while parsing the XAML document. HTH, Drew |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Color I touched on this in http://blogs.msdn.com/nickkramer/arc...20/482915.aspx (second paragraph). Long story short, we couldn't make for references work all the time, so we decided not to support them. Actually, in the November CTP, there's at least one case where we still support forward references; at some point we'll stop supporting that as well. The case we still support is one resource referring to another resource in a resource dictionary (at least inside compiled xaml, not sure about uncompiled), e.g.: <Something.Resources> <SomeObject x:Key="A" Property="{StaticResource B}/> <SomeObject x:Key="B"/> </Something.Resources> That's a forward reference, we support that by accident today and will do the correct, no forward references allowed behavior in a future CTP when we correct StaticResource to behave lexically (see blog). -Nick Kramer [MSFT] http://blogs.msdn.com/nickkramer --- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm "Doug" <doug@remove.11011.net> wrote in message news:eca9ec38d1dc88c7cacfc3451080@news.microsoft.com... >I have noticed in the November CTP that you have to define resources before >you use them (literally before they are referenced in the XAML file). > > I'm sure this has changed from earlier versions, and as yet I haven't seen > any mention as to why. > > There are some other problems with your XAML, but if you change it to: > > <Window.Resources> > <SolidColorBrush x:Key="bglight" Color="#1A6CAA" /> > </Window.Resources> > ... > <GradientStop Color="{StaticResource bglight}" Offset="1"/> > > You should be able to make some progress. > > - Doug > >> Hi, I have an application with a color for some parts of the UI and I >> want that the user is able to change that color so I tried to create a >> "style" of that color and in code I have only to change that color and >> it would change all the UI, so I did: >> >> <GradientStop Color="{StaticResource bglight}" Offset="1"/> >> ... >> <Window.Resources> >> <SolidColorBrush x:Key="bglight" Color="#1A6CAA" /> >> </Window.Resources> >> but the problem here is that it says that it can't find bglight, what >> am I doing wrong here? >> >> Thanks >> Bruno Silva > > > |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| color value | .NET General | |||
| Can't change Color of pages using color/appearance | Vista installation & setup | |||
| off color | Vista print fax & scan | |||
| Not all color names give right color? | PowerShell | |||
| Color Changes | Vista General | |||