Skip to content

修改App.xml.cs中的LoginOut方法,让其重新登陆时可以更改UserName. #6

@haijunluo

Description

@haijunluo
    public static void LoginOut(IContainerProvider provider)
    {
        Application.Current.MainWindow.Hide();
        var dialog = provider.Resolve<IDialogService>();
        dialog.ShowDialog("LoginView", callback =>
        {
            if (callback.Result != ButtonResult.OK)
            {
                Environment.Exit(0);
                return;
            }

            // 获取主区域的 RegionManager
            var regionManager = provider.Resolve<IRegionManager>();
            // 移除主区域中的所有视图
            regionManager.Regions[PrismManager.MainViewRegionName].RemoveAll();

            var service = App.Current.MainWindow.DataContext as IConfigureService;
            if (service != null)
                service.Configure();

            Current.MainWindow.Show();
        });
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions