WPF SplashControl - >登录页面 - >主窗口

时间:2015-04-01 11:10:26

标签: c# wpf

我尝试为启动应用程序构建逻辑。启动控件需要加载数据,但用户可以登录,同时加载数据。

        private void SplashControl_OnLoaded(object sender, RoutedEventArgs e)
    {
        StausLabel.Content = "Loading Data...";
        ShowLoginContinueLoading();
    }

    private void ShowLoginContinueLoading()
    {
        var loginWindow = new LoginWindow();
        var task = new Task(() =>
        {
            Managers.LoadUsers();
        });
        task.ContinueWith(async innerTask =>
        {
            Dispatcher.Invoke(loginWindow.Show);
            try
            {
                Managers.LoadData();
            }
            catch (Exception exception)
            {
                throw exception;
            }
            Dispatcher.Invoke(() => StausLabel.Content = "Loading Complite");
        });

        task.Start();

SlashControl如何知道登录成功与否?

0 个答案:

没有答案