public void ChangeViewMode()
        {
            Model.Settings localSettings = Utils.SettingsUtil.Instance.GetSettings();

            if (localSettings.ViewMode == Model.ViewMode.LIST)
            {
                this.Width  = Window.Current.Bounds.Width - 30;
                this.Height = 315;
                this.Margin = new Thickness(2);
                for (int i = 0; i <= (ctrlListView.Items.Count - 1); i++)
                {
                    ItemContaUserControl itemUC = (ItemContaUserControl)ctrlListView.Items[i];
                    if (ctrlListView.Items.Count >= 1)
                    {
                        itemUC.ChangeViewMode();
                    }
                }
            }
            else
            {
                this.Width  = 440;
                this.Height = 315;
                this.Margin = new Thickness(2);
            }

            for (int i = 0; i <= (ctrlListView.Items.Count - 1); i++)
            {
                ItemContaUserControl itemUC = (ItemContaUserControl)ctrlListView.Items[i];
                if (ctrlListView.Items.Count >= 1)
                {
                    itemUC.ChangeViewMode();
                }
            }
        }
        public async Task <Boolean> updateStatusItem()
        {
            Boolean removeFromScreen = false;

            if (ctrlListView.SelectedIndex != -1)
            {
                ItemContaUserControl itemUC = (ItemContaUserControl)this.ctrlListView.SelectedItem;

                foreach (AccountItem itemContaData in this.contaData.Items)
                {
                    if (itemContaData.Id == itemUC.id)
                    {
                        itemContaData.StatusCode = await itemUC.UpdateStatusItem();

                        if (itemContaData.StatusCode == 2)
                        {
                            ctrlListView.Items.RemoveAt(ctrlListView.SelectedIndex);

                            if (ctrlListView.Items.Count != 0)
                            {
                                if (navIndexItem == 0)
                                {
                                    SelectItem();
                                }
                                else
                                {
                                    navIndexItem -= 1;
                                    SelectItem();
                                }
                            }
                        }
                    }
                }
            }

            int qtdFinalizados = 0;

            foreach (AccountItem itemContaData in this.contaData.Items)
            {
                if (itemContaData.StatusCode == 2)
                {
                    qtdFinalizados++;
                }
            }

            if (qtdFinalizados == this.contaData.Items.Count)
            {
                removeFromScreen = true;
            }

            return(removeFromScreen);
        }
 private void AddScreenItem()
 {
     foreach (AccountItem itemContaData in this.contaData.Items)
     {
         int visebleTimer = 0;
         visebleTimer = timerMaximo - itemContaData.PrepareTime * itemContaData.Quantity;
         if (visebleTimer == timerInicial)
         {
             ItemContaUserControl itemContaUC = new ItemContaUserControl(itemContaData, contaData);
             this.ctrlListView.Items.Add(itemContaUC);
         }
     }
 }
 private void ctrlListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     for (int i = 0; i <= (ctrlListView.Items.Count - 1); i++)
     {
         if (navIndexItem == i)
         {
             ItemContaUserControl itemUC = (ItemContaUserControl)this.ctrlListView.Items[i];
             itemUC.ColorItem();
         }
         else
         {
             ItemContaUserControl itemUC = (ItemContaUserControl)this.ctrlListView.Items[i];
             itemUC.DefaultColorItem(timerInicial);
         }
     }
 }
 public void ColorItem()
 {
     for (int i = 0; i <= ctrlListView.Items.Count; i++)
     {
         if (navIndexItem == ctrlListView.SelectedIndex)
         {
             ItemContaUserControl contaUCslc = (ItemContaUserControl)this.ctrlListView.Items[navIndexItem];
             contaUCslc.ColorItem();
             if (statusEnter == false)
             {
                 ItemContaUserControl contaUCslc1 = (ItemContaUserControl)this.ctrlListView.Items[navIndexItem];
                 contaUCslc1.DefaultColorItem(timerInicial);
             }
         }
     }
 }
        private void Timer_Tick(object sender, object e)
        {
            timerInicial++;
            seg++;
            if (seg == 60)
            {
                min++;
                seg = 0;
            }
            this.tbTimerScreen.Text = min.ToString().PadLeft(2, '0') + ":" + seg.ToString().PadLeft(2, '0');

            AddScreenItem();

            for (int i = 0; i <= contaData.Items.Count; i++)
            {
                if (ctrlListView.SelectedIndex != i)
                {
                    ItemContaUserControl itemUC = (ItemContaUserControl)this.ctrlListView.Items[i];
                    if (itemUC != null)
                    {
                        itemUC.DefaultColorItem(timerInicial);
                    }
                }
                else
                {
                    if (statusEnter == true)
                    {
                        ItemContaUserControl itemUC = (ItemContaUserControl)this.ctrlListView.Items[i];
                        itemUC.ColorItem();
                    }
                    else
                    {
                        ItemContaUserControl itemUC = (ItemContaUserControl)this.ctrlListView.Items[i];
                        itemUC.DefaultColorItem(timerInicial);
                    }
                }
            }
        }