显示之前的InitializeComponent子窗口(Show child window befo

2019-09-26 07:14发布

我有Silverlight应用程序我想显示前主页的InitializeComponent登录窗口();

此方法不工作:

public MainPage()
        {
            Login log = new Login();
            log.Show();
            InitializeComponent();
        }

有什么建议?

Answer 1:

尝试这个:

public MainPage()
        {

            InitializeComponent();
            Loaded += MainPage_Loaded;
        }

 private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            Visibility = Visibility.Collapsed;
            Login log = new Login();
            log.Show();
        }


文章来源: Show child window before InitializeComponent