|
@@ -774,7 +774,7 @@ namespace PDF_Master.Helper
|
|
|
for (int i = 0; i < App.Current.Windows.Count; i++)
|
|
|
{
|
|
|
MainWindow win = App.Current.Windows[i] as MainWindow;
|
|
|
- if (win != null)
|
|
|
+ if (win != null && win.DataContext != null)
|
|
|
{
|
|
|
(win.DataContext as MainWindowViewModel).UserVis = Visibility.Visible;
|
|
|
(win.DataContext as MainWindowViewModel).LoginVis = Visibility.Collapsed;
|
|
@@ -845,7 +845,7 @@ namespace PDF_Master.Helper
|
|
|
for (int i = 0; i < App.Current.Windows.Count; i++)
|
|
|
{
|
|
|
MainWindow win = App.Current.Windows[i] as MainWindow;
|
|
|
- if (win != null)
|
|
|
+ if (win != null && win.DataContext != null)
|
|
|
{
|
|
|
(win.DataContext as MainWindowViewModel).UserVis = Visibility.Visible;
|
|
|
(win.DataContext as MainWindowViewModel).LoginVis = Visibility.Collapsed;
|
|
@@ -907,7 +907,7 @@ namespace PDF_Master.Helper
|
|
|
for (int i = 0; i < App.Current.Windows.Count; i++)
|
|
|
{
|
|
|
MainWindow win = App.Current.Windows[i] as MainWindow;
|
|
|
- if (win != null)
|
|
|
+ if (win != null && win.DataContext != null)
|
|
|
{
|
|
|
(win.DataContext as MainWindowViewModel).UserVis = Visibility.Collapsed;
|
|
|
(win.DataContext as MainWindowViewModel).LoginVis = Visibility.Visible;
|
|
@@ -968,7 +968,7 @@ namespace PDF_Master.Helper
|
|
|
for (int i = 0; i < App.Current.Windows.Count; i++)
|
|
|
{
|
|
|
MainWindow win = App.Current.Windows[i] as MainWindow;
|
|
|
- if (win != null)
|
|
|
+ if (win != null && win.DataContext != null)
|
|
|
{
|
|
|
(win.DataContext as MainWindowViewModel).UserVis = Visibility.Collapsed;
|
|
|
(win.DataContext as MainWindowViewModel).LoginVis = Visibility.Visible;
|
|
@@ -1111,6 +1111,25 @@ namespace PDF_Master.Helper
|
|
|
Console.WriteLine(responseData);
|
|
|
reader.Close();
|
|
|
JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
|
|
|
+ App.IsLogin = false;
|
|
|
+ Settings.Default.UserDate.subscribestatus = -1;
|
|
|
+ Settings.Default.UserDate.subscribepayType = 0;
|
|
|
+ App.mainWindowViewModel.UpgradeVis = Visibility.Visible;
|
|
|
+ if(App.Current.Windows!=null&&App.Current.Windows.Count!=0)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < App.Current.Windows.Count; i++)
|
|
|
+ {
|
|
|
+ MainWindow win = App.Current.Windows[i] as MainWindow;
|
|
|
+ if (win != null&& win.DataContext!=null)
|
|
|
+ {
|
|
|
+ (win.DataContext as MainWindowViewModel).UserVis = Visibility.Collapsed;
|
|
|
+ (win.DataContext as MainWindowViewModel).LoginVis = Visibility.Visible;
|
|
|
+ (win.DataContext as MainWindowViewModel).RegisterVis = Visibility.Collapsed;
|
|
|
+ (win.DataContext as MainWindowViewModel).UpgradeVis = Visibility.Visible;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (response != null)
|
|
|
{
|
|
|
response.Close();
|