Exemple #1
0
        public MainViewModel()
        {
            // saveQuotes = save;

            quoteManager = QuoteManager.Instance;
            Quotes       = quoteManager.Quotes as ObservableCollection <GreatQuoteViewModel>;
        }
        public MainViewModel()
        {
            Quotes = new ObservableCollection <QuoteViewModel>(QuoteManager.Load()
                                                               .Select(q => new QuoteViewModel(q)));

            SelectedQuote = Quotes.FirstOrDefault();
        }
Exemple #3
0
        public MainViewModel()
        {
            Quotes = new ObservableCollection <QuoteViewModel>(
                QuoteManager.Load()
                .Select(q => new QuoteViewModel(q)));

            SelectedQuote = Quotes.FirstOrDefault();

            AddQuote = new Command(async() => await OnAddQuote());
        }
Exemple #4
0
        public MainViewModel()
        {
            Quotes = new ObservableCollection <QuoteViewModel>(QuoteManager.Load()
                                                               .Select(q => new QuoteViewModel(q)));

            SelectedQuote   = Quotes.FirstOrDefault();
            AddQuote        = new Command(async() => await OnAddQuote());
            DeleteQuote     = new Command <QuoteViewModel>(async vm => await OnDeleteQuote(vm));
            EditQuote       = new Command <QuoteViewModel>(async vm => await OnEditQuote(vm));
            ShowQuoteDetail = new Command <QuoteViewModel>(async vm => await OnShowQuoteDetails(vm));
        }
        public MainViewModel(IDependencyService serviceLocator)
        {
            this.serviceLocator = serviceLocator;

            Quotes = new ObservableCollection <QuoteViewModel>(QuoteManager.Load(serviceLocator.Get <IQuoteLoader>())
                                                               .Select(q => new QuoteViewModel(q)));

            SelectedQuote = Quotes.FirstOrDefault();

            AddQuote        = new AsyncDelegateCommand(OnAddQuote);
            DeleteQuote     = new AsyncDelegateCommand <QuoteViewModel>(OnDeleteQuote);
            EditQuote       = new AsyncDelegateCommand <QuoteViewModel>(OnEditQuote);
            ShowQuoteDetail = new AsyncDelegateCommand <QuoteViewModel>(OnShowQuoteDetails);
        }
Exemple #6
0
 public MainViewModel()
 {
     Quotes = new ObservableCollection <QuoteViewModel>(
         QuoteManager.Load()
         .Select(q => new QuoteViewModel(q)));
 }
Exemple #7
0
 public MainViewModel()
 {
     quoteManager = QuoteManager.Instance;
     Quotes       = new ObservableCollection <GreatQuoteViewModel>(quoteManager.Quotes);
 }
Exemple #8
0
 public MainViewModel(object p)
 {
     quoteManager = QuoteManager.Instance;
     Quotes       = quoteManager.Quotes as ObservableCollection <GreatQuoteViewModel>;
 }