commit 72b5da766b8d19448ec19b9cbe75e2953749f4ce Author: Egor Date: Mon Mar 16 22:22:23 2026 +0200 Init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..add57be --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +bin/ +obj/ +/packages/ +riderModule.iml +/_ReSharper.Caches/ \ No newline at end of file diff --git a/.idea/.idea.VisionAsist/.idea/.gitignore b/.idea/.idea.VisionAsist/.idea/.gitignore new file mode 100644 index 0000000..23e698d --- /dev/null +++ b/.idea/.idea.VisionAsist/.idea/.gitignore @@ -0,0 +1,15 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/modules.xml +/contentModel.xml +/projectSettingsUpdater.xml +/.idea.VisionAsist.iml +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/.idea.VisionAsist/.idea/encodings.xml b/.idea/.idea.VisionAsist/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.VisionAsist/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.VisionAsist/.idea/indexLayout.xml b/.idea/.idea.VisionAsist/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.VisionAsist/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.VisionAsist/.idea/vcs.xml b/.idea/.idea.VisionAsist/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/.idea.VisionAsist/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/VisionAsist.sln b/VisionAsist.sln new file mode 100644 index 0000000..cdf00ec --- /dev/null +++ b/VisionAsist.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisionAsist", "VisionAsist\VisionAsist.csproj", "{C5BD9C58-AE7A-4BBA-8700-1E71F48DBCA0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C5BD9C58-AE7A-4BBA-8700-1E71F48DBCA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5BD9C58-AE7A-4BBA-8700-1E71F48DBCA0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5BD9C58-AE7A-4BBA-8700-1E71F48DBCA0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5BD9C58-AE7A-4BBA-8700-1E71F48DBCA0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/VisionAsist/App.axaml b/VisionAsist/App.axaml new file mode 100644 index 0000000..632f1a6 --- /dev/null +++ b/VisionAsist/App.axaml @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/VisionAsist/App.axaml.cs b/VisionAsist/App.axaml.cs new file mode 100644 index 0000000..d9379a9 --- /dev/null +++ b/VisionAsist/App.axaml.cs @@ -0,0 +1,47 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Data.Core; +using Avalonia.Data.Core.Plugins; +using System.Linq; +using Avalonia.Markup.Xaml; +using VisionAsist.ViewModels; +using VisionAsist.Views; + +namespace VisionAsist; + +public partial class App : Application +{ + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + // Avoid duplicate validations from both Avalonia and the CommunityToolkit. + // More info: https://docs.avaloniaui.net/docs/guides/development-guides/data-validation#manage-validationplugins + DisableAvaloniaDataAnnotationValidation(); + desktop.MainWindow = new MainWindow + { + DataContext = new MainWindowViewModel(), + }; + } + + base.OnFrameworkInitializationCompleted(); + } + + private void DisableAvaloniaDataAnnotationValidation() + { + // Get an array of plugins to remove + var dataValidationPluginsToRemove = + BindingPlugins.DataValidators.OfType().ToArray(); + + // remove each entry found + foreach (var plugin in dataValidationPluginsToRemove) + { + BindingPlugins.DataValidators.Remove(plugin); + } + } +} \ No newline at end of file diff --git a/VisionAsist/Assets/avalonia-logo.ico b/VisionAsist/Assets/avalonia-logo.ico new file mode 100644 index 0000000..f7da8bb Binary files /dev/null and b/VisionAsist/Assets/avalonia-logo.ico differ diff --git a/VisionAsist/Program.cs b/VisionAsist/Program.cs new file mode 100644 index 0000000..724369f --- /dev/null +++ b/VisionAsist/Program.cs @@ -0,0 +1,21 @@ +using Avalonia; +using System; + +namespace VisionAsist; + +sealed 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. + [STAThread] + 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() + .UsePlatformDetect() + .WithInterFont() + .LogToTrace(); +} \ No newline at end of file diff --git a/VisionAsist/ViewLocator.cs b/VisionAsist/ViewLocator.cs new file mode 100644 index 0000000..c12a500 --- /dev/null +++ b/VisionAsist/ViewLocator.cs @@ -0,0 +1,37 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using Avalonia.Controls; +using Avalonia.Controls.Templates; +using VisionAsist.ViewModels; + +namespace VisionAsist; + +/// +/// Given a view model, returns the corresponding view if possible. +/// +[RequiresUnreferencedCode( + "Default implementation of ViewLocator involves reflection which may be trimmed away.", + Url = "https://docs.avaloniaui.net/docs/concepts/view-locator")] +public class ViewLocator : IDataTemplate +{ + public Control? Build(object? param) + { + if (param is null) + return null; + + var name = param.GetType().FullName!.Replace("ViewModel", "View", StringComparison.Ordinal); + var type = Type.GetType(name); + + if (type != null) + { + return (Control)Activator.CreateInstance(type)!; + } + + return new TextBlock { Text = "Not Found: " + name }; + } + + public bool Match(object? data) + { + return data is ViewModelBase; + } +} \ No newline at end of file diff --git a/VisionAsist/ViewModels/MainWindowViewModel.cs b/VisionAsist/ViewModels/MainWindowViewModel.cs new file mode 100644 index 0000000..8045d8a --- /dev/null +++ b/VisionAsist/ViewModels/MainWindowViewModel.cs @@ -0,0 +1,6 @@ +namespace VisionAsist.ViewModels; + +public partial class MainWindowViewModel : ViewModelBase +{ + public string Greeting { get; } = "Welcome to Avalonia!"; +} \ No newline at end of file diff --git a/VisionAsist/ViewModels/ViewModelBase.cs b/VisionAsist/ViewModels/ViewModelBase.cs new file mode 100644 index 0000000..6791e51 --- /dev/null +++ b/VisionAsist/ViewModels/ViewModelBase.cs @@ -0,0 +1,7 @@ +using CommunityToolkit.Mvvm.ComponentModel; + +namespace VisionAsist.ViewModels; + +public abstract class ViewModelBase : ObservableObject +{ +} \ No newline at end of file diff --git a/VisionAsist/Views/MainWindow.axaml b/VisionAsist/Views/MainWindow.axaml new file mode 100644 index 0000000..61252da --- /dev/null +++ b/VisionAsist/Views/MainWindow.axaml @@ -0,0 +1,20 @@ + + + + + + + + + + diff --git a/VisionAsist/Views/MainWindow.axaml.cs b/VisionAsist/Views/MainWindow.axaml.cs new file mode 100644 index 0000000..516c572 --- /dev/null +++ b/VisionAsist/Views/MainWindow.axaml.cs @@ -0,0 +1,11 @@ +using Avalonia.Controls; + +namespace VisionAsist.Views; + +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/VisionAsist/VisionAsist.csproj b/VisionAsist/VisionAsist.csproj new file mode 100644 index 0000000..8f13b3a --- /dev/null +++ b/VisionAsist/VisionAsist.csproj @@ -0,0 +1,27 @@ + + + WinExe + net10.0 + enable + app.manifest + true + + + + + + + + + + + + + + + None + All + + + + diff --git a/VisionAsist/app.manifest b/VisionAsist/app.manifest new file mode 100644 index 0000000..83c0a6d --- /dev/null +++ b/VisionAsist/app.manifest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + +