Ejemplo n.º 1
0
        private void BoxFundo_Tap(object e)
        {
            try
            {
                StackLayout           boxFundo   = (StackLayout)e;
                GraficoDto            graficoDto = (GraficoDto)boxFundo.BindingContext;
                ViewModelBaseListPage detalhes   = (ViewModelBaseListPage)this.BindingContext;

                if (boxFundo.BackgroundColor == _colorPanelDesativado)
                {
                    DesativarPanel();

                    boxFundo.BackgroundColor = Color.FromHex(graficoDto.corFundo);

                    detalhes.StatusFiltro = graficoDto.Status;

                    detalhes.Buscar();
                }
                else
                {
                    DesativarPanel();

                    detalhes.StatusFiltro = null;

                    detalhes.Buscar();
                }
            }
            catch (Exception)
            {
            }
        }
Ejemplo n.º 2
0
        private void MudaAltura(
            Double paramNovaAltura
            )
        {
            Double frameNovaAltura = 0;

            foreach (View item in ListViewPanelTop.Children)
            {
                frameNovaAltura = paramNovaAltura;

                StackLayout boxFundo = (StackLayout)((Frame)item).Content;

                StackLayout boxContent = (StackLayout)boxFundo.Children[0];

                foreach (View item2 in boxContent.Children)
                {
                    if (item2.GetType() == typeof(Label))
                    {
                        item2.HeightRequest = paramNovaAltura;
                    }
                    else
                    {
                        frameNovaAltura += item2.HeightRequest;
                        frameNovaAltura += item2.Margin.Bottom;
                        frameNovaAltura += item2.Margin.Top;
                    }
                }

                frameNovaAltura += boxContent.Margin.Top;
                frameNovaAltura += boxContent.Margin.Bottom;

                item.HeightRequest = frameNovaAltura;
            }

            ViewModelBaseListPage temp = ((ViewModelBaseListPage)this.BindingContext);

            Double tempCount = temp.ListPainelTop_Source.Grafico.Count() / (double)2;

            int linha = 1;

            if (tempCount > (double)1)
            {
                linha = ((int)tempCount) + 1;
            }

            temp.ListPainelTop_Height = linha * frameNovaAltura;
        }
Ejemplo n.º 3
0
        public ListPagePadrao(ViewModelBaseListPage paramBindingContext)
        {
            _context            = paramBindingContext;
            this.BindingContext = paramBindingContext;

            _colorPanelDesativado = Color.FromHex("#FF2E2F3A");

            Margin          = 0;
            Padding         = 0;
            BackgroundColor = Color.Gray;

            SetBinding(
                VisualElement.HeightRequestProperty
                , new Binding(
                    "DefaultHeightContent"
                    , BindingMode.Default
                    , null
                    , null
                    , null
                    , this.BindingContext
                    )
                );

            SetBinding(
                VisualElement.WidthRequestProperty
                , new Binding(
                    "DefaultWidth"
                    , BindingMode.Default
                    , null
                    , null
                    , null
                    , this.BindingContext
                    )
                );

            PageContent = new StackLayout()
            {
                Orientation = StackOrientation.Vertical,
                Margin      = 0,
                Padding     = 0,
                Spacing     = 0
            };

            PageContent.SetBinding(
                VisualElement.HeightRequestProperty
                , new Binding(
                    "DefaultHeightContent"
                    , BindingMode.Default
                    , null
                    , null
                    , null
                    , this.BindingContext
                    )
                );

            PageContent.SetBinding(
                VisualElement.WidthRequestProperty
                , new Binding(
                    "DefaultWidth"
                    , BindingMode.Default
                    , null
                    , null
                    , null
                    , this.BindingContext
                    )
                );

            CreateFiltro();
            CreateListView();

            Children.Add(PageContent);
        }