开发者

Is it good to create a usercontrol for Recursive code in xaml?

<Border BorderBrush="#C4C8CC" BorderThickness="0,0,0,1">
        <TextBlock x:Name="SectionTitle" FontFamily="Trebuchet MS" FontSize="14" FontWeight="Bold" Foreground="#3D开发者_C百科3D3D"  />
    </Border>

I have to use the same above format at many places in a single xaml page, so for this i created a usercontrol and defined the above code inside it.

So my question is,

What i am doing is it right approach?

Will it make the page to load slower then the above code used as it is without defining it in a new user control?


I doubt you would notice a difference. However a lighter and more flexiable approach would be to use a Templated Control instead of a UserControl. Its a little more technical but results in a tighter implementation.

How many is "many" anyhow?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜