Esempio n. 1
0
 public MainWindow()
 {
     InitializeComponent();
     //TODO: DI
     var workHandler = new AsyncWorkHandler();
     var dbContext = new DataContext("Server=.;Initial Catalog=Facebook;Integrated security=True;");
     DataContext = new MainViewModel(workHandler, dbContext);
 }
Esempio n. 2
0
 public MainViewModel(IWorkHandler workHandler, DataContext dbContext)
 {
     _workHandler = workHandler;
     _dbContext = dbContext;
     GetDataCommand = new DelegateCommand(ExecuteGetDataCommand);
     SaveDataCommand = new DelegateCommand(ExecuteSaveDataCommand);
     Posts = new ObservableCollection<PostViewModel>();
 }