コード例 #1
0
ファイル: MainViewModel.cs プロジェクト: ctolk/EFAutoRefresh
 public MainViewModel()
 {
     if (App.Current != null)
     {
         _myObjectContext = App.Current.MyContext;
         Chat             = new AutoRefreshWrapper <Chat>(_myObjectContext.Chats, _myObjectContext, RefreshMode.StoreWins);
     }
 }
コード例 #2
0
        public PaymentsViewModel(IWindowManager windowManager)
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
                Payors = new AutoRefreshWrapper<Payor>(_esClinicContext.Payors, "Session", _esClinicContext, RefreshMode.StoreWins);
                _windowManager = windowManager;
            }

            

            Services = new BindableCollection<Service>();
            Drugs = new BindableCollection<Drug>();
            Surcharges = new BindableCollection<Surcharge>();

            var surchanges = _esClinicContext.Surcharges.ToList();
            foreach (var surchange in surchanges)
            {
                Surcharges.Add(surchange);
            }
        }
コード例 #3
0
        public PaymentsViewModel(IWindowManager windowManager)
        {
            if (App.Current != null)
            {
                _esClinicContext = App.Current.EsClinicContext;
                Payors           = new AutoRefreshWrapper <Payor>(_esClinicContext.Payors, "Session", _esClinicContext, RefreshMode.StoreWins);
                _windowManager   = windowManager;
            }



            Services   = new BindableCollection <Service>();
            Drugs      = new BindableCollection <Drug>();
            Surcharges = new BindableCollection <Surcharge>();

            var surchanges = _esClinicContext.Surcharges.ToList();

            foreach (var surchange in surchanges)
            {
                Surcharges.Add(surchange);
            }
        }