public App() { InitializeComponent(); ModelInfo = new SignInfoModel(); MainPage = new NavigationPage(new SignIn()); }
public AboutPage() { InitializeComponent(); /** Because the viewmodel class is instantiated once in the App class, it maintains * the information for the duration of the application. Each new instance of the classes * can then simply access the properties and set the viewmodel object to its BindingContext. */ SignInfoModel modelInfo = ((App)Application.Current).ModelInfo; BindingContext = modelInfo; }
public SignIn() { InitializeComponent(); switch (Device.RuntimePlatform) { case Device.iOS: Padding = new Thickness(0, 20, 0, 0); break; case Device.Android: Padding = new Thickness(0, 20, 0, 0); break; case Device.WinPhone: Padding = new Thickness(0, 20, 0, 0); break; default: Padding = new Thickness(0, 20, 0, 0); break; } EntryId.Text = ""; EntryPassword.Text = ""; /** Because the viewmodel class is instantiated once in the App class, it maintains * the information for the duration of the application. Each new instance of the classes * can then simply access the properties and set the viewmodel object to its BindingContext. */ SignInfoModel signModel = ((App)Application.Current).ModelInfo; BindingContext = signModel; /** Unfortunately, the picker items property is not backed by a bindable property and hence, it is not bindable * populate picker items list */ foreach (var departments in Info.Departments) { PickerDepartment.Items.Add(departments); } }
/// <summary> /// 刷新患者的体征数据 /// </summary> private void RefreshVitalSignList() { try { // 获取手术患者的实时体征数据 this.Signinfolist = null; if (null != this.CurPatientModel) { // 获取患者的体征数据 List <MED_VITAL_SIGN> vitalSignList = AnesInfoService.ClientInstance.GetVitalSignData(this.CurPatientModel.PatientID, this.CurPatientModel.VisitID, this.CurPatientModel.OperID, "0", false); // 仅显示脉搏:44, 呼吸:92, 血压High:89, 血压Low:90 , 温度:100 IEnumerable <MED_VITAL_SIGN> tempList = vitalSignList.Where <MED_VITAL_SIGN>(x => x.ITEM_CODE.Equals("44") || x.ITEM_CODE.Equals("92") || x.ITEM_CODE.Equals("89") || x.ITEM_CODE.Equals("90") || x.ITEM_CODE.Equals("100")); // 仅显示最新时间的体征 IEnumerable <DateTime> timePointList = tempList.Select(a => a.TIME_POINT); if (null != timePointList && timePointList.Count() > 0) { DateTime maxDateTime = tempList.Select(a => a.TIME_POINT).Max(); tempList = tempList.Where <MED_VITAL_SIGN>(x => x.TIME_POINT.Equals(maxDateTime)); this.Signinfolist = new ObservableCollection <SignInfoModel>(SignInfoModel.CreateListModel(tempList)); } } } catch (Exception ex) { Logger.Error("获取正在手术患者的最新体征异常:", ex); // this.ShowMessageBox("获取正在手术患者的最新体征异常!", MessageBoxButton.OK, MessageBoxImage.Error); } }