Binding value of object to another object
-
I have a SolidColorBrush resource in one file, and I want to create a copy of it in another file. for example File 1: File 2: I'd like to avoid making a different object with that brush as the fill because that creates overhead. Any ideas?
-
Use DynamicResource instead ... Create a brush:
<SolidColorBrush x:Name="brush1" Color="White"/>
<Grid.BitmapEffect>
<OuterGlowBitmapEffect GlowColor="{DynamicResource brush1}" GlowSize="1"/>
</Grid.BitmapEffect>Jammer My Blog | Article(s)
-
I have a SolidColorBrush resource in one file, and I want to create a copy of it in another file. for example File 1: File 2: I'd like to avoid making a different object with that brush as the fill because that creates overhead. Any ideas?
_iobuf wrote:
resource in one file, and I want to create a copy of it in another file
Is there some reason that you do not want to use a resource dictionary?
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Individuality is fine, as long as we do it together - F. Burns
-
_iobuf wrote:
resource in one file, and I want to create a copy of it in another file
Is there some reason that you do not want to use a resource dictionary?
Why is common sense not common? Never argue with an idiot. They will drag you down to their level where they are an expert. Sometimes it takes a lot of work to be lazy Individuality is fine, as long as we do it together - F. Burns
It's because one file has references to colors using StaticResource, and another needs to reference them using DynamicResource so I can then bind the color statically. Basically, I want to have a constant pointer to a field which changes values.. The thing with adding extra objects works so that's kind of what I'm getting at, except I'd like to do it without the extra overhead.