Bladeren bron

Added Avalonia.Diagnostics and DevTools back

Kenric Nugteren 2 maanden geleden
bovenliggende
commit
642ffc341c

+ 5 - 1
PRS.Avalonia/PRS.Avalonia.Desktop/PRS.Avalonia.Desktop.csproj

@@ -9,7 +9,7 @@
         <UseWinUI>true</UseWinUI>
         <WindowsPackaging>None</WindowsPackaging>
         <EnableMsixTooling>true</EnableMsixTooling>
-        <Configurations>Debug;Release</Configurations>
+        <Configurations>Debug;Release;DebugDev</Configurations>
     </PropertyGroup>
 
     <PropertyGroup>
@@ -20,6 +20,10 @@
       <OutputPath>bin\x64\Debug\</OutputPath>
     </PropertyGroup>
 
+    <PropertyGroup Condition=" '$(Configuration)' == 'DebugDev' ">
+      <OutputPath>bin\x64\DebugDev\</OutputPath>
+    </PropertyGroup>
+
     <ItemGroup>
         <PackageReference Include="Avalonia.Desktop" Version="11.2.2" />
         <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->

+ 2 - 2
PRS.Avalonia/PRS.Avalonia/App.axaml.cs

@@ -41,8 +41,8 @@ public class App : Application
             desktop.MainWindow = new MainWindow
             {
                 DataContext = new MainViewModel(),
-                Width = 450,
-                Height = 1000,
+                Width = 400,
+                Height = 700,
                 WindowStartupLocation = WindowStartupLocation.CenterScreen
             };
         }

+ 5 - 0
PRS.Avalonia/PRS.Avalonia/MainWindow.axaml.cs

@@ -1,3 +1,4 @@
+using Avalonia;
 using Avalonia.Controls;
 
 namespace PRS.Avalonia;
@@ -7,5 +8,9 @@ public partial class MainWindow : Window
     public MainWindow()
     {
         InitializeComponent();
+
+#if DEBUGDEV
+        this.AttachDevTools();
+#endif
     }
 }

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

@@ -4,8 +4,12 @@
         <Nullable>enable</Nullable>
         <LangVersion>latest</LangVersion>
         <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
-        <Configurations>Debug;Release</Configurations>
+        <Configurations>Debug;Release;DebugDev</Configurations>
     </PropertyGroup>
+
+	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDev|AnyCPU'">
+		<DefineConstants>$(DefineConstants);DEBUGDEV</DefineConstants>
+	</PropertyGroup>
     
     <ItemGroup>
         <AvaloniaResource Include="Assets\**" />
@@ -310,6 +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"/>
     
     </ItemGroup>