Topic Author
Posts: 53
Joined: 24 Mar 2021, 14:33

UserControl binding to ContentControl's Content

09 May 2021, 10:41

Hey, I wanna bind my UserControl *uc to ContentControl's Content so I have declared my UserControl in class
Ptr<UserControl> uc;
Then I create in method new UserControl
void TestMenuContent::OnTab2Focused(BaseComponent * param)
	uc = MakePtr<Tab2Content>();
Here is my NsProp
NsProp("ContentTest", &TestMenuContent::uc);
And here is my ContentControl
<Grid Background="Black" Height="450" VerticalAlignment="Top" Opacity="1">
        <ContentControl Content="{Binding ContentTest}"/>
And it only works if I Create UserControl in constructor it works..
In method OnTab2Focused nothing happens. Yes that method fires.

Am I missing something?

Posts: 193
Joined: 30 May 2014, 10:26

Re: UserControl binding to ContentControl's Content

09 May 2021, 17:14

I'm not sure what you are trying to do here but I can already tell you that it's now how you do things. You don't use controls behind the scenes. They need to be an actual part of the tree.

Who is online

Users browsing this forum: No registered users and 2 guests