Exemple #1
0
        public void EditTemplate(object sender)
        {
            BinTemplateViewModel btvm = (BinTemplateViewModel)sender;

            btvm.CreateMode = false;
            NewBinTemplatePage nbtp = new NewBinTemplatePage(btvm);
        }
Exemple #2
0
        public async Task Load()
        {
            if (NotNetOrConnection)
            {
                return;
            }

            try
            {
                State = ModelState.Loading;
                List <BinTemplate> bintemplates = await NAV.GetBinTemplateList(1, int.MaxValue, ACD.Default);

                if ((!IsDisposed) && (bintemplates is List <BinTemplate>))
                {
                    BinTemplates.Clear();
                    foreach (BinTemplate bt in bintemplates)
                    {
                        BinTemplateViewModel btvm = new BinTemplateViewModel(Navigation, bt);
                        BinTemplates.Add(btvm);
                    }
                    State = ModelState.Normal;
                }
            }
            catch (OperationCanceledException e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                ErrorText = e.Message;
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                State     = ModelState.Error;
                ErrorText = AppResources.Error_LoadBinTemplates;
            }
        }
Exemple #3
0
        public async Task DeleteTemplate(object sender)
        {
            if (NotNetOrConnection)
            {
                return;
            }

            try
            {
                BinTemplateViewModel btvm = (BinTemplateViewModel)sender;
                State = ModelState.Loading;
                await NAV.DeleteBinTemplate(btvm.BinTemplate, ACD.Default).ConfigureAwait(true);

                if (!IsDisposed)
                {
                    BinTemplates.Remove(btvm);
                    SelectedTemplate = null;
                    State            = ModelState.Normal;
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                State     = ModelState.Error;
                ErrorText = e.Message;
            }
        }
Exemple #4
0
 public async Task NewTemplate()
 {
     BinTemplate          newbt = new BinTemplate();
     BinTemplateViewModel btvm  = new BinTemplateViewModel(Navigation, newbt)
     {
         CreateMode = true
     };
     NewBinTemplatePage nbtp = new NewBinTemplatePage(btvm);
     await Navigation.PushAsync(nbtp);
 }