| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using Caliburn.Micro;
- using friaLabbar.Models;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- namespace friaLabbar.ViewModels
- {
- public class SkalViewModel : PropertyChangedBase
- {
- string name;
- public string Name
- {
- get { return name; }
- set
- {
- name = value;
- NotifyOfPropertyChange(() => Name);
- NotifyOfPropertyChange(() => CanSayHello);
- }
- }
- public bool CanSayHello
- {
- get { return !string.IsNullOrWhiteSpace(Name); }
- }
- public BindableCollection<int> AFewNumbers { get; set; }
- public BindableCollection<PersonModel> AFewPeople { get; set; }
- public SkalViewModel()
- {
- RandomPersonGenerator pg = new RandomPersonGenerator();
- AFewNumbers = new BindableCollection<int>(new List<int> { 1, 3, 3, 7, 58, 48, 690 });
- AFewPeople= new BindableCollection<PersonModel>(pg.GetPeople());
- }
- public void SayHello()
- {
- MessageBox.Show(string.Format("Hello {0}!", Name)); //Don't do this in real life :)
- AFewNumbers[2] = 15981;
- }
- }
- }
|