wpfui icon indicating copy to clipboard operation
wpfui copied to clipboard

The settings page can't be displayed, and the program is faked

Open wch66 opened this issue 10 months ago • 5 comments

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

wch66 avatar Mar 27 '24 03:03 wch66

Manually closing the login interface does not affect usage. The program is closed and cannot be used normally

wch66 avatar Mar 27 '24 03:03 wch66

Have you solved it? Can we discuss something on WeChat?

Acratons avatar Apr 17 '24 07:04 Acratons

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(); }

tenglongwentian avatar Jun 24 '24 07:06 tenglongwentian

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中做了个拦截,检测登录要求是否满足,不满足则去登录,满足则跳过登录界面

wch66 avatar Jun 24 '24 07:06 wch66

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.

m0lDaViA avatar Jun 26 '24 17:06 m0lDaViA