Skip to content

Commit

Permalink
Avalonia 11.1.3 with VSCode.
Browse files Browse the repository at this point in the history
  • Loading branch information
torum committed Sep 9, 2024
1 parent baed204 commit c3d61e1
Show file tree
Hide file tree
Showing 42 changed files with 346 additions and 666 deletions.
26 changes: 26 additions & 0 deletions MPDCtrl-AvaloniaUI/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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/dotnet/vscode-csharp/blob/main/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/net8.0/MPDCtrlX.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 changes: 41 additions & 0 deletions MPDCtrl-AvaloniaUI/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/MPDCtrlX.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/MPDCtrlX.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/MPDCtrlX.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
17 changes: 17 additions & 0 deletions MPDCtrl-AvaloniaUI/App.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="MPDCtrlX.App"
xmlns:local="using:MPDCtrlX"
RequestedThemeVariant="Default">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->

<Application.DataTemplates>
<local:ViewLocator/>
</Application.DataTemplates>

<Application.Styles>
<!--
<FluentTheme DensityStyle="Compact"/> -->
<SimpleTheme/>
</Application.Styles>
</Application>
60 changes: 60 additions & 0 deletions MPDCtrl-AvaloniaUI/App.axaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Data.Core;
using Avalonia.Data.Core.Plugins;
using Avalonia.Markup.Xaml;
using MPDCtrlX.ViewModels;
using MPDCtrlX.Views;
using System;
using System.IO;
using System.Text;

namespace MPDCtrlX;

public partial class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}

public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
// Line below is needed to remove Avalonia data validation.
// Without this line you will get duplicate validations from both Avalonia and CT
BindingPlugins.DataValidators.RemoveAt(0);
desktop.MainWindow = new MainWindow
{
DataContext = new MainWindowViewModel(),
};
}

base.OnFrameworkInitializationCompleted();
}

private static StringBuilder Errortxt = new StringBuilder();
public static bool IsSaveErrorLog;
public static string LogFilePath = string.Empty;
public static void AppendErrorLog(string errorTxt, string kindTxt)
{
DateTime dt = DateTime.Now;
string nowString = dt.ToString("yyyy/MM/dd HH:mm:ss");

Errortxt.AppendLine(nowString + " - " + kindTxt + " - " + errorTxt);
}

public static void SaveErrorLog()
{
if (!IsSaveErrorLog)
return;

if (string.IsNullOrEmpty(LogFilePath))
return;

string s = Errortxt.ToString();
if (!string.IsNullOrEmpty(s))
File.WriteAllText(LogFilePath, s);
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Windows;
using System.Windows.Input;

namespace MPDCtrl.Common
namespace MPDCtrlX.Common
{
/// <summary>
/// GenericRelayCommand
Expand Down
6 changes: 0 additions & 6 deletions MPDCtrl-AvaloniaUI/Directory.Build.props

This file was deleted.

24 changes: 0 additions & 24 deletions MPDCtrl-AvaloniaUI/MPDCtrl.Desktop/MPDCtrl.Desktop.csproj

This file was deleted.

23 changes: 0 additions & 23 deletions MPDCtrl-AvaloniaUI/MPDCtrl.Desktop/Program.cs

This file was deleted.

50 changes: 0 additions & 50 deletions MPDCtrl-AvaloniaUI/MPDCtrl.sln

This file was deleted.

13 changes: 0 additions & 13 deletions MPDCtrl-AvaloniaUI/MPDCtrl/App.axaml

This file was deleted.

72 changes: 0 additions & 72 deletions MPDCtrl-AvaloniaUI/MPDCtrl/App.axaml.cs

This file was deleted.

Loading

0 comments on commit c3d61e1

Please sign in to comment.