Skip to content

Commit af80fc6

Browse files
committed
docs: add screenshots
1 parent 4c0b1f6 commit af80fc6

19 files changed

+25
-22
lines changed
3.26 MB
Loading
68.2 KB
Loading
112 KB
Loading
1.88 MB
Loading
28.2 KB
Loading
9.67 KB
Loading

hub/apps/get-started/uno-simple-photo-viewer.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Tutorial--Make a simple photo viewer that targets multiple platforms
2+
title: Tutorial--Build a simple photo viewer that targets multiple platforms
33
description: Learn how to reach users on other platforms like Web, iOS, Android, and Linux with minimal changes to the C#/WinUI 3 simple photo viewer built in the previous tutorial. We'll use Uno Platform to create a new multi-platform app, which we can move code from the existing desktop project to.
44
ms.topic: article
55
ms.date: 05/21/2023
@@ -9,11 +9,12 @@ author: alvinashcraft
99
ms.localizationpriority: medium
1010
---
1111

12-
# Tutorial: Make a simple photo viewer that targets multiple platforms
12+
# Tutorial: Build a simple photo viewer that targets multiple platforms
1313

1414
After you've [created](/hub/apps/get-started/simple-photo-viewer-winui3.md) a starter simple photo viewer WinUI 3 app, you might be wondering how to reach more users without having to rewrite your app. This tutorial will use [Uno Platform](https://platform.uno/) to expand the reach of your existing C# WinUI 3 application enabling reuse of the business logic and UI layer across native mobile, web, and desktop. With only minimal changes to the simple photo viewer app, we'll be able to run a pixel-perfect copy of the app ported to platforms like the web, mobile, and desktop.
1515

16-
[Insert picture here]
16+
:::image type="content" source="images/uno/screenshot1.png" alt-text="Screenshot of UnoSimplePhoto app targeting Web and WinUI desktop":::
17+
:::image type="content" source="images/uno/screenshot4.png" alt-text="Screenshot of UnoSimplePhoto app targeting Mobile":::
1718

1819
## Prerequisites
1920

@@ -24,7 +25,7 @@ After you've [created](/hub/apps/get-started/simple-photo-viewer-winui3.md) a st
2425
- .NET Multi-platform App UI development installed (for iOS, Android, Mac Catalyst development).
2526
:::image type="content" source="../images/uno/uno-vs-install-dotnet-mobile.png" alt-text="dotnet mobile workload in VS":::
2627
- .NET desktop development installed (for Gtk, Wpf, and Linux Framebuffer development)
27-
:::image type="content" source="../how-tos/images/hello-world/vs-install-dotnet.png" alt-text=".net desktop workload in VS":::
28+
:::image type="content" source="../images/uno/uno-vs-install-dotnet.png" alt-text="dotnet desktop workload in VS":::
2829

2930
## Finalize your environment
3031

@@ -49,7 +50,7 @@ After you've [created](/hub/apps/get-started/simple-photo-viewer-winui3.md) a st
4950

5051
Launch Visual Studio, then click `Continue without code`. Click `Extensions` -> `Manage Extensions` from the Menu Bar.
5152

52-
:::image type="content" source="../how-tos/images/hello-world/manage-extensions.png" alt-text="Visual Studio Menu bar item that reads manage extensions":::
53+
:::image type="content" source="../images/uno/uno-manage-extensions.png" alt-text="Visual Studio Menu bar item that reads manage extensions":::
5354

5455
In the Extension Manager expand the **Online** node and search for `Uno`, install the `Uno Platform` extension, or download it from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=unoplatform.uno-platform-addin-2022), then restart Visual Studio.
5556

@@ -71,7 +72,7 @@ Search for Uno and select the Uno Platform App project template:
7172

7273
Create a new C# solution using the **Uno Platform App** type from Visual Studio's **Start Page**. To avoid conflicting with the code from the previous tutorial, we'll give this solution a different name, "UnoSimplePhotos". Specify the project name, solution name, and directory. In this example, our `UnoSimplePhotos` multi-platform project belongs to a `UnoSimplePhotos` solution, which will live in C:\Projects:
7374

74-
:::image type="content" source="images/hello-world/configure-project.png" alt-text="Specify project details":::
75+
:::image type="content" source="images/uno/uno-configure-project.png" alt-text="Specify project details":::
7576

7677
Now you'll choose a base template to take your Simple Photo gallery application multi-platform.
7778

@@ -86,15 +87,15 @@ A banner at the top of the editor may ask to reload projects, click **Reload pro
8687

8788
You should see the following default file structure in your **Solution Explorer**:
8889

89-
:::image type="content" source="images/hello-world/uno-file-structure.png" alt-text="Default file structure":::
90+
:::image type="content" source="images/uno/screenshot2.png" alt-text="Default file structure":::
9091

9192
### Add image assets to the project
9293

9394
Your app will need some images to display. You can use the same images from the previous tutorial.
9495

9596
In the `UnoSimplePhotos` project, create a new folder named `Assets` and copy the JPG image files to a `Samples` subfolder. The `Assets` folder structure should now look like this:
9697

97-
[Insert image here]
98+
:::image type="content" source="images/uno/screenshot3.png" alt-text="dotnet mobile workload in VS":::
9899

99100
For more information on creating the `Assets` folder and adding images to it, see the Uno Platform documentation about [Assets and image display](https://platform.uno/docs/articles/features/working-with-assets.html).
100101

@@ -522,7 +523,7 @@ Similar to the `GetItemsAsync` method, this method now uses a preprocessor direc
522523

523524
Controls like `GridView` allow for **progressive loading** of updated item container content as they are scrolled into the viewport. This is done by using the `ContainerContentChanging` event. In the desktop project from the previous tutorial, the `ImageGridView_ContainerContentChanging` method uses this event to load the image files into the `GridView`. Because certain aspects of this event are not supported on all platforms, we will need to make changes to this method to make it compatible with them.
524525

525-
[insert image here]
526+
:::image type="content" source="images/uno/xaml-attached-layout-realizationrect.png" alt-text="Diagram of collection control viewport":::
526527

527528
For instance, the `ContainerContentChangingEventArgs.Phase` property is currently unsupported on platforms other than Windows. We will need to make changes to the `ImageGridView_ContainerContentChanging` method to accommodate this change. Replace the `ImageGridView_ContainerContentChanging` method in the `MainPage.xaml.cs` file with the following code:
528529

@@ -925,7 +926,7 @@ You can now build and run your app on any of the supported platforms. To do so,
925926
- Right-click on the `UnoSimplePhotos.Mobile` project, select **Set as startup project**
926927
- In the debug toolbar drop-down, select an active iOS device or the simulator. You'll need to be paired with a Mac for this to work.
927928

928-
:::image type="content" source="../how-tos/images/hello-world/net7-ios-debug.png" alt-text="Visual Studio dropdown to select a target framework to deploy":::
929+
:::image type="content" source="../images/uno/uno-mobile-debug.png" alt-text="Visual Studio dropdown to select a target framework to deploy":::
929930

930931
* To debug for **Mac Catalyst**:
931932
- Right-click on the `UnoSimplePhotos.Mobile` project, select **Set as startup project**
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)