public GerenciarFeriadosView(GerenciarFeriadosViewModel viewModel)
        {

            Title = "Feriados";
            BindingContext = viewModel;
            this.SetBinding(ContentPage.NavigationProperty, "Navigation", BindingMode.TwoWay);
            // message.SetBinding(Label.IsVisibleProperty, "messageVisibility", BindingMode.TwoWay);
            listViewHolidays.SetBinding(ListView.ItemsSourceProperty, "holidays", BindingMode.TwoWay);
            listViewHolidays.ItemTemplate = new DataTemplate(typeof(TwoColumnsGridCell));
            listViewHolidays.ItemTapped += listViewHolidays_ItemTapped;

            FloatButton.AnimateWithAction();
            FloatButton.Command = new Command(toolbarAddHoliday);
            /*ToolbarItems.Add(new ToolbarItem
            {
                Icon = Images.Add2,
                Order = ToolbarItemOrder.Primary,
                Command = new Command(toolbarAddHoliday)
            });*/

            iconStack = new StackLayout
            {
                VerticalOptions = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                Children = { iconMsg, message }
            };

            stack = new StackLayout
            {
                Padding = new Thickness(0, 15, 0, 0),
                VerticalOptions = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                BackgroundColor = Color.FromHex("#ECEFF1"),
                Children = { listViewHolidays }
            };

            var absoluteLayout = new AbsoluteLayout
            {
                VerticalOptions = LayoutOptions.FillAndExpand,
            };
            //var background = new Image { Source = Images.Background, Aspect = Aspect.Fill };

            //absoluteLayout.Children.Add (background, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
            //AbsoluteLayout.SetLayoutFlags(background, AbsoluteLayoutFlags.All);
            //AbsoluteLayout.SetLayoutBounds(background, new Rectangle(0, 0, 1, 1));

            //absoluteLayout.Children.Add (stack, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutFlags(stack, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(stack, new Rectangle(0, 0, 1, 1));

            //absoluteLayout.Children.Add (Add, new Rectangle (0.85, 0.85, 0.185, 0.1), AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutFlags(FloatButton, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds(FloatButton, new Rectangle(0.99f, 0.98f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

            //absoluteLayout.Children.Add(background);
            absoluteLayout.Children.Add(stack);
            absoluteLayout.Children.Add(FloatButton);

            Content = absoluteLayout;
        }
Ejemplo n.º 2
0
        public AddFeriadosView(GerenciarFeriadosViewModel viewModel)
        {
            Title = "Feriado";
            BindingContext = viewModel;

            FloatButton.AnimateWithAction ();
            FloatButton.Command = viewModel.toolbarSaveCommand;

            entryName.SetBinding (Entry.TextProperty, "holidayName", BindingMode.TwoWay);
            dateHoliday.SetBinding (DatePicker.DateProperty, "holidayDate", BindingMode.TwoWay);
            Recursive.SetBinding (SwitchCell.OnProperty, "recursive", BindingMode.TwoWay);

            //ToolbarItems.Add(new ToolbarItem
            //{
            //	Icon = Images.Save,
            //	Order = ToolbarItemOrder.Primary,
            //	Command = viewModel.toolbarSaveCommand
            //});

            tableHoliday = new TableView {
                Intent = TableIntent.Settings,
                BackgroundColor = Color.Default,
                Root = new TableRoot {
                    new TableSection ("Nome"){ new ViewCell { View = entryName } },
                    new TableSection ("Data"){ new ViewCell{ View = dateHoliday } },
                    new TableSection (){ Recursive }
                }
            };

            var absoluteLayout = new AbsoluteLayout {
                VerticalOptions = LayoutOptions.FillAndExpand,
            };
            //var background = new Image { Source = Images.Background, Aspect = Aspect.Fill };

            //absoluteLayout.Children.Add (background, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
            //AbsoluteLayout.SetLayoutFlags(background, AbsoluteLayoutFlags.All);
            //AbsoluteLayout.SetLayoutBounds(background, new Rectangle(0, 0, 1, 1));

            //absoluteLayout.Children.Add (stack, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutFlags (tableHoliday, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds (tableHoliday, new Rectangle (0, 0, 1, 1));

            //absoluteLayout.Children.Add (Add, new Rectangle (0.85, 0.85, 0.185, 0.1), AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutFlags (FloatButton, AbsoluteLayoutFlags.PositionProportional);
            AbsoluteLayout.SetLayoutBounds (FloatButton, new Rectangle (0.99f, 0.98f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));

            //absoluteLayout.Children.Add(background);
            absoluteLayout.Children.Add (tableHoliday);
            absoluteLayout.Children.Add (FloatButton);

            Content = absoluteLayout;
        }