Exemplo n.º 1
0
        public async Task LoadIndicators()
        {
            if (IsEditMode)
            {
                return;
            }

            try
            {
                List <Indicator> list = await NAV.GetIndicatorsByZone(LocationCode, Code, ACD.Default).ConfigureAwait(true);

                if (NotDisposed)
                {
                    ObservableCollection <IndicatorViewModel> nlist = new ObservableCollection <IndicatorViewModel>();
                    foreach (Indicator indicator in list)
                    {
                        IndicatorViewModel ivm = new IndicatorViewModel(Navigation, indicator);
                        ivm.LocationCode = LocationCode;
                        ivm.ZoneCode     = Code;
                        nlist.Add(ivm);
                    }
                    Indicators = nlist;
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                ErrorText = e.Message;
            }
        }
 /// <summary>
 /// Press Indicator
 /// </summary>
 /// <param name="obj"></param>
 private async void Ivm_OnTap(IndicatorViewModel obj)
 {
     if (obj.ID != "")
     {
         IndicatorPage zsp = new IndicatorPage(obj);
         await Navigation.PushAsync(zsp);
     }
 }