question

89284503 avatar image
0 Votes"
89284503 asked RoyLi-MSFT edited

Tutorial: Create data bindings

Part 5: Enable user edits

private void ImageGridView_ItemClick(object sender, ItemClickEventArgs e)
{
this.Frame.Navigate(typeof(DetailPage), e.ClickedItem);
}

     private void ImageGridView_ItemClick(object sender, ItemClickEventArgs e)
     {
         persistedItem = e.ClickedItem as ImageFileInfo;
         ImageGridView.PrepareConnectedAnimation("itemAnimation", e.ClickedItem, "ItemImage");
         this.Frame.Navigate(typeof(DetailPage), e.ClickedItem);
     }

Is it necessary to add 2 rows ?

not-supported
· 14
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

https://docs.microsoft.com/en-us/windows/uwp/data-binding/xaml-basics-data-binding#part-5-enable-user-edits
Attach the DetailPage
In MainPage.xaml.cs, add the event handler (or fill it in, if you used the tip in the last step).

0 Votes 0 ·

I'm confused about the question you post. First of all, these 2 lines of code are trying to start an animation and navigate to another page after the item is clicked. Did you add the 2 lines of the code? What do you mean by "Is it necessary to add 2 rows ?"?

0 Votes 0 ·

Docs page says that
"In MainPage.xaml.cs, add the event handler (or fill it in, if you used the tip in the last step).
private void ImageGridView_ItemClick(object sender, ItemClickEventArgs e)
{
this.Frame.Navigate(typeof(DetailPage), e.ClickedItem);
}"

But, the clicked photo is not displayed in DatailPage without below 2 lines before "this.Frame...".

         persistedItem = e.ClickedItem as ImageFileInfo;
         ImageGridView.PrepareConnectedAnimation("itemAnimation", e.ClickedItem, "ItemImage");
0 Votes 0 ·

It would be better to modify the docs tutorial page by adding above 2 lines so that readers do not confuse.

0 Votes 0 ·

This is excepted, as mentioned in the document - Tutorial: Create data bindings: This tutorial doesn't build up to the complete app, so be sure to check out the final version to see features such as custom animations and adaptive layouts. You can find the final version in the root folder of the Windows-appsample-photo-lab repo.
The sample code in the document only contains the necessary code about data-binding. You still need to check the final sample to make the app get all functions.


0 Votes 0 ·

Yes, but without the 2 lines, the clicked photo is not displayed in the DetailPage, and I could not edit the photo.

0 Votes 0 ·
Show more comments

0 Answers