Exemplo n.º 1
0
        public PostListPage(PostListViewModel vm)
        {
            BindingContext = vm;
            InitializeComponent();

            if (vm.IsLogined)
            {
                this.ToolbarItems.Add(new ToolbarItem("Edit", "", async() => {
                    var editPage = new AlbumEditPage(new AlbumViewModel(vm.CurrentAlnum));
                    await Navigation.PushAsync(editPage);
                }));
            }

            MessagingCenter.Subscribe <Album>(this, "delete", async album => {
                await Navigation.PopAsync();
            });
        }
Exemplo n.º 2
0
 async void AddButtonClickedAsync(object sender, EventArgs e)
 {
     var editPage = new AlbumEditPage(new AlbumViewModel(null));
     await Navigation.PushAsync(editPage);
 }
Exemplo n.º 3
0
 async void EditButtonClickedAsync(object sender, EventArgs e)
 {
     var editPage = new AlbumEditPage(BindingContext as AlbumViewModel);
     await Navigation.PushAsync(editPage);
 }