Browse Source

Do not reference DevTools from shared control catalog

Max Katz 3 years ago
parent
commit
b045393df3

+ 1 - 0
samples/ControlCatalog.NetCore/ControlCatalog.NetCore.csproj

@@ -13,6 +13,7 @@
   </PropertyGroup>
 
   <ItemGroup>
+    <ProjectReference Include="..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj" />
     <ProjectReference Include="..\..\src\Avalonia.Headless.Vnc\Avalonia.Headless.Vnc.csproj" />
     <ProjectReference Include="..\..\src\Avalonia.Dialogs\Avalonia.Dialogs.csproj" />
     <ProjectReference Include="..\..\src\Linux\Avalonia.LinuxFramebuffer\Avalonia.LinuxFramebuffer.csproj" />

+ 7 - 0
samples/ControlCatalog.NetCore/Program.cs

@@ -118,6 +118,13 @@ namespace ControlCatalog.NetCore
                 })
                 .UseSkia()
                 .UseManagedSystemDialogs()
+                .AfterSetup(builder =>
+                {
+                    builder.Instance!.AttachDevTools(new Avalonia.Diagnostics.DevToolsOptions()
+                    {
+                        StartupScreenIndex = 1,
+                    });
+                })
                 .LogToTrace();
 
         static void SilenceConsole()

+ 0 - 5
samples/ControlCatalog/App.xaml.cs

@@ -78,11 +78,6 @@ namespace ControlCatalog
             if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime)
             {
                 desktopLifetime.MainWindow = new MainWindow();
-
-                this.AttachDevTools(new Avalonia.Diagnostics.DevToolsOptions()
-                {
-                    StartupScreenIndex = 1,
-                });
             }
             else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewLifetime)
             {

+ 0 - 1
samples/ControlCatalog/ControlCatalog.csproj

@@ -23,7 +23,6 @@
 
   <ItemGroup>
     <ProjectReference Include="..\..\packages\Avalonia\Avalonia.csproj" />
-    <ProjectReference Include="..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj" />
     <ProjectReference Include="..\..\src\Avalonia.Controls.DataGrid\Avalonia.Controls.DataGrid.csproj" />
     <ProjectReference Include="..\MiniMvvm\MiniMvvm.csproj" />
     <ProjectReference Include="..\SampleControls\ControlSamples.csproj" />

+ 1 - 0
samples/interop/WindowsInteropTest/WindowsInteropTest.csproj

@@ -8,6 +8,7 @@
   </PropertyGroup>
 
   <ItemGroup>
+    <ProjectReference Include="..\..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj" />
     <ProjectReference Include="..\..\..\src\Windows\Avalonia.Win32.Interop\Avalonia.Win32.Interop.csproj" />
     <ProjectReference Include="..\..\ControlCatalog\ControlCatalog.csproj">
       <Project>{d0a739b9-3c68-4ba6-a328-41606954b6bd}</Project>