Пример #1
0
 public PageNavigatorViewModel()
 {
     this.okCommand = new RelayCommand(NavigateToCurrentPage, CanNavigateToCurrentPage);
     this.incrementCommand = new RelayCommand(IncrementCurrentValue, CanIncrementCurrentValue);
     this.decrementCommand = new RelayCommand(DecrementCurrentValue, CanDecrementCurrentValue);
     this.firstCommand = new RelayCommand(SetCurrentValueToFirst);
     this.lastCommand = new RelayCommand(SetCurrentValueToLast);
 }
Пример #2
0
 public AwfulViewPageNavigator(object view, IProgress<string> progress, int startValue = 0, int maxValue = 0)
 {
     this.view = view;
     this.value = startValue;
     this.maxValue = maxValue;
     this.progress = progress;
     this.firstPageCommand = new RelayCommand(SetValueAsFirstPage, IsEnabled);
     this.lastPageCommand = new RelayCommand(SetValueAsLastPage, IsEnabled);
     this.incrementPageCommand = new RelayCommand(IncrementValue, IsEnabled);
     this.decrementPageCommand = new RelayCommand(DecrementValue, IsEnabled);
     this.okCommand = new RelayCommand(OnNavConfirm, IsEnabled);
 }
Пример #3
0
        public PrivateMessages()
        {
            InitializeComponent();
            context = new PrivateMessagesViewModel();

            sync = new RelayCommand(OnSync, CanSync);
            context.SyncCommand = sync;

            showFolders = new RelayCommand(ShowAllFolders);
            context.ShowFoldersCommand = showFolders;

            showCurrent = new RelayCommand(ShowCurrentFolderView);
            context.ShowCurrentFolderCommand = showCurrent;

            this.DataContext = context;
            isNewInstance = true;
        }
Пример #4
0
        public ClassicPageViewModel(ClassicPage page, 
            ObservableDictionary defaultViewModel, 
            IProgress<string> progress)
        {
            this.page = page;
            this.pageViewModel = defaultViewModel;
            this.progress = progress;
            this.pageNav = new AwfulViewPageNavigator(page, progress);
            this.IsListActive = true;

            nextCommand = new RelayCommand(GoToNextPage, CanGoToNextPage);
            prevCommand = new RelayCommand(GoToPrevPage, CanGoToPrevPage);
            refreshCommand = new RelayCommand(RefreshContent, CanRefreshContent);
            bookmarkCommand = new RelayCommand(BookmarkContent, CanBookmarkContent);
            goUpCommand = new RelayCommand(GoUp, CanGoUp);

            this.threads.CollectionChanged += (o, a) => { OnPropertyChanged("EnableTabs"); };

            pageViewModel["Context"] = this;
            pageViewModel["Threads"] = this.threads;
            pageViewModel["PageNav"] = this.pageNav;
            pageViewModel["NextCommand"] = this.nextCommand;
            pageViewModel["PrevCommand"] = this.prevCommand;
            pageViewModel["RefreshCommand"] = this.refreshCommand;
            pageViewModel["BookmarkCommand"] = this.bookmarkCommand;
            pageViewModel["GoUpCommand"] = this.goUpCommand;            
        }
Пример #5
0
 private ReplyPageViewModel()
 {
     uploadCommand = new RelayCommand(UploadImageAsync);
     clearTextCommand = new RelayCommand(ClearText);
 }
Пример #6
0
        /// <summary>
        /// Creates a new SignInDataModel instance.
        /// </summary>
        /// <param name="success">callback on sign in success.</param>
        /// <param name="fail">callback on sign in failure.</param>
        public SignInDataModel(
            UserDataContext context,
            SignInSuccessDelegate success, 
            FailureDelegate fail)
        {
            if (success == null || fail == null)
                throw new ArgumentNullException("success | fail");

            this.userContext = context;
            this.onSuccess = success;
            this.onFail = fail;
            this.signInCommand = new RelayCommand(async () => { await SignInAsync(); }, CanSignIn);
        }