在Catel中登录/登录对话框

时间:2014-11-19 08:23:31

标签: catel

如何在Catel中创建登录/登录对话框?

我们目前使用带有Boot Class和单个BootTask的Custom Splash屏幕进行睡眠,直到成功登录或取消。

还有其他选择吗?

修改

以下是我们目前所做的一些代码:

App.xaml.cs:

protected override void OnStartup(StartupEventArgs e)
{
      base.OnStartup(e);

      new Boot().RunWithSplashScreen<LoginViewModel>();
}

引导类:

public class Boot : BootstrapperBase<MainMenuWindow>
    {
        private Session CurrentSession = Session.Instance;

        protected override void InitializeBootTasks(IList<ITask> bootTasks)
        {
            bootTasks.Add(new ActionTask("Awaiting Login", delegate
                {
                    while (/*not successfully logged in*/) Thread.Sleep(1000);

                    if (/*login cancelled*/)
                        App.Current.Dispatcher.Invoke((Action)(
                            delegate
                            {
                                App.Current.Shutdown();
                            }));
                }));

            base.InitializeBootTasks(bootTasks);
        }
    }

0 个答案:

没有答案
相关问题