开发者

XAML reference static resource

How do I reference a staticresource in XAML? (I'm not talking about binding expr开发者_如何学编程essions..) As in this example:

<csla:CslaDataProvider  
                       x:Key="Rekvisition"
                       ObjectType="{x:Type model.faktura.rekvisitioner:Rekvisition}"
                       FactoryMethod="NewRekvisition"

                       IsAsynchronous="False"
                       ManageObjectLifetime="True"
                       IsInitialLoadEnabled="False"
        >
            <csla:CslaDataProvider.FactoryParameters>
             <x:Array Type="ReadOnlyBruger">
               INSERT REFERENCE TO STATIC RESOURCE  
             </x:Array>
            </csla:CslaDataProvider.FactoryParameters>
        </csla:CslaDataProvider>

/Fredrik


You can use the StaticResourceExtension with element syntax:

         <x:Array Type="ReadOnlyBruger">
           <StaticResourceExtension ResourceKey="Rekvisition" />
         </x:Array>


Use {StaticResource Rekvisition} elsewhere in your xaml.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜