• Stars
    star
    173
  • Rank 220,124 (Top 5 %)
  • Language
    C#
  • License
    Other
  • Created over 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Uno "Hello world!" project using Windows UWP, Linux, iOS, Android and WebAssembly

Uno Quick Start

This repository is a basic sample for an Uno Platform application which cross-targets UWP, iOS, Android, Linux and WebAssembly.

You can clone this repository and open it in:

  • Visual Studio 2019 or 2022 and use the WinUI tooling on Windows, such as Xaml Hot Reload, C# Hot Reload, then run your app on iOS, Android, Windows or WSL.
  • Codespaces (WebAssembly) or Gitpod (WebAssembly / Linux+Skia) to get a fully configured environment ready to use

You can try out the WebAssembly Playground in your browser.

You can try developing this application right in your browser:

Open QuickStart in Gitpod

To create your own application, follow our getting start guides.

Develop on your machine

See the VS Code Getting started documentation for additional details about developing with Visual Studio on Windows.

Develop using Codespaces

WebAssembly

  1. Install the suggested Uno Platform extension
  2. Once the C# environment is setup, with the commmand palette use the command "Omnisharp: Select project" (or click on the project name in the status bar)
  3. Select the MyApp.Wasm project
  4. Using a terminal, navigate to the MyApp.Wasm folder
  5. Type dotnet run
  6. Once the compilation is done, a server will open on port 5000
  7. In the Ports tab (next to the Terminal tab), right click to make both the port 5000 and the other dotnet opened port (with uno.ui.remotecontrol in the running process column) to "public".

    Failure to make both ports public will prevent the app from starting properly.

  8. Codespaces will suggest to open a new browser window or as a preview window

See the section for examples below of changes to the application.

See the VS Code Getting started documentation for additional details about developing with VS Code.

Develop using Gitpod

How to develop for WebAssembly

  1. Install the suggested Uno Platform extension
  2. Once the C# environment is setup, with the commmand palette use the command "Omnisharp: Select project" (or click on the project name in the status bar)
  3. Select the MyApp.Wasm project
  4. Using a terminal, navigate to the MyApp.Wasm folder
  5. Type dotnet run
  6. Once the compilation is done, a server will open on port 5000
  7. In the Ports activity (on the left), click to padlock on both the port 5000 and the other dotnet opened port (with a number over 30000) to make ports public.

    Failure to make both ports public will prevent the app from starting properly.

  8. Gitpod will suggest to open a new browser window or as a preview window

See the section for examples below of changes to the application.

See the VS Code Getting started documentation for additional details about developing with VS Code.

How to develop for Linux (Skia.Gtk)

  1. As Gitpod will suggest, open the port 6080 as a browser preview to get access to the X11 environment.
  2. Once the C# environment is setup, with the commmand palette use the command "Omnisharp: Select project" (or click on the project name in the status bar)
  3. Select the MyApp.Skia.Gtk project
  4. To run your application, either:
    • Using a terminal, navigate to the MyApp.Skia.Gtk folder and type dotnet run
    • In the debug activity section on the left, select Skia.GTK (Debug) in drop down, the press F5 or Ctrl+F5 to start the application without the debugger.
  5. Gitpod will suggest to open a new browser window or as a preview window

See the section for examples below of changes to the application.

See the VS Code Getting started documentation for additional details about developing with VS Code.

Making additional modifications

  • Change some XAML content:
    • Open the src/MyApp.Shared/MainPage.xaml
    • Make some changes, such as Hello, world! to Hello, Uno!
    • No need to save, see that the application's text has changed !
  • Change some C# code:
    • Stop the running application with Ctrl+C
    • Open the src/MyApp.Shared/MainPage.xaml
    • Replace the TextBlock definition with the following attribute:
       <StackPanel>
       	<TextBlock x:Name="myTextBlock" Text="Hello, world!" Margin="20" FontSize="30" />
       	<Button Content="Click me!" Click="{x:Bind OnClickMe}" />
       </StackPanel>
    • Save the file
    • Open the src/MyApp.Shared/MainPage.xaml.cs
    • Immediately after the MainPage constructor, add the following:
       public void OnClickMe()
       {
       	myTextBlock.Text = DateTime.Now.ToString();
       }
    • Save the file
    • Start the application again with dotnet run
    • Refresh the Live Preview using the small refresh icon (not the full browser tab)
    • The time is showing !
    • Without stopping the application, in the src/MyApp.Shared/MainPage.xaml.cs, change the code to the following:
       public void OnClickMe()
       {
       	myTextBlock.Text = "Hello Uno! " + DateTime.Now.ToString();
       }
    • Still without restarting the application, click the button again
    • The text is now changed thanks to C# Hot Reload!

More Repositories

1

uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
C#
8,817
star
2

Uno.Wasm.Bootstrap

A simple nuget package to run C# code in a WASM-compatible browser
WebAssembly
370
star
3

Uno.Samples

A collection of code samples for the Uno Platform
C#
214
star
4

Uno.Playground

Source code for the Uno Gallery apps and Uno Playground (made in Wasm)
C#
214
star
5

Uno.Themes

This library is designed to help you use the Material, Fluent or Cupertino design system with the Uno Platform
C#
168
star
6

Uno.Gallery

The Uno Platform Gallery application
C#
152
star
7

Uno.SourceGeneration

A Roslyn based C# source generation framework
C#
129
star
8

workshops

workshops, study guides and learning materials for the Uno Platform
C#
97
star
9

Uno.CodeGen

A set of source generators for equality, immutability, ...
C#
90
star
10

uno.toolkit.ui

A set of custom controls for the WinUI and the Uno Platform not offered out of the box by WinUI, such as Card, TabBar, NavigationBar, etc.
C#
82
star
11

uado

Universal Azure DevOps Organizer - Uno Reference Implementation project
C#
81
star
12

Uno.Ch9

Ch9 - Uno Reference Implementation project
C#
72
star
13

uno.extensions

Libraries to ease common developer tasks associated with building multi-platform mobile, desktop and web applications using Uno Platform or WinAppSDK.
C#
72
star
14

Uno.GettingStartedTutorial

A getting started with the Uno Platform Tutorial
C#
50
star
15

uno.todo

Uno Platform "Uno To Do" reference app
C#
47
star
16

Uno.Core

Uno.Core is a set of helpers and extension methods used to accelerate development.
C#
39
star
17

Uno.SQLitePCLRaw.Wasm

An SQLiteRaw WebAssembly provider for SQLitePCLRaw.core
C#
35
star
18

uno.check

CLI tool to setup your environment to build Uno Platform apps
C#
30
star
19

Elmish.Uno

Static UWP views for elmish programs running with the Uno Platform
F#
26
star
20

uno.fabulous

F#
22
star
21

uno.templates

Uno Platform project templates
C#
16
star
22

uno.resizetizer

The home for Uno.Resizetizer, an image resizting tooling for Uno Platform apps
C#
15
star
23

Uno.UITest

Unified UI Testing Framework for Uno Platform based applications
C#
12
star
24

RpnCalculator

The Xamarin.Forms RPN (Reverse Polish Notation) calculator running in WebAssembly
C#
11
star
25

Uno.Roslyn

A set of roslyn extensions and helpers packaged as content files to avoid extertnal dependencies in analyzers and source generators
C#
11
star
26

uno.blazor.native.todoapp

A Todo app using Uno WebAssembly Renderers for Blazor Native
C#
11
star
27

uno.fonts

Uno Platform Fonts
PowerShell
10
star
28

Uno.PackageDiff

A command line tool that compares two versions of a NuGet package and provides public API differences
C#
10
star
29

talks

conference, meetup and hackathon presentation materials for the Uno Platform
C#
10
star
30

Uno.Wasm.WebSockets

An Uno Platform implementation of .NET System.Net.WebSocket for WebAssembly
C#
10
star
31

Uno.DotnetRuntime.WebAssembly

template for brand new github repositories
PowerShell
7
star
32

uno.ui.runtimetests.engine

In-App MS Tests Runner for Uno Platform and WinAppSDK
C#
7
star
33

Uno.LottieSample

C#
7
star
34

uno.xamlmerge.task

C#
7
star
35

cybertruck

Cybertruck demo in XAML with the Uno Platform
C#
6
star
36

styleguide

style guide and brand assets for the Uno Platform
5
star
37

uno.dopesbench

C#
5
star
38

Uno.UITests.Helpers

Xamarin.UITests Helpers for the Uno Platforms for iOS and Android
C#
4
star
39

template

template for brand new github repositories
4
star
40

Uno.Diagnostics.Eventing

A set of packages and tools that enable the use of the Windows Performance Analyzer tooling with iOS, Android and WebAssembly.
C#
3
star
41

winui3-convert

A command line tool to convert UWP project libraries to WinUI 3 for .NET 5
C#
3
star
42

dotnet-azdo-artifacts-multidownload

template for brand new github repositories
C#
2
star
43

Uno.MonoAnalyzers

A set of Roslyn C# analyzers for Xamarin and Mono-based code bases
C#
2
star
44

Uno.MSAL.Graph.Demo

Uno Demo app for using MS Graph API with Uno version of MSAL
C#
2
star
45

performance

This repo contains benchmarks used for testing the performance of the Uno Platform
C#
2
star
46

Uno.UI.Toolkit.SL

The Silverlight Toolkit ported to the Uno Platform
C#
2
star
47

uno.extensions.logging

Set of loggers compatible with Microsoft.Extensions.Logging. Provides an OSLog logger, and a browser console WebAssembly logger
C#
2
star
48

Uno.Microsoft.Identity.Client

Fork of https://github.com/AzureAD/microsoft-authentication-library-for-dotnet to add support for Uno-WASM
C#
1
star
49

docker

template for brand new github repositories
Dockerfile
1
star