wpf user control
I have a wpf application that has a number of user controls defined. For one of these controls (a login screen) I want to be able to hide the login user control and then display the registration user control. In the code behind file for the login I have tried the following
Registration reg = new Registration();
reg.Visibility = Visibility.Visible;
Is there a way to do this? I have also read about a page object in reading upon wpf - is 开发者_如何学Pythonthis a better way to go about this problem?
You've created it, but you haven't added it.
You need to add it to the parent UserControl or Window you want it displayed in.
You could create both controls in a Grid or DockPanel or similar using XAML, and then set Visibility = Visibility.Collapsed to hide the individual controls.
精彩评论