wpfui
wpfui copied to clipboard
The settings page can't be displayed, and the program is faked
Describe the bug
I created a login interface, after successful login, close and enter the main interface, after entering, change the style in the settings, it will cause the settings page to not be displayed, what is the reason?
To Reproduce
this is my code: ` try { var resp = await _accountService.CheckAccountAsync(UserName, Password, CheckCode); if (resp.Code != 1) throw new Exception("登录失败,请检查账户密码!"); var win = o as Window; _navigationWindow = ( _serviceProvider.GetService(typeof(INavigationWindow)) as INavigationWindow)!; _navigationWindow!.ShowWindow(); _navigationWindow.Navigate(typeof(Views.Pages.DashboardPage)); win.DialogResult=true;
win.Close();
"登录成功".SnackbarShowInfo();
} catch (Exception ex) { ex.Message.SnackbarShowError(); }`
Expected behavior
After logging in to the callback, you can dynamically modify the theme normally
Screenshots
No response
OS version
win10
.NET version
net6
WPF-UI NuGet version
3.0.3
Additional context
No response
Manually closing the login interface does not affect usage. The program is closed and cannot be used normally
Have you solved it? Can we discuss something on WeChat?
Describe the bug
I created a login interface, after successful login, close and enter the main interface, after entering, change the style in the settings, it will cause the settings page to not be displayed, what is the reason?
To Reproduce
this is my code: ` try { var resp = await _accountService.CheckAccountAsync(UserName, Password, CheckCode); if (resp.Code != 1) throw new Exception("登录失败,请检查账户密码!"); var win = o as Window; _navigationWindow = ( _serviceProvider.GetService(typeof(INavigationWindow)) as INavigationWindow)!; _navigationWindow!.ShowWindow(); _navigationWindow.Navigate(typeof(Views.Pages.DashboardPage)); win.DialogResult=true;
win.Close(); "登录成功".SnackbarShowInfo();
} catch (Exception ex) { ex.Message.SnackbarShowError(); }`
Expected behavior
After logging in to the callback, you can dynamically modify the theme normally
Screenshots
No response
OS version
win10
.NET version
net6
WPF-UI NuGet version
3.0.3
Additional context
No response
您好,刚入门WPF看到了WPFUI,登录窗体登录成功后,如何切换到主窗体? 目前是这样处理的: App.xaml.cs if (new Login().ShowDialog() == true) { new Layout().ShowDialog(); } if (Application.Current?.MainWindow?.Visibility == Visibility.Hidden) { return; } try { Application.Current?.Shutdown(); } catch (Exception ex) { Console.WriteLine($"Error: {ex.Message}"); } LoginViewModel.cs中 Application.Current.Dispatcher.Invoke(new Action(() => { (o as System.Windows.Window).DialogResult = true; })); 但是看demo是这样的: public Layout(LayoutViewModel viewModel, IPageService pageService, INavigationService navigationService) { DataContext = viewModel; Closing += LayoutWindowClose; InitializeComponent(); SetPageService(pageService); navigationService.SetNavigationControl(RootNavigation); } 不明白怎么调用?所以增加了一个: public Layout() { DataContext = new LayoutViewModel(); Closing += LayoutWindowClose; InitializeComponent(); }
Describe the bug
I created a login interface, after successful login, close and enter the main interface, after entering, change the style in the settings, it will cause the settings page to not be displayed, what is the reason?
To Reproduce
this is my code: ` try { var resp = await _accountService.CheckAccountAsync(UserName, Password, CheckCode); if (resp.Code != 1) throw new Exception("登录失败,请检查账户密码!"); var win = o as Window; _navigationWindow = ( _serviceProvider.GetService(typeof(INavigationWindow)) as INavigationWindow)!; _navigationWindow!.ShowWindow(); _navigationWindow.Navigate(typeof(Views.Pages.DashboardPage)); win.DialogResult=true;
win.Close(); "登录成功".SnackbarShowInfo();
} catch (Exception ex) { ex.Message.SnackbarShowError(); }`
Expected behavior
After logging in to the callback, you can dynamically modify the theme normally
Screenshots
No response
OS version
win10
.NET version
net6
WPF-UI NuGet version
3.0.3
Additional context
No response
您好,刚入门WPF看到了WPFUI,登录窗体登录成功后,如何切换到主窗体? 目前是这样处理的: App.xaml.cs if (new Login().ShowDialog() == true) { new Layout().ShowDialog(); } if (Application.Current?.MainWindow?.Visibility == Visibility.Hidden) { return; } try { Application.Current?.Shutdown(); } catch (Exception ex) { Console.WriteLine($"Error: {ex.Message}"); } LoginViewModel.cs中 Application.Current.Dispatcher.Invoke(new Action(() => { (o as System.Windows.Window).DialogResult = true; })); 但是看demo是这样的: public Layout(LayoutViewModel viewModel, IPageService pageService, INavigationService navigationService) { DataContext = viewModel; Closing += LayoutWindowClose; InitializeComponent(); SetPageService(pageService); navigationService.SetNavigationControl(RootNavigation); } 不明白怎么调用?所以增加了一个: public Layout() { DataContext = new LayoutViewModel(); Closing += LayoutWindowClose; InitializeComponent(); }
我目前是在MainWindow中做了个拦截,检测登录要求是否满足,不满足则去登录,满足则跳过登录界面
Describe the bug
I created a login interface, after successful login, close and enter the main interface, after entering, change the style in the settings, it will cause the settings page to not be displayed, what is the reason?
To Reproduce
this is my code: ` try { var resp = await _accountService.CheckAccountAsync(UserName, Password, CheckCode); if (resp.Code != 1) throw new Exception("登录失败,请检查账户密码!"); var win = o as Window; _navigationWindow = ( _serviceProvider.GetService(typeof(INavigationWindow)) as INavigationWindow)!; _navigationWindow!.ShowWindow(); _navigationWindow.Navigate(typeof(Views.Pages.DashboardPage)); win.DialogResult=true;
win.Close(); "登录成功".SnackbarShowInfo();
} catch (Exception ex) { ex.Message.SnackbarShowError(); }`
Expected behavior
After logging in to the callback, you can dynamically modify the theme normally
Screenshots
No response
OS version
win10
.NET version
net6
WPF-UI NuGet version
3.0.3
Additional context
No response
您好,刚入门WPF看到了WPFUI,登录窗体登录成功后,如何切换到主窗体? 目前是这样处理的: App.xaml.cs if (new Login().ShowDialog() == true) { new Layout().ShowDialog(); } if (Application.Current?.MainWindow?.Visibility == Visibility.Hidden) { return; } try { Application.Current?.Shutdown(); } catch (Exception ex) { Console.WriteLine($"Error: {ex.Message}"); } LoginViewModel.cs中 Application.Current.Dispatcher.Invoke(new Action(() => { (o as System.Windows.Window).DialogResult = true; })); 但是看demo是这样的: public Layout(LayoutViewModel viewModel, IPageService pageService, INavigationService navigationService) { DataContext = viewModel; Closing += LayoutWindowClose; InitializeComponent(); SetPageService(pageService); navigationService.SetNavigationControl(RootNavigation); } 不明白怎么调用?所以增加了一个: public Layout() { DataContext = new LayoutViewModel(); Closing += LayoutWindowClose; InitializeComponent(); }
我目前是在MainWindow中做了个拦截,检测登录要求是否满足,不满足则去登录,满足则跳过登录界面
And now in english again with whole sentences.