Uno Platform Samples
This repository provides simple, to-the-point code samples for the Uno Platform.
See a complete list of code samples below. Some of the samples have accompanying step-by-step tutorials in the official Uno Platform documentation.
Pixel-Perfect. Multi-Platform. C# & Windows XAML. Today.
What is the Uno Platform?
The Uno Platform is a UI Platform for building single-codebase applications for Windows, Web/WebAssembly, iOS, macOS, Android and Linux.
It allows C# and Windows XAML code to run on all target platforms, while allowing you control of every pixel. It comes with support for Fluent, Material and Cupertino design systems out of the box. Uno Platform implements a growing number of the UWP APIs, such as Windows.UI.Xaml, to enable UWP and WinUI applications to run on on all platforms with native performance.
Use the UWP/WinUI tooling from Windows in Visual Studio, such as XAML Hot Reload and C# Edit and Continue, build your application as much as possible on Windows, then validate that your application runs on iOS, Android, macOS and WebAssembly.
Visit our documentation for more details.
Samples
Commerce App
The Commerce App is a sample application that demonstrates the use of ListFeed pagination, Feedviews, and other features provided by Uno.Extensions. It illustrates how these features can be applied to create an application complete with a shopping cart, products, and more.
Advanced XBind
The {x:Bind} markup extension�new for Windows 10�is an alternative to {Binding}. {x:Bind} runs in less time and less memory than {Binding} and supports better debugging.
Android Custom Camera
An Android-specific sample that shows how to start a camera capture intent, and display the result in an Image
control.
Authentication with OpenID Connect (OIDC)
This sample application demonstrates the usage of the WebAuthenticationBroker
in Uno with an OpenID Connect endpoint.
Auto-Suggest
An implementation of the XAML AutoSuggest
control, showing how to autofill suggestions for user input.
Benchmark
An implementation of the .NET Benchmark Control, a performance comparison tool.
BluetoothExplorer
A sample that allows the user to search for nearby Bluetooth connections and connect to a device of their choice. Uses InTheHand.BluetoothLE
Camera Capture UI
A cross-platform implementation of the UWP CameraCaptureUI
class that allows the user to capture audio, video, and photos from the device camera.
CardView Migration
An Uno conversion of the Xamarin CardView
sample showing how to migrate a custom control.
Chat SignalR
Demonstrates the use of SignalR in an Uno Platform application.
Control Library
An example of creating a custom control library and calling a control from your shared project.
Custom Sorting
Sample app to accompany "Adding Custom Sorting Logic" blog post.
Dual-Screen
A simple example using the TwoPaneView
control spanned across dual screens (such as Neo or Duo dual-screen devices for example).
Entity Framework Core Demo
An example of Entity Framework Core 7 with a SQLite storage for WebAssembly, WinAppSDK, iOS and Android.
EmbeddedResources
An example that demonstrates the use of embedded resources and how to read them from your app.
Note that the Default namespace
property of all projects is the same in order for the embedded resource names to be the same on all platforms.
FileSavePicker iOS
A working implementation of a folder-based save file picker for iOS. See the 'iOS' section in the Windows.Storage.Pickers Uno documentation for more information.
Food Delivery
HtmlControls
This is a WASM-only sample. It is creating native HTML elements that can be used directly in XAML.
Inserting Separators
This example demonstrates the dynamic creation of a menu incorporating nested items as well as items with separators.
LiteDB
This is an example that utilizes the LiteDB NuGet package to save data.
Localization Samples
A pair of samples related to localization:
- Localization: A sample showcasing the basics of localization.
Browse source Follow the tutorial - RuntimeCultureSwitching: An example of changing app language while it is running.
Browse source Follow the tutorial
Map Control
An implementation of the UWP Maps
control with a custom slider that binds the value of the slider to the ZoomLevel
property of the control.
Migrating Xamarin.Forms Effects
Code samples to accompany the blog post on Migrating from Xamarin.Forms Effects
- XamarinFormsEffect: A reference implementation of an effect with an Android implementation. Browse source
- UnoEffectSample: Showcasing how to replace Effects with either ControlTemplates or custom code accessing the native control. Browse source
Migrating Animations
Code to accompany the blog post on migrating animations from Xamarin Forms to Uno.
Native Frame Navigation
An example showcasing how to set up the native frame navigation for iOS and Android, and frame navigation in general for Uno.
Native Style Switch
An example of a toggle that allows you to switch between Native UI Controls and UWP UI Controls. The sample includes a checkbox, slider, button, and toggle.
Neumorphism
An example of an app containing an animated lock that you can unlock.
Package Resources
An example that demonstrates the use of package assets and how to read them from your app.
Note that for WebAssembly assets are downloaded on demand, as can be seen in the browser's network tab.
Pet Adopt
An example that demonstrates the use of pipspager with a flipview, in an app created with the help of the Figma-to-XAML plugin.
SQLite
This is a simple standalone app demonstrating the use of SQLite in an Uno application, including WebAssembly. It uses Erik Sink's SQLitePCLRaw, and Frank Krueger's sqlite-net libraries.
SkiaSharp Test
An example of the Uno implementation of SkiaSharp creating a basic canvas with text.
SkiaSharp Skottie: Lottie file player
This samples shows the use of the SkiaSharp.Skottie component, which allows the playback of lottie files.
This component provides Lottie support for all available Uno Platform targets.
Splash Screen Sample
An example showing how to set the splash/launch screen in Uno.
StatusBar Theme Color
An example showing how to adjust the StatusBar
and CommandBar
dynamically based on the current light/dark theme.
The Cat Api Client
An example demonstrating an approach to consuming REST web services in Uno using HttpClient.
Time Entry
Code for the Silverlight migration tutorial.
Toy Car
A proof of concept of a car animation using the TwoPaneView
control spanned across dual screens (such as Neo or Duo dual-screen devices for example).
Inspiration from Justin Liu's demo app.
Travel UI
A sample travel app that shows how a user could 1) search for locations, 2) favorite locations and 3) view their profile as well as others' profiles. For the layout, showcases many ListViews coupled with Grids.
Uno Contoso
A port of Microsoft's Contoso Enterprise UWP app to Uno Platform, using Prism.
Uno.Cupertino
An example showing how to set up the Uno.Cupertino
library.
Uno+Ethereum+Blockchain
A sample showing how to integrate smart contracts on the Ethereum blockchain with a multi-targeted Uno Platform application.
Uno Good Reads
A sample showing how to make an app containing several pages in a TabView, as well as fake data generation to populate those pages.
Uno Islands
This sample shows how you can integrate Uno Platform XAML controls into existing WPF applications using Uno Islands. This feature allows you to enhance WPF apps with Uno Platform features by hosting Uno Platform XAML files in a Shared project and adding an Uno Island using the UnoXamlHost control.
Uno.Material Sample
An example showing how to set up the Uno.Material
library.
Uno.Toolkit.Material Sample
An example showing how to set up the Uno.Toolkit.Material
library,
Uno Onnx
Uno SQlite One Drive Invoice
WCT DataGrid
A dynamic grid view ported from the Windows Community Toolkit that allows for x:Bind.
WCT DataGrid, TreeView, TabView
A combined Windows Community Toolkit sample showing the DataGrid, TreeView, and TabView controls in action.
WebRTC
Demo of the usage of WebRTC in Uno WebAssembly. This sample establishes a direct WebRTC connection between 2 browsers and uses it to send messages between peers.
XAML Basics : ListView
UnoBackgroundWorker: Background Work
CountryDataSample
UnoScrollReveal
Visit our documentation for more details.
Contributors
Thanks go to these wonderful people (List made with contrib.rocks):
💖 Thank you.