0

Helo!

I create in my project a folder named 'Templates'. In this folder I store all my DataTemplates declared in various ResourceDictionary files.
I am attaching it (so it becomes a StaticResource and I can use it everywhere in the

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>                
            <ResourceDictionary Source="/Templates/ContactTemplate.xaml"/>
            <ResourceDictionary Source="/Templates/ProductTemplate.xaml"/>      
            <ResourceDictionary Source="/Templates/OrderTemplate.xaml"/>
        </ResourceDictionary.MergedDictionaries>                
    </ResourceDictionary>
</Application.Resources>

I have many templates, and in some of theme I want to use another template, e.g. in the OrderTemplate I need to use the ContactTemplate and vice versa.
The problem is that Visual Studio 2008 (Yes, it works in run-time, and Expression Studio doesn't notify a problem) reports errors about these templates and doesn't want to show the designer (it does compile tho).
VS loads the templates in the order as they're merged in the App.xaml file, for example, in the OrderTemplate I may use ContactTemplate but not vice versa. I tried mergin the OrderTemplate individually in the ContactTemplate but then after I do so in various templates, it becomes circular and I get a SO exception.

Any experience to share? I need design-time support.
Thanks

4

1 回答 1

1

我不知道我是否做出了正确的决定,但我将循环引用从 StaticResource 更改为 DymaicResource,现在一切正常。

于 2010-01-27T07:44:41.820 回答