code cleanup
This commit is contained in:
parent
934ecff41a
commit
4107ca217a
26
src/.vscode/launch.json
vendored
Normal file
26
src/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
// Use IntelliSense to find out which attributes exist for C# debugging
|
||||
// Use hover for the description of the existing attributes
|
||||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
|
||||
"name": ".NET Core Launch (console)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
// If you have changed target frameworks, make sure to update the program path.
|
||||
"program": "${workspaceFolder}/bin/Debug/net7.0/linux-x64/AvaloniaCoreRTDemo.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}",
|
||||
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
|
||||
"console": "internalConsole",
|
||||
"stopAtEntry": false
|
||||
},
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach"
|
||||
}
|
||||
]
|
||||
}
|
41
src/.vscode/tasks.json
vendored
Normal file
41
src/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/AvaloniaCoreRTDemo.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "publish",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"${workspaceFolder}/AvaloniaCoreRTDemo.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "watch",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"watch",
|
||||
"run",
|
||||
"--project",
|
||||
"${workspaceFolder}/AvaloniaCoreRTDemo.csproj"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
]
|
||||
}
|
@ -59,10 +59,14 @@ public sealed class App : Application, IThemeSwitch
|
||||
|
||||
bool themeChanged = theme switch
|
||||
{
|
||||
ApplicationTheme.SimpleLight => _currentTheme is ApplicationTheme.FluentDark or ApplicationTheme.FluentLight,
|
||||
ApplicationTheme.SimpleDark => _currentTheme is ApplicationTheme.FluentDark or ApplicationTheme.FluentLight,
|
||||
ApplicationTheme.FluentLight => _currentTheme is ApplicationTheme.SimpleLight or ApplicationTheme.SimpleDark,
|
||||
ApplicationTheme.FluentDark => _currentTheme is ApplicationTheme.SimpleLight or ApplicationTheme.SimpleDark,
|
||||
ApplicationTheme.SimpleLight
|
||||
=> _currentTheme is ApplicationTheme.FluentDark or ApplicationTheme.FluentLight,
|
||||
ApplicationTheme.SimpleDark
|
||||
=> _currentTheme is ApplicationTheme.FluentDark or ApplicationTheme.FluentLight,
|
||||
ApplicationTheme.FluentLight
|
||||
=> _currentTheme is ApplicationTheme.SimpleLight or ApplicationTheme.SimpleDark,
|
||||
ApplicationTheme.FluentDark
|
||||
=> _currentTheme is ApplicationTheme.SimpleLight or ApplicationTheme.SimpleDark,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(theme), theme, null)
|
||||
};
|
||||
|
||||
@ -101,7 +105,7 @@ public sealed class App : Application, IThemeSwitch
|
||||
|
||||
oldWindow.Hide();
|
||||
newWindow.Show();
|
||||
oldWindow.Close();
|
||||
oldWindow?.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
<ApplicationIcon>Assets/app.ico</ApplicationIcon>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<Nullable>enable</Nullable>
|
||||
<PublishAot>true</PublishAot>
|
||||
<PublishAot>false</PublishAot>
|
||||
<PublishTrimmed>true</PublishTrimmed>
|
||||
<SelfContained>true</SelfContained>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
|
@ -7,10 +7,10 @@ public static class Program
|
||||
// Initialization code. Don't use any Avalonia, third-party APIs or any
|
||||
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
||||
// yet and stuff might break.
|
||||
public static void Main(string[] args) => BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
|
||||
public static void Main(string[] args) =>
|
||||
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
|
||||
|
||||
// Avalonia configuration, don't remove; also used by visual designer.
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
=> AppBuilder.Configure<App>().UsePlatformDetect()
|
||||
.LogToTrace();
|
||||
}
|
||||
public static AppBuilder BuildAvaloniaApp() =>
|
||||
AppBuilder.Configure<App>().UsePlatformDetect().LogToTrace();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user