问题
I have Silverlight application i want to show login window before main page InitializeComponent();
this method does not works:
public MainPage()
{
Login log = new Login();
log.Show();
InitializeComponent();
}
Any advice?
回答1:
Try this:
public MainPage()
{
InitializeComponent();
Loaded += MainPage_Loaded;
}
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
Visibility = Visibility.Collapsed;
Login log = new Login();
log.Show();
}
来源:https://stackoverflow.com/questions/8526230/show-child-window-before-initializecomponent