Exemplo n.º 1
0
        public ExpensesPage()
        {
            InitializeComponent();

            BindingContext = new ExpensesViewModel();

                        #if __ANDROID__
            ToolbarItems.RemoveAt(0);

            var fab = new FloatingActionButton(Forms.Context)
            {
                UseCompatPadding = true
            };

            fab.Click += (sender, e) =>
            {
                var viewModel = BindingContext as ExpensesViewModel;
                viewModel.AddExpenseCommand.Execute(null);
            };

            relativeLayout.Children.Add(fab.ToView(),
                                        Constraint.RelativeToParent((parent) =>
            {
                return(parent.Width - 100);
            }),
                                        Constraint.RelativeToParent((parent) =>
            {
                return(parent.Height - 100);
            }),
                                        Constraint.Constant(75),
                                        Constraint.Constant(85));
                        #endif
        }
Exemplo n.º 2
0
        public ExpensesPage()
        {
            InitializeComponent();

            BindingContext = new ExpensesViewModel();
        }