Welcome to the Uno Platform Community!
In this project, you will find a simple example of how to use WebView2 in an MVUX Uno Platform application.
This is a cross-platform application that demonstrates the following features:
-
Forward and Backwards Navigation via Code-Behind.
-
Navigation via MVUX State-Management:
- Binding the
CurrentUri
route to aIState<Uri>
. - Capturing the
NavigationHistory
by binding to aIListState<Uri>
. - Navigate in Navigation history by selecting an item in the
NavigationHistory
-List represented by aListView
-Control.
- Binding the
-
Creating custom
AttachedProperties
andDependencyProperties
:- Enable reacting to NavigationStarted and -Completed events.
- Binding the
BackButton
andForwardButton
IsEnabled
-state to theCanGoBack
andCanGoForward
properties of theWebView2
control.
-
Use
IValueConverters
:- Navigate to a new Uri by entering a Uri in the AddressBar
TextBox
. - Convert a
Uri
to astring
and vice versa.
- Navigate to a new Uri by entering a Uri in the AddressBar
Find the relevant code snippets in the following files:
- WebView2 in Main Page
- MainModel with MVUX State-Management
- Attached Properties for WebView2
- Value Converters
Check out my Samples & Tutorials Repository for Uno Platform on GitHub:
To discover how to get started with creating your first Uno App: https://aka.platform.uno/get-started
For more information on how to use the Uno.Sdk or upgrade Uno Platform packages in your solution: https://aka.platform.uno/using-uno-sdk
Please feel free to fork this repository and submit pull requests. Any contributions, big or small, are greatly appreciated. If you find a bug or have a feature request, please open an issue on GitHub.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.