tags:

views:

55

answers:

1

I created a resource file as 'Style' which sets the fillcolor and border of a rectangle. In 'code' I create a rectangle which is dynamic in size as it's being set by another rectangle size.

What I want is to create the code-based rectangle and have its style set by the resource xaml-file.

How can I do this other then to set it by code. If possible I don't want to use XamlReader.

A: 

You could create a style that would apply to all Rectangles, by specifying only the target type and no x:Key:

<Style TargetType="{x:Type Rectangle}">
    ...
</Style>
Thomas Levesque
when I got time for this :P I'll try to figure out of this is possible for us.
MemoryToLow