Show child window before InitializeComponent

眉间皱痕 提交于 2020-01-05 08:42:59

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!