简体   繁体   中英

WP8 Xaml UserControl performance

When creating a control in xaml, I could do two things:

  1. Create a StackPanel, add a few TextBlocks, a Rectangle et.c
  2. Create a templated control, and add that to my MainPage.xaml

In terms of performance (only), which one would be better? Both work fine, as I see it.

Typically, at the top of a page, I would create a kind of header panel, containing some text blocks, some visual indicator et.c. The control isn't that big, perhaps it contains 10-12 children. Usually, I just type it up directly in the page xaml, as it isn't reused anywhere. But I usually apply some kind of animation to the header panel (let's say it is part of a FeatheredTransition when loading the page).

So my question is: would there be any performance advantage (from a xaml loader/renderer/animation perspective) if I create a template control first? What's the general recommendation?

我认为不会有任何明显的差异,所以请使用任何您想要的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM