You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hub/apps/get-started/uno-simple-photo-viewer.md
+18-19Lines changed: 18 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,17 +163,16 @@ Return to the **SimplePhotos** project from the previous tutorial. In the **Solu
163
163
</Window>
164
164
```
165
165
166
-
Uno Platform's multi-platform implmentation of the controls found in the `Window` element, such as `GridView`, `Image`, and `RatingControl`, ensure that the view itself will work on all supported platforms with only a trivial amount of effort. Copy the contents of this `Window` and paste them into the `Page` element of the `MainPage.xaml` file in the **UnoSimplePhotos** Uno Platform project. The `MainPage` view XAML should look like this:
166
+
Uno Platform's multi-platform implementation of the controls found in the `Window` element, such as `GridView`, `Image`, and `RatingControl`, ensure that the view itself will work on all supported platforms with only a trivial amount of effort. Copy the contents of this `Window` and paste them into the `Page` element of the `MainPage.xaml` file in the **UnoSimplePhotos** Uno Platform project. The `MainPage` view XAML should look like this:
@@ -240,11 +239,11 @@ Uno Platform's multi-platform implmentation of the controls found in the `Window
240
239
241
240
Recall that the desktop solution also had a `MainWindow.xaml.cs` file that contained code-behind which corresponds to the view. In the Uno Platform project, the code-behind for the `MainPage` view we've copied into is contained in the `MainPage.xaml.cs` file.
242
241
243
-
To bring this codebehind multiplatform, we should first move the following into the `MainPage.xaml.cs` file:
242
+
To bring this code-behind multi-platform, we should first move the following into the `MainPage.xaml.cs` file:
244
243
245
244
-`Images` property: Provides the `GridView` with an observable collection of image files
246
245
247
-
- Contents of constructor: Calls `GetItemsAsync()` to populate the `Images` collection with items representing image files
246
+
- Contents of the constructor: Calls `GetItemsAsync()` to populate the `Images` collection with items representing image files
248
247
249
248
- Remove the manual modification of the `ImageGridView` control's `ItemsSource` property
250
249
@@ -254,7 +253,7 @@ To bring this codebehind multiplatform, we should first move the following into
254
253
255
254
-`GetItemsAsync` method: Gets the image asset files from the `Samples` folder
256
255
257
-
-`LoadImageInfoAsync` method: Constructs a`ImageFileInfo` object from a created `StorageFile`
256
+
-`LoadImageInfoAsync` method: Constructs an`ImageFileInfo` object from a created `StorageFile`
258
257
259
258
After moving everything over, `MainPage.xaml.cs` should now look like this:
Again, preprocessor directives ensure that the `ContainerContentChangingEventArgs.Phase` property is only used where it is supported. We make use of the previously unused `GetImageSourceAsync()` method to load the image files into the `GridView` on platforms other than Windows. At this point, we will accommodate the changes made above by editing to the `ImageFileInfo` class.
575
+
Again, preprocessor directives ensure that the `ContainerContentChangingEventArgs.Phase` property is only used where it is supported. We make use of the previously unused `GetImageSourceAsync()` method to load the image files into the `GridView` on platforms other than Windows. At this point, we will accommodate the changes made above by editing the `ImageFileInfo` class.
577
576
578
577
### Creating a separate code path for other platforms
579
578
@@ -583,7 +582,7 @@ Update `ImageFileInfo.cs` to include a new property called `ImageSource` that wi
Because platforms like the Web do not support advanced image file properties that are readily available on Windows, we should add a constructor overload which does not require an `ImageProperties` typed parameter. Add a new overload under the existing one using the following code:
585
+
Because platforms like the Web do not support advanced image file properties that are readily available on Windows, we should add a constructor overload that does not require an `ImageProperties` typed parameter. Add a new overload under the existing one using the following code:
587
586
588
587
```csharp
589
588
publicImageFileInfo(StorageFileimageFile,
@@ -620,7 +619,7 @@ public async Task<BitmapImage> GetImageSourceAsync()
620
619
}
621
620
```
622
621
623
-
To prevent getting the value of `ImageProperties` when its null, we will need to make the following changes:
622
+
To prevent getting the value of `ImageProperties` when it's null, we will need to make the following changes:
624
623
625
624
- Modify the `ImageDimensions` property to use the null conditional operator:
626
625
@@ -852,7 +851,7 @@ The `MainPage.xaml` file should now look like this:
0 commit comments