开发者

Custom WPF user control via repositionable child control

开发者 https://www.devze.com 2023-01-29 16:22 出处:网络
I need your help. I would like to develope a WPF user control via these features: 1. Control should be able to have a content.

I need your help.

I would like to develope a WPF user control via these features: 1. Control should be able to have a content. 2. We should be able to define a position at parent control, where child control should be rendered.

It doesn't seems to be a difficult case, but I insistently can not find any helpfull information. Any information appreciated - I am only begining to learn WPF.

Thanks is advance. :)

[Update]

  1. In "开发者_如何学CHost control" - PartSelectorList:

    1.1. Xaml: < ContentControl Content="{Binding Path=Dummy}" Height="50" Visibility="Visible" />

    1.2. Code-behind: DependencyProperty DummyProperty

  2. In "Final control":

    2.1. Xaml: ...

    < PartSelectorList>

    < PartSelectorList.Dummy>

    < StackPanel />

    < /PartSelectorList.Dummy>

    < /PartSelectorList>


why not do something really simple

<ContentControl Canvas.Left="10" Canvas.Top="20"> ..content here</ContentControl>
0

精彩评论

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