Skip to content

Getting Started

Damian edited this page Dec 8, 2022 · 15 revisions

Coming Soon

Until we get our own Visual Studio Template extension completed, it's recommended to use the Avalonia Template to make things easy.

New Project

Coming Soon

Registering Views

Coming Soon

Defining a View

Whether it's the main Window or a UserControl the following base properties must be set in the root element.

In upcoming releases, you no longer need to specify the AutoWireViewModel property, as it will be automatically detected.

  • xmlns:prism="http://prismlibrary.com/"
  • prism:ViewModelLocator.AutoWireViewModel="True"
  • x:Class="NAMESPACE.CLASSNAME"

Sample:

<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:core="clr-namespace:SampleMvvmApp;assembly=SampleMvvmApp"
        xmlns:views="using:SampleMvvmApp.Views"
        xmlns:prism="http://prismlibrary.com/"
        prism:ViewModelLocator.AutoWireViewModel="True"
        x:Class="SampleMvvmApp.Views.MainWindow"
        Title="Sample Application"
        Height="500" Width="700">
Clone this wiki locally