فهرست منبع

Added a TestViewModel for when I want to test.

Kenric Nugteren 2 ماه پیش
والد
کامیت
57f898903d

+ 1 - 1
PRS.Avalonia/PRS.Avalonia/MainWindow.axaml

@@ -10,6 +10,6 @@
         Title="PRS.Avalonia"
         x:DataType="avalonia:MainViewModel">
 
-    <views:MainView />
+	<views:MainView/>
 
 </Window>

+ 4 - 1
PRS.Avalonia/PRS.Avalonia/PRS.Avalonia.csproj

@@ -314,7 +314,7 @@
         <PackageReference Include="Microsoft.Maui.Essentials" Version="9.0.70" />
         
         <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
-		<PackageReference Condition="'$(Configuration)' == 'DebugDev'" Include="Avalonia.Diagnostics" Version="11.2.2"/>
+		<PackageReference Condition="'$(Configuration)' == 'DebugDev'" Include="Avalonia.Diagnostics" Version="11.2.2" />
     
     </ItemGroup>
 
@@ -410,6 +410,9 @@
             <DependentUpon>MainView.axaml</DependentUpon>
             <SubType>Code</SubType>
         </Compile>
+        <Compile Update="TestView.axaml.cs">
+          <DependentUpon>TestView.axaml</DependentUpon>
+        </Compile>
     </ItemGroup>
 
     <ItemGroup>

+ 9 - 0
PRS.Avalonia/PRS.Avalonia/TestView.axaml

@@ -0,0 +1,9 @@
+<UserControl xmlns="https://github.com/avaloniaui"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             xmlns:prs="using:PRS.Avalonia"
+             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+             x:Class="PRS.Avalonia.TestView"
+			 x:DataType="prs:TestViewModel">
+</UserControl>

+ 13 - 0
PRS.Avalonia/PRS.Avalonia/TestView.axaml.cs

@@ -0,0 +1,13 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace PRS.Avalonia;
+
+public partial class TestView : UserControl
+{
+    public TestView()
+    {
+        InitializeComponent();
+    }
+}

+ 15 - 0
PRS.Avalonia/PRS.Avalonia/TestViewModel.cs

@@ -0,0 +1,15 @@
+using CommunityToolkit.Mvvm.Input;
+using InABox.Avalonia;
+using PRS.Avalonia.Modules;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PRS.Avalonia;
+
+public partial class TestViewModel : ModuleViewModel
+{
+    public override string Title => "Test";
+}