Browse Source

fix controlcatalog.web

Dan Walmsley 3 years ago
parent
commit
e7a36d011f

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

@@ -2,6 +2,7 @@
   <PropertyGroup>
     <TargetFramework>net6.0</TargetFramework>
     <Nullable>enable</Nullable>
+    <WasmBuildNative>True</WasmBuildNative>
   </PropertyGroup>
 
   <ItemGroup>

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

@@ -89,16 +89,18 @@ 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)
+            {
                 singleViewLifetime.MainView = new MainView();
+            }
 
             base.OnFrameworkInitializationCompleted();
-
-            this.AttachDevTools(new Avalonia.Diagnostics.DevToolsOptions()
-            {
-                StartupScreenIndex = 1,
-            });
         }
     }
 }