Beispiel #1
0
        public MainPresenter(IMainView view, UserProfile user)
        {
            this.view = view;

            this.user       = user;
            this.navigation = new LocalNavigation();

            this.view.UrlSentEvent     += this.UrlQueriedEventHandlerAsync;
            this.view.ReloadAskedEvent += this.ReloadAskedEventHandler;
            this.view.HomeAskedEvent   += this.HomeAskedEventHandler;

            this.view.RemoveFavEvent   += this.RemoveFavEventHandler;
            this.view.WipeHistoryEvent += this.WipeHistoryEventHandler;

            this.view.BackwardAskedEvent += this.BackwardAskedEventHandlerAsync;
            this.view.ForwardAskedEvent  += this.ForwardAskedEventHandlerAsync;

            if (this.user.HomePage != null)
            {
                this.HomeAskedEventHandler(this, EventArgs.Empty);
            }
            this.view.UpdateHomeUrl(this.user.HomePage != null);

            this.view.ViewClosedEvent += (s, e) => this.ViewClosedEvent(this, EventArgs.Empty);

            this.view.HomeUrlInputAskedEvent   += (s, e) => this.HomeUrlInputAskedEvent(this, EventArgs.Empty);
            this.view.HistoryPanelAskedEvent   += (s, e) => this.HistoryPanelAskedEvent(this, EventArgs.Empty);
            this.view.FavoritesPanelAskedEvent += (s, e) => this.FavoritesPanelAskedEvent(this, EventArgs.Empty);
            this.view.FavInputAskedEvent       += (s, e) => this.FavInputAskedEvent(this, new FavInputAskedEventArgs(e, this.navigation.Current.Title));
        }
Beispiel #2
0
 public DetailViewModel()
 {
     navigation = new LocalNavigation();
     if (NoteData.SelectedNote != null)
     {
         isEdit = true;
         Header = NoteData.SelectedNote.Name;
         MyNote = NoteData.SelectedNote.Notes;
     }
 }
Beispiel #3
0
 public MainViewModel()
 {
     if (navigation == null)
     {
         navigation = new LocalNavigation();
     }
     if (notes == null)
     {
         notes = new ObservableCollection <Note>();
     }
     if (searchString == null)
     {
         SearchString = "";
     }
 }
Beispiel #4
0
 public SettingsViewModel()
 {
     navigation = new LocalNavigation();
     MaxNotes   = NoteData.Max_Notes;
 }