Skip to content

Commit 4845def

Browse files
Merge pull request #4483 from lukeblevins/dev/lubl/simple-photo-uno
docs(Uno): SimplePhotos multiplatform tutorial
2 parents db10fd4 + 99bf6ff commit 4845def

20 files changed

+996
-56
lines changed
3.3 MB
Loading
68.2 KB
Loading
112 KB
Loading
28.2 KB
Loading
9.67 KB
Loading

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

Lines changed: 937 additions & 0 deletions
Large diffs are not rendered by default.

hub/apps/how-tos/uno-multiplatform.md

Lines changed: 39 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,23 @@ Once you've [created](hello-world-winui3.md) a starter Hello World WinUI 3 app,
2323
- [Visual Studio 2022 17.4 or later](https://visualstudio.microsoft.com/#vs-section)
2424
- [Tools for Windows App SDK](../windows-app-sdk/set-up-your-development-environment.md)
2525
- ASP.NET and web development workload (for WebAssembly development)
26-
:::image type="content" source="images/hello-world/vs-install-web.png" alt-text="Web development workload in VS":::
26+
:::image type="content" source="../images/uno/uno-vs-install-web.png" alt-text="Web development workload in VS":::
2727
- .NET Multi-platform App UI development installed (for iOS, Android, Mac Catalyst development).
28-
:::image type="content" source="images/hello-world/vs-install-dotnet-mobile.png" alt-text="dotnet mobile workload in VS":::
28+
:::image type="content" source="../images/uno/uno-vs-install-dotnet-mobile.png" alt-text="dotnet mobile workload in VS":::
2929
- .NET desktop development installed (for Gtk, Wpf, and Linux Framebuffer development)
30-
:::image type="content" source="images/hello-world/vs-install-dotnet.png" alt-text=".net desktop workload in VS":::
30+
:::image type="content" source="../images/uno/uno-vs-install-dotnet.png" alt-text=".net desktop workload in VS":::
3131

32-
## Finalize your environment
33-
34-
1. Open a command-line prompt, Windows Terminal if you have it installed, or else Command Prompt or Windows Powershell from the Start Menu.
35-
36-
2. Install the `uno-check` tool:
37-
- Use the following command:
38-
39-
`dotnet tool install -g uno.check`
40-
41-
- To update the tool, if you already have an existing one:
42-
43-
`dotnet tool update -g uno.check`
44-
45-
3. Run the tool with the following command:
46-
47-
`uno-check`
48-
49-
4. Follow the instructions indicated by the tool. Because it needs to modify your system, you may be prompted for elevated permissions.
32+
[!INCLUDE [uno-setup.md](../../includes/uno-setup.md)]
5033

5134
## Install the Uno Platform solution templates
5235

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

55-
:::image type="content" source="images/hello-world/manage-extensions.png" alt-text="Visual Studio Menu bar item that reads manage extensions":::
38+
:::image type="content" source="../images/uno/uno-manage-extensions.png" alt-text="Visual Studio Menu bar item that reads manage extensions":::
5639

5740
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.
5841

59-
:::image type="content" source="images/hello-world/uno-extensions.png" alt-text="Manage Extensions window in Visual Studio with Uno Platform extension as a search result":::
42+
:::image type="content" source="../images/uno/uno-extensions.png" alt-text="Manage Extensions window in Visual Studio with Uno Platform extension as a search result":::
6043

6144
## Create an application
6245

@@ -66,26 +49,26 @@ Soon enough, you will be able to reap the benefits of this approach, as you can
6649

6750
Open Visual Studio and create a new project via `File` > `New` > `Project`:
6851

69-
:::image type="content" source="images/hello-world/uno-create-project.png" alt-text="Create a new project":::
52+
:::image type="content" source="../images/uno/uno-create-project.png" alt-text="Create a new project":::
7053

7154
Search for Uno and select the Uno Platform App project template:
7255

73-
:::image type="content" source="images/hello-world/uno-new-project.png" alt-text="Uno platform app":::
56+
:::image type="content" source="../images/uno/uno-new-project.png" alt-text="Uno platform app":::
7457

7558
Specify a project name, solution name, and directory. In this example, our Hello World MultiPlatform project belongs to a Hello World MultiPlatform solution, which will live in C:\Projects:
7659

7760
:::image type="content" source="images/hello-world/configure-project.png" alt-text="Specify project details":::
7861

7962
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, "Hello World Uno".
8063

81-
Now you'll choose a base template to take your Hello World application multi-platform. The Uno Platform App template comes with two preset options that allow you to quickly get started with either a Blank solution or the Default configuration which includes references to the Uno.Material and Uno.Toolkit libraries. The Default configuration also includes Uno.Extensions which is used for dependency injection, configuration, navigation, and logging, and it uses MVUX in place of MVVM, making it a great starting point for rapidly building real-world applications.
64+
Now you'll choose a base template to take your Hello World application multi-platform. The Uno Platform App template comes with two preset options that allow you to quickly get started with either a Blank solution or the Default configuration which includes references to the Uno.Material and Uno.Toolkit libraries. The Default configuration also includes Uno.Extensions which is used for dependency injection, configuration, navigation, and logging, and it uses MVUX in place of MVVM, making it a great starting point for rapidly building real-world applications.
8265

83-
:::image type="content" source="images/hello-world/vsix-new-project-options.png" alt-text="Uno solution template for project startup type":::
66+
:::image type="content" source="../images/uno/uno-vsix-new-project-options.png" alt-text="Uno solution template for project startup type":::
8467

8568
To keep things simple, select the **Blank** preset. Then, click the **Create** button. Wait for the projects to be created and their dependencies to be restored.
8669

8770
A banner at the top of the editor may ask to reload projects, click **Reload projects**:
88-
:::image type="content" source="images/hello-world/vs2022-project-reload.png" alt-text="Visual Studio banner offering to reload your projects to complete changes":::
71+
:::image type="content" source="../images/uno/uno-project-reload.png" alt-text="Visual Studio banner offering to reload your projects to complete changes":::
8972

9073
## Building your app
9174

@@ -99,13 +82,13 @@ Make sure Visual Studio has your WinUI 3 project open, then copy the child XAML
9982

10083
```xml
10184
<Page x:Class="HelloWorld.MainPage"
102-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
103-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
104-
xmlns:local="using:HelloWorld"
105-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
106-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
107-
mc:Ignorable="d"
108-
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
85+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
86+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
87+
xmlns:local="using:HelloWorld"
88+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
89+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
90+
mc:Ignorable="d"
91+
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
10992

11093
<!-- Below is the code you copied from MainWindow: -->
11194
<StackPanel Orientation="Horizontal"
@@ -122,30 +105,30 @@ Launch the HelloWorld.Windows target. Observe that this WinUI app is identical t
122105

123106
You can now build and run your app on any of the supported platforms. To do so, you can use the debug toolbar drop-down to select a target platform to deploy:
124107

125-
* To run the **WebAssembly** (Wasm) head:
126-
- Right-click on the `HelloWorld.Wasm` project, select **Set as startup project**
127-
- Press the `HelloWorld.Wasm` button to deploy the app
128-
- If desired, you can use the `HelloWorld.Server` project as an alternative
129-
* To debug for **iOS**:
130-
- Right-click on the `HelloWorld.Mobile` project, select **Set as startup project**
131-
- 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.
132-
133-
:::image type="content" source="images/hello-world/net7-ios-debug.png" alt-text="Visual Studio dropdown to select a target framework to deploy":::
134-
135-
- Select an active device
136-
* To debug the **Android** platform:
137-
- Right-click on the `HelloWorld.Mobile` project, select **Set as startup project**
138-
- In the debug toolbar drop-down, select either an active Android device or the emulator
139-
- Select an active device in the "Device" sub-menu
140-
* To debug on Linux with Skia GTK:
141-
- Right-click on the `HelloWorld.Skia.Gtk` project, and select **Set as startup project**
142-
- Press the `HelloWorld.Skia.Gtk` button to deploy the app
143-
108+
- To run the **WebAssembly** (Wasm) head:
109+
- Right-click on the `HelloWorld.Wasm` project, select **Set as startup project**
110+
- Press the `HelloWorld.Wasm` button to deploy the app
111+
- If desired, you can use the `HelloWorld.Server` project as an alternative
112+
- To debug for **iOS**:
113+
- Right-click on the `HelloWorld.Mobile` project, select **Set as startup project**
114+
- 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.
115+
116+
:::image type="content" source="../images/uno/uno-mobile-debug.png" alt-text="Visual Studio dropdown to select a target framework to deploy":::
117+
118+
- To debug for **Mac Catalyst**:
119+
- Right-click on the `HelloWorld.Mobile` project, select **Set as startup project**
120+
- In the debug toolbar drop-down, select a remote macOS device. You'll need to be paired with one for this to work.
121+
- To debug the **Android** platform:
122+
- Right-click on the `HelloWorld.Mobile` project, select **Set as startup project**
123+
- In the debug toolbar drop-down, select either an active Android device or the emulator
124+
- Select an active device in the "Device" sub-menu
125+
- To debug on **Linux** with **Skia GTK**:
126+
- Right-click on the `HelloWorld.Skia.Gtk` project, and select **Set as startup project**
127+
- Press the `HelloWorld.Skia.Gtk` button to deploy the app
144128

145129
Now you're ready to start building your multi-platform application!
146130

147-
148131
## See also
149132

150133
- [Uno Platform documentation](https://platform.uno/docs/articles/intro.html)
151-
- [Uno Extensions features](https://platform.uno/docs/articles/external/uno.extensions/doc/ExtensionsOverview.html#learn-about-unoextensions-features)
134+
- [Uno Extensions features](https://platform.uno/docs/articles/external/uno.extensions/doc/ExtensionsOverview.html#learn-about-unoextensions-features)

0 commit comments

Comments
 (0)