Exemple #1
0
        public IncomesPage()
        {
            InitializeComponent();
            NavigationPage.SetHasNavigationBar(this, false);

            ToolbarItems.Add(new ToolbarItem("Add", "ic_add", async() => {
                var page = new IncomeDetail.IncomeDetailPage();
                await Navigation.PushModalAsync(new AppNavigationPage(page));
            }));

            if (DesignMode.IsDesignModeEnabled)
            {
                return;
            }
            using (var scope = App.Container.BeginLifetimeScope()) {
                if (scope.Resolve <IncomesPageViewModel>() is IncomesPageViewModel viewModel)
                {
                    BindingContext = viewModel;
                    this.viewModel = viewModel;
                }
            }
        }
Exemple #2
0
 async void OnAddIncomeClicked(object sender, System.EventArgs e)
 {
     var page = new IncomeDetail.IncomeDetailPage();
     await Navigation.PushModalAsyncUnique(new AppNavigationPage(page));
 }