UserControl binding to ContentControl's Content
Posted: 09 May 2021, 10:41
Hey, I wanna bind my UserControl *uc to ContentControl's Content so I have declared my UserControl in class
Then I create in method new UserControl
Here is my NsProp
And here is my ContentControl
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?
Code: Select all
Ptr<UserControl> uc;
Code: Select all
void TestMenuContent::OnTab2Focused(BaseComponent * param)
{
uc = MakePtr<Tab2Content>();
NS_UNUSED(param);
}Code: Select all
NsProp("ContentTest", &TestMenuContent::uc);Code: Select all
<Grid Background="Black" Height="450" VerticalAlignment="Top" Opacity="1">
<ContentControl Content="{Binding ContentTest}"/>
</Grid>In method OnTab2Focused nothing happens. Yes that method fires.
Am I missing something?