示例#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();
            });
        }
示例#2
0
 async void AddButtonClickedAsync(object sender, EventArgs e)
 {
     var editPage = new AlbumEditPage(new AlbumViewModel(null));
     await Navigation.PushAsync(editPage);
 }
示例#3
0
 async void EditButtonClickedAsync(object sender, EventArgs e)
 {
     var editPage = new AlbumEditPage(BindingContext as AlbumViewModel);
     await Navigation.PushAsync(editPage);
 }