开发者

Ways to apply dynamic style to same user control in different silverlight application?

I have created a user cont开发者_JS百科rol in silver-light.

I will use this control in two different applications.

Each application has its own styling rules.

I want user control to adopt styling defined in the respective application.

One approach I found is

1) Define two separate styling template of same key in the App.xaml of both application.

2) Use static resource binding to bind styling to the control.

Is there other approach to do the same.??


If the style does not change within a single application I would define a style like this:

<Style TargetType="MyUserControl />

If it changes per situation/view, apply a resource key and set the style per instance of the control.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜