开发者

What's the best approach to split app.xaml?

I have so many styles in the app.xaml file and now it's close to 5000 lines (after formatt开发者_运维百科ing) but it's getting harder to handle even with comments.

What's the best way to simplify it? Something like splitting it into multiple files then reference them.

Thanks.


You can typically put much of this content into one or more separate ResourceDictionary.xaml files, and use Merged Resource Dictionaries to pull them into your app.xaml.

This lets you keep your styles in nice, small, manageable xaml files.


You can split out your styles, brushes, etc into separate resource dictionaries and then reference them in your app.xaml as merged resources.

Honestly the best way to demonstrate this is to just download one of the Silverlight themes and use it to setup a new project so that you can see it in action. Here is a download for the JetPack theme.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜