我有Silverlight应用程序我想在主页InitializeComponent();
之前显示登录窗口此方法不起作用:
public MainPage()
{
Login log = new Login();
log.Show();
InitializeComponent();
}
有什么建议吗?
答案 0 :(得分:3)
试试这个:
public MainPage()
{
InitializeComponent();
Loaded += MainPage_Loaded;
}
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
Visibility = Visibility.Collapsed;
Login log = new Login();
log.Show();
}