/// <summary>
        /// Obtains Weight objects from HealthVault
        /// </summary>
        /// <returns></returns>
        public override async Task Initialize(NavigationParams navParams)
        {
            //Save the connection so that we can reuse it for updates later
            _connection = navParams.Connection;

            HealthRecordInfo recordInfo  = (await _connection.GetPersonInfoAsync()).SelectedRecord;
            IThingClient     thingClient = _connection.CreateThingClient();

            if (QueryTimeframe.SelectedIndex == (int)QueryTimeframeEnum.Default)
            {
                //Uses a simple query which specifies the Thing type as the only filter
                Items = await thingClient.GetThingsAsync <Weight>(recordInfo.Id);
            }
            else if (QueryTimeframe.SelectedIndex == (int)QueryTimeframeEnum.Last30d)
            {
                //In this mode, the app specifies a ThingQuery which can be used for functions like
                //filtering, or paging through values
                ThingQuery query = new ThingQuery()
                {
                    EffectiveDateMin = DateTime.Now.AddDays(-30)
                };

                Items = await thingClient.GetThingsAsync <Weight>(recordInfo.Id, query);
            }

            OnPropertyChanged("Items");
            OnPropertyChanged("Latest");

            return;
        }
Esempio n. 2
0
        public override async Task Initialize(NavigationParams navParams)
        {
            _connection = navParams.Connection as IHealthVaultConnection;
            Context     = navParams.Context as ActionPlanInstanceV2;

            OnPropertyChanged("Context");
        }
Esempio n. 3
0
        private void Edit_Click(object sender, RoutedEventArgs e)
        {
            var navParams = new NavigationParams()
            {
                Connection = _connection,
                Context    = Item
            };

            Frame.Navigate(typeof(EditMedication), navParams);
        }
        private void ListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            NavigationParams navParams = new NavigationParams()
            {
                Connection = _connection,
                Context    = e.ClickedItem
            };

            Frame.Navigate(typeof(MedicationDetailsPage), navParams);
        }
Esempio n. 5
0
        /// <summary>
        /// Retrieves the data model for this page.
        /// </summary>
        /// <returns></returns>
        public override async Task Initialize(NavigationParams navParams)
        {
            //Save the connection so we can make updates later.
            _connection = navParams.Connection;

            HealthRecordInfo recordInfo  = (await _connection.GetPersonInfoAsync()).SelectedRecord;
            IThingClient     thingClient = _connection.CreateThingClient();

            GetProfileAsync(recordInfo, thingClient);

            GetPersonalImageAsync(recordInfo, thingClient);

            return;
        }
        public override async Task Initialize(NavigationParams navParams)
        {
            HealthRecordInfo recordInfo  = (await navParams.Connection.GetPersonInfoAsync()).SelectedRecord;
            IThingClient     thingClient = navParams.Connection.CreateThingClient();

            var query = new ThingQuery(new Guid[] { BloodGlucose.TypeId, Weight.TypeId, BloodPressure.TypeId, CholesterolProfile.TypeId,
                                                    LabTestResults.TypeId, Immunization.TypeId, Procedure.TypeId, Allergy.TypeId, Condition.TypeId });

            var items = await thingClient.GetThingsAsync(recordInfo.Id, query);

            //Create a grouped view of the Things by type
            Groups = from colItem in items
                     orderby(colItem as ThingBase).TypeName, (colItem as ThingBase).EffectiveDate descending
            group colItem by(colItem as ThingBase).TypeName into newGroup
            select newGroup;

            OnPropertyChanged("Groups");
        }
Esempio n. 7
0
        public override async Task Initialize(NavigationParams navParams)
        {
            _connection = navParams.Connection;
            HealthRecordInfo recordInfo  = (await _connection.GetPersonInfoAsync()).SelectedRecord;
            IThingClient     thingClient = _connection.CreateThingClient();

            //Set person name for UX
            PersonName = recordInfo.Name;
            OnPropertyChanged("PersonName");

            //Configure navigation frame for the app
            ContentFrame.Navigated += ContentFrame_Navigated;
            SystemNavigationManager.GetForCurrentView().BackRequested += HubPage_BackRequested;

            ContentFrame.Navigate(typeof(NavigationPage), new NavigationParams()
            {
                Connection = _connection
            });
        }
        public override async Task Initialize(NavigationParams navParams)
        {
            _connection = navParams.Connection;

            HealthRecordInfo recordInfo  = (await _connection.GetPersonInfoAsync()).SelectedRecord;
            IThingClient     thingClient = _connection.CreateThingClient();

            var items = await thingClient.GetThingsAsync <Medication>(recordInfo.Id);

            ResourceLoader loader = new ResourceLoader();

            // Use LINQ to group the medications into current and past groups based on the DateDiscontinued
            Groups = from item in items
                     group item by(item.DateDiscontinued == null?loader.GetString("CurrentMedications") : loader.GetString("PastMedications")) into g
                     select g;

            OnPropertyChanged("Groups");

            return;
        }
        public override async Task Initialize(NavigationParams navParams)
        {
            _connection = navParams.Connection;

            Guid recordId   = (await _connection.GetPersonInfoAsync()).SelectedRecord.Id;
            var  restClient = _connection.CreateMicrosoftHealthVaultRestApi(recordId);

            try
            {
                var response = await restClient.GetActionPlansAsync();

                //Filter to only recommended or InProgress plans
                Plans = from p in response.Plans
                        where p.Status == "Recommended" || p.Status == "InProgress"
                        select p;

                OnPropertyChanged("Plans");
            }
            catch (Microsoft.Rest.RestException e)
            {
                MessageDialog md = new MessageDialog(e.Message);
                await md.ShowAsync();
            }
        }
Esempio n. 10
0
 public abstract Task Initialize(NavigationParams navParams);
Esempio n. 11
0
 public void Init(NavigationParams navigation)
 {
     _arduinoStationID = navigation.id;
     init();
 }
Esempio n. 12
0
 private void LitePage_Retrieved(object sender, NavigationParams e)
 {
     Title = $"{e.Get(1, Title)} {(e.Id == NavigationParams.DEFAULT_ID ? "<-" : "->")} {e.Id}R";
 }
Esempio n. 13
0
 private void LitePage_Created(object sender, NavigationParams e)
 {
     Title = $"{e.Get(1, "X")} -> {e.Id}C";
 }
Esempio n. 14
0
 private bool NavigateByParams(NavigationParams input)
 {
     return(rootFrame.Navigate(input.PageType, input.Parameter));
 }