Explorar o código

比较表跳转更新

lvle %!s(int64=2) %!d(string=hai) anos
pai
achega
e7166e3e38

+ 1 - 1
PDF Office/App.xaml.cs

@@ -114,7 +114,7 @@ namespace PDF_Office
         /// <summary>
         /// 是否已经登陆
         /// </summary>
-        public static bool IsLogin = true;
+        public static bool IsLogin =false;
 
         //是否需要显示注册弹窗
         //app第一次启动时需要弹出注册弹窗

+ 51 - 5
PDF Office/ViewModels/Dialog/ServiceDialog/IAPCompareDialogViewModel.cs

@@ -1,19 +1,29 @@
-using Prism.Mvvm;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
 using Prism.Services.Dialogs;
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace PDF_Office.ViewModels.Dialog.ServiceDialog
 {
     public class IAPCompareDialogViewModel : BindableBase,IDialogAware
     {
+        
+       
+
         public string Title => "";
 
         public event Action<IDialogResult> RequestClose;
 
+
+
+        private string _IAPRegionName;
+        public string IAPRegionName
+        {
+            get { return _IAPRegionName; }
+            set { _IAPRegionName = value; }
+        }
+
         public bool CanCloseDialog()
         {
             return true;
@@ -26,6 +36,42 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
 
         public void OnDialogOpened(IDialogParameters parameters)
         {
+            
+        }
+
+        public DelegateCommand GoLoginCommand { get; set; }
+        public DelegateCommand GoRegisterCommand { get; set; }
+
+
+
+        IAPCompareDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
+        {
+           
+            IAPRegionName = Guid.NewGuid().ToString();
+            GoLoginCommand = new DelegateCommand(GoLogin);
+            GoRegisterCommand = new DelegateCommand(GoRegisterd);
+        }
+
+
+        private void GoRegisterd()
+        {
+
+            RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
+            App.mainWindowViewModel.OpenLogin();
+        }
+
+
+        private void GoLogin()
+        {
+
+
+            RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
+            App.mainWindowViewModel.OpenRegister();
+
         }
+
+
+
+      
     }
 }

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 44 - 2
PDF Office/Views/Dialog/ServiceDialog/IAPCompareDialog.xaml


+ 9 - 2
PDF Office/Views/Dialog/ServiceDialog/IAPCompareDialog.xaml.cs

@@ -1,4 +1,6 @@
-using System;
+using Prism.Ioc;
+using Prism.Regions;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -20,9 +22,14 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
     /// </summary>
     public partial class IAPCompareDialog : UserControl
     {
-        public IAPCompareDialog()
+        private IContainerProvider containerProvider;
+        public IAPCompareDialog(IContainerProvider containerProvider)
         {
             InitializeComponent();
+            this.containerProvider = containerProvider;
+            var regionManager = containerProvider.Resolve<IRegionManager>();
+            RegionManager.SetRegionManager(this, regionManager);
+            RegionManager.UpdateRegions();
         }
     }
 }