public SyncStatusPageViewModel(IResourceLoader resourceLoader, DialogService dialogService)
        {
            ToastNotificationManager.History.RemoveGroup(ToastNotificationService.SyncAction);
            ToastNotificationManager.History.RemoveGroup(ToastNotificationService.SyncConflictAction);
            _resourceLoader = resourceLoader;
            _dialogService  = dialogService;

            FixConflictByLocalCommand    = new RelayCommand(FixConflictByLocal, CanExecuteFixConflict);
            FixConflictByRemoteCommand   = new RelayCommand(FixConflictByRemote, CanExecuteFixConflict);
            FixConflictByKeepAsIsCommand = new RelayCommand(FixConflictByKeepAsIs, CanExecuteFixConflict);
            ClearSyncHistoryCommand      = new RelayCommand(ClearSyncHistory);
            CheckAllCommand   = new RelayCommand(CheckAll);
            UncheckAllCommand = new RelayCommand(UncheckAll);

            SyncHistoryList = new ObservableCollection <SyncHistory>();
            ConflictList    = new ObservableCollection <SyncInfoDetail>();
            ErrorList       = new ObservableCollection <SyncInfoDetail>();
            FolderSyncList  = new ObservableCollection <FolderSyncInfo>();

            var history = SyncDbUtils.GetSyncHistory();

            history.ForEach(x => SyncHistoryList.Add(x));

            var conflicts = SyncDbUtils.GetConflicts();

            conflicts.ForEach(x => ConflictList.Add(x));

            var errors = SyncDbUtils.GetErrors();

            errors.ForEach(x => ErrorList.Add(x));
            var fsis = SyncDbUtils.GetAllFolderSyncInfos();

            fsis.ForEach(x => FolderSyncList.Add(x));
        }
Exemplo n.º 2
0
        public SyncStatusPageViewModel(INavigationService navigationService, IResourceLoader resourceLoader, DialogService dialogService)
        {
            ToastNotificationManager.History.RemoveGroup(ToastNotificationService.SYNCACTION);
            ToastNotificationManager.History.RemoveGroup(ToastNotificationService.SYNCONFLICTACTION);
            _navigationService = navigationService;
            _resourceLoader    = resourceLoader;
            _dialogService     = dialogService;

            FixConflictByLocalCommand  = new RelayCommand(FixConflictByLocal, CanExecuteFixConflict);
            FixConflictByRemoteCommand = new RelayCommand(FixConflictByRemote, CanExecuteFixConflict);
            ClearSyncHistoryCommand    = new RelayCommand(ClearSyncHistory);

            SyncHistoryList = new ObservableCollection <SyncHistory>();
            ConflictList    = new ObservableCollection <SyncInfoDetail>();
            ErrorList       = new ObservableCollection <SyncInfoDetail>();
            FolderSyncList  = new ObservableCollection <FolderSyncInfo>();

            List <SyncHistory> history = SyncDbUtils.GetSyncHistory();

            history.ForEach(x => SyncHistoryList.Add(x));

            List <SyncInfoDetail> conflicts = SyncDbUtils.GetConflicts();

            conflicts.ForEach(x => ConflictList.Add(x));

            List <SyncInfoDetail> errors = SyncDbUtils.GetErrors();

            errors.ForEach(x => ErrorList.Add(x));
            List <FolderSyncInfo> fsis = SyncDbUtils.GetAllFolderSyncInfos();

            fsis.ForEach(x => FolderSyncList.Add(x));
        }