Exemplo n.º 1
0
 public M0400_DetailsViewModel(INavigation navigation, Nailpod nailpod) : this(navigation)
 {
     Nailpod             = nailpod;
     Title               = $"#{Nailpod.MachineId} Details";
     GetPaymentCommand   = new Command(async() => await GetPaymentAsync());
     GetErrorInfoCommand = new Command(async() => await GetErrorInfoAsync());
 }
Exemplo n.º 2
0
        async Task GetNailpodsAsync()
        {
            if (IsBusy)
            {
                return;
            }

            try
            {
                IsBusy = true;

                var json = await Client.GetStringAsync(Host + SelectMaster);

                var nailpods = Nailpod.FromJson(json);

                //Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                //() =>
                //    {
                //        Nailpods.Clear();
                //        foreach (var nailpod in nailpods)
                //            Nailpods.Add(nailpod);
                //    }
                //);
                Nailpods.Clear();
                foreach (var nailpod in nailpods)
                {
                    Nailpods.Add(nailpod);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine($"Unable to get nailpods: {ex.Message}");
                await Application.Current.MainPage.DisplayAlert("Error!", ex.Message, "OK");
            }
            finally
            {
                IsBusy = false;
            }
        }
Exemplo n.º 3
0
 public M0400_DetailsPage(Nailpod nailpod)
 {
     InitializeComponent();
     BindingContext = new M0400_DetailsViewModel(Navigation, nailpod);
 }