-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSchedulingViewModel.cs
More file actions
32 lines (30 loc) · 1.07 KB
/
SchedulingViewModel.cs
File metadata and controls
32 lines (30 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.ObjectModel;
using System.Data.Entity;
using System.Windows.Input;
using DevExpress.Mvvm;
using DXSample.Data;
namespace DXSample.ViewModels {
public class SchedulingViewModel : ViewModelBase {
SchedulingContext context;
public ObservableCollection<AppointmentEntity> Appts { get { return context.Appointments.Local; } }
public ObservableCollection<ResourceEntity> Calendars { get { return context.Resources.Local; } }
public string Status {
get { return GetValue<string>(); }
set { SetValue(value); }
}
public SchedulingViewModel() {
context = new SchedulingContext();
context.Appointments.Load();
context.Resources.Load();
}
public ICommand SaveCommand {
get {
return new DelegateCommand(() => {
context.SaveChanges();
Status = $"Changes are saved to database. {DateTime.Now.ToLongTimeString()}.";
});
}
}
}
}