I am new to Wpf. One UserControl (Wpf UserControl) is added to
the DockPanel and in some action O replaced the first UserControl
with another UserControl in DockPanel dynamically. But the first
UserContorl remains visible and the second UserControl in not showing
in DockPanel.
I don’t know the correct behavior of how I can be
loaded dynamically. I added this code (this code is executed well)
but it doesn’t reflect the action to display “CtlAddEmployee”
control in Dockpanel.
CtlAddEmployee frm2 = new CtlAddEmployee(str);
DockPanelInRibbon.Children.Clear();
DockPanelInRibbon.Children.Add(frm2);
For full details how it is working is asked in my previous question
in detailed way:
Loading another userControl in wpf Ribbon Window when the we click on DataGrid row
Please provide the solution for this.
yaa here i need to refer old object but not the new created object for the corresponding class reference…
For that better to use parameterized constructors..