开发者

I wanted to host two user control and combine into one user control in WPF?

开发者 https://www.devze.com 2023-02-26 20:27 出处:网络
I wanted to two host u开发者_Go百科ser control and combine into one user control in WPF. How do you want your controls laid out? Do you want them placed vertically, like so:

I wanted to two host u开发者_Go百科ser control and combine into one user control in WPF.


How do you want your controls laid out? Do you want them placed vertically, like so:

<UserControl Name="MyHostControl">
    <Grid>
        <Grid.ColumnDefintions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefintions>

        <local:MyControl1 Grid.Column="0"/>
        <local:MyControl2 Grid.Column="1"/>
    </Grid>
</UserControl>

Are you looking for something else? You're using WPF, where the flexibility is better than that of any gymnast. You can make your user controls the content of just about any other WPF control you want.


You should probably start here: Control Authoring Overview

0

精彩评论

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