Compare commits
3 commits
4ff9b78db8
...
4b8a346cfb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b8a346cfb | ||
|
|
26259543b3 | ||
|
|
114542b317 |
40 changed files with 239 additions and 247 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using Npgsql;
|
|
||||||
|
|
||||||
namespace pgLabII.PgUtils.Tests.ConnectionStrings;
|
namespace pgLabII.PgUtils.Tests.ConnectionStrings;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using System.Collections.Generic;
|
using Npgsql;
|
||||||
using Npgsql;
|
|
||||||
using pgLabII.PgUtils.ConnectionStrings;
|
using pgLabII.PgUtils.ConnectionStrings;
|
||||||
|
|
||||||
namespace pgLabII.PgUtils.Tests.ConnectionStrings;
|
namespace pgLabII.PgUtils.Tests.ConnectionStrings;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using System.Collections.Generic;
|
using Npgsql;
|
||||||
using Npgsql;
|
|
||||||
using pgLabII.PgUtils.ConnectionStrings;
|
using pgLabII.PgUtils.ConnectionStrings;
|
||||||
|
|
||||||
namespace pgLabII.PgUtils.Tests.ConnectionStrings;
|
namespace pgLabII.PgUtils.Tests.ConnectionStrings;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using FluentResults;
|
namespace pgLabII.PgUtils.Tests.ConnectionStrings.Util;
|
||||||
|
|
||||||
namespace pgLabII.PgUtils.Tests.ConnectionStrings.Util;
|
|
||||||
|
|
||||||
public class UnitTestTokenizerTests
|
public class UnitTestTokenizerTests
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
using System;
|
using System.Globalization;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Npgsql;
|
using Npgsql;
|
||||||
|
|
||||||
namespace pgLabII.PgUtils.ConnectionStrings;
|
namespace pgLabII.PgUtils.ConnectionStrings;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
using System;
|
using FluentResults;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using FluentResults;
|
|
||||||
|
|
||||||
namespace pgLabII.PgUtils.ConnectionStrings;
|
namespace pgLabII.PgUtils.ConnectionStrings;
|
||||||
|
|
||||||
|
|
@ -26,7 +23,7 @@ public sealed class ConnectionStringService : IConnectionStringService
|
||||||
public static ConnectionStringService CreateDefault()
|
public static ConnectionStringService CreateDefault()
|
||||||
=> new(new IConnectionStringCodec[] { new LibpqCodec(), new NpgsqlCodec(), new UrlCodec(), new JdbcCodec() });
|
=> new(new IConnectionStringCodec[] { new LibpqCodec(), new NpgsqlCodec(), new UrlCodec(), new JdbcCodec() });
|
||||||
|
|
||||||
public Result<ConnStringFormat> DetectFormat(string input)
|
public Result<ConnStringFormat> DetectFormat(string? input)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(input))
|
if (string.IsNullOrWhiteSpace(input))
|
||||||
return Result.Fail<ConnStringFormat>("Empty input");
|
return Result.Fail<ConnStringFormat>("Empty input");
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using System.Collections.Generic;
|
namespace pgLabII.PgUtils.ConnectionStrings;
|
||||||
|
|
||||||
namespace pgLabII.PgUtils.ConnectionStrings;
|
|
||||||
|
|
||||||
public sealed class HostEndpoint
|
public sealed class HostEndpoint
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ namespace pgLabII.PgUtils.ConnectionStrings;
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IConnectionStringService
|
public interface IConnectionStringService
|
||||||
{
|
{
|
||||||
Result<ConnStringFormat> DetectFormat(string input);
|
Result<ConnStringFormat> DetectFormat(string? input);
|
||||||
|
|
||||||
Result<ConnectionDescriptor> ParseToDescriptor(string input);
|
Result<ConnectionDescriptor> ParseToDescriptor(string input);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
using System;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
using Npgsql;
|
|
||||||
|
|
||||||
namespace pgLabII.PgUtils.ConnectionStrings;
|
namespace pgLabII.PgUtils.ConnectionStrings;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
using System.Collections;
|
using System.Data.Common;
|
||||||
using System.Data.Common;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Text;
|
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
using Npgsql;
|
using Npgsql;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using System.Collections.ObjectModel;
|
using FluentResults;
|
||||||
using FluentResults;
|
|
||||||
using Npgsql;
|
using Npgsql;
|
||||||
|
|
||||||
namespace pgLabII.PgUtils.ConnectionStrings;
|
namespace pgLabII.PgUtils.ConnectionStrings;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using FluentResults;
|
using FluentResults;
|
||||||
using static System.Net.Mime.MediaTypeNames;
|
|
||||||
|
|
||||||
namespace pgLabII.PgUtils.ConnectionStrings;
|
namespace pgLabII.PgUtils.ConnectionStrings;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ using Avalonia.Markup.Xaml;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using pgLabII.Infra;
|
using pgLabII.Infra;
|
||||||
using pgLabII.ViewModels;
|
|
||||||
using pgLabII.Views;
|
using pgLabII.Views;
|
||||||
|
|
||||||
namespace pgLabII;
|
namespace pgLabII;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,4 @@
|
||||||
using System;
|
namespace pgLabII.ConnectionManager;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace pgLabII.ConnectionManager;
|
|
||||||
internal class ConnectionRepository
|
internal class ConnectionRepository
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using System.Collections.Generic;
|
using pgLabII.Model;
|
||||||
using pgLabII.Model;
|
|
||||||
using pgLabII.Views.Controls;
|
|
||||||
|
|
||||||
namespace pgLabII;
|
namespace pgLabII;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System.Text;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace pgLabII;
|
namespace pgLabII;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using System;
|
using System.Timers;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Timers;
|
|
||||||
using pgLabII.Infra;
|
using pgLabII.Infra;
|
||||||
using pgLabII.Model;
|
using pgLabII.Model;
|
||||||
|
|
||||||
|
|
@ -13,7 +11,7 @@ public class EditHistoryManager : IEditHistoryManager
|
||||||
private readonly List<EditHistoryEntry> _pendingEdits = new();
|
private readonly List<EditHistoryEntry> _pendingEdits = new();
|
||||||
private EditBuffer? _currentBuffer;
|
private EditBuffer? _currentBuffer;
|
||||||
private const int BufferTimeoutMs = 500;
|
private const int BufferTimeoutMs = 500;
|
||||||
private readonly Timer _idleFlushTimer;
|
private readonly System.Timers.Timer _idleFlushTimer;
|
||||||
private readonly object _sync = new object();
|
private readonly object _sync = new object();
|
||||||
|
|
||||||
public EditHistoryManager(LocalDb db, Document document)
|
public EditHistoryManager(LocalDb db, Document document)
|
||||||
|
|
@ -21,7 +19,7 @@ public class EditHistoryManager : IEditHistoryManager
|
||||||
_db = db;
|
_db = db;
|
||||||
_document = document;
|
_document = document;
|
||||||
|
|
||||||
_idleFlushTimer = new Timer(BufferTimeoutMs)
|
_idleFlushTimer = new (BufferTimeoutMs)
|
||||||
{
|
{
|
||||||
AutoReset = false,
|
AutoReset = false,
|
||||||
Enabled = false
|
Enabled = false
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using System;
|
namespace pgLabII;
|
||||||
|
|
||||||
namespace pgLabII;
|
|
||||||
|
|
||||||
public class EditOperation
|
public class EditOperation
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using System;
|
using Avalonia.Media;
|
||||||
using Avalonia.Controls.Shapes;
|
|
||||||
using Avalonia.Media;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||||
using pgLabII.Model;
|
using pgLabII.Model;
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ namespace pgLabII.Migrations
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.ToTable("Documents");
|
b.ToTable("Documents", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("pgLabII.Model.EditHistoryEntry", b =>
|
modelBuilder.Entity("pgLabII.Model.EditHistoryEntry", b =>
|
||||||
|
|
@ -69,7 +69,7 @@ namespace pgLabII.Migrations
|
||||||
|
|
||||||
b.HasIndex("DocumentId", "Timestamp");
|
b.HasIndex("DocumentId", "Timestamp");
|
||||||
|
|
||||||
b.ToTable("EditHistory");
|
b.ToTable("EditHistory", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("pgLabII.Model.ServerConfigurationEntity", b =>
|
modelBuilder.Entity("pgLabII.Model.ServerConfigurationEntity", b =>
|
||||||
|
|
@ -112,7 +112,7 @@ namespace pgLabII.Migrations
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.ToTable("ServerConfigurations");
|
b.ToTable("ServerConfigurations", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("pgLabII.Model.EditHistoryEntry", b =>
|
modelBuilder.Entity("pgLabII.Model.EditHistoryEntry", b =>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
using System;
|
namespace pgLabII.Model;
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace pgLabII.Model;
|
|
||||||
|
|
||||||
public class Document
|
public class Document
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using System;
|
namespace pgLabII.Model;
|
||||||
|
|
||||||
namespace pgLabII.Model;
|
|
||||||
|
|
||||||
public class EditHistoryEntry
|
public class EditHistoryEntry
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using Npgsql;
|
||||||
using Npgsql;
|
|
||||||
|
|
||||||
namespace pgLabII.Model;
|
namespace pgLabII.Model;
|
||||||
|
|
||||||
|
|
@ -15,6 +14,5 @@ public class ServerConfigurationEntity
|
||||||
public bool ColorEnabled { get; set; } = true;
|
public bool ColorEnabled { get; set; } = true;
|
||||||
public int ColorArgb { get; set; } = unchecked((int)0xFF_33_33_33); // default dark gray
|
public int ColorArgb { get; set; } = unchecked((int)0xFF_33_33_33); // default dark gray
|
||||||
public string UserName { get; set; } = "";
|
public string UserName { get; set; } = "";
|
||||||
|
|
||||||
public string Password { get; set; } = "";
|
public string Password { get; set; } = "";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using pgLabII.Infra;
|
||||||
using pgLabII.Infra;
|
|
||||||
|
|
||||||
namespace pgLabII.Services;
|
namespace pgLabII.Services;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
using System;
|
using pgLabII.Model;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using Npgsql;
|
|
||||||
using pgLabII.Model;
|
|
||||||
using pgLabII.PgUtils.ConnectionStrings;
|
using pgLabII.PgUtils.ConnectionStrings;
|
||||||
|
|
||||||
namespace pgLabII.Services;
|
namespace pgLabII.Services;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
using System;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Templates;
|
using Avalonia.Controls.Templates;
|
||||||
using pgLabII.ViewModels;
|
|
||||||
|
|
||||||
namespace pgLabII;
|
namespace pgLabII;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,18 @@
|
||||||
using System;
|
using System.Reactive;
|
||||||
using System.Linq;
|
|
||||||
using System.Reactive;
|
|
||||||
using System.Reactive.Linq;
|
using System.Reactive.Linq;
|
||||||
using Npgsql;
|
|
||||||
using pgLabII.Model;
|
using pgLabII.Model;
|
||||||
using pgLabII.PgUtils.ConnectionStrings;
|
using pgLabII.PgUtils.ConnectionStrings;
|
||||||
using pgLabII.Services;
|
using pgLabII.Services;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
|
using ReactiveUI.SourceGenerators;
|
||||||
|
|
||||||
namespace pgLabII.ViewModels;
|
namespace pgLabII.ViewModels;
|
||||||
|
|
||||||
public class EditServerConfigurationViewModel : ViewModelBase
|
public partial class EditServerConfigurationViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
// Prefer new UI VM; keep old model for compatibility by wrapping when needed
|
private readonly IConnectionStringService _service;
|
||||||
public ServerConfigurationViewModel Configuration { get; set; }
|
// Store original for reverting changes
|
||||||
|
private ServerConfigurationViewModel? _originalConfiguration;
|
||||||
// Connection string IO
|
|
||||||
private string _inputConnectionString = string.Empty;
|
|
||||||
public string InputConnectionString
|
|
||||||
{
|
|
||||||
get => _inputConnectionString;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.RaiseAndSetIfChanged(ref _inputConnectionString, value);
|
|
||||||
// auto-detect when input changes and we are in Auto mode
|
|
||||||
if (ForcedFormat == ForcedFormatOption.Auto)
|
|
||||||
{
|
|
||||||
DetectFormat();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum ForcedFormatOption
|
public enum ForcedFormatOption
|
||||||
{
|
{
|
||||||
|
|
@ -40,50 +23,27 @@ public class EditServerConfigurationViewModel : ViewModelBase
|
||||||
Jdbc
|
Jdbc
|
||||||
}
|
}
|
||||||
|
|
||||||
private ForcedFormatOption _forcedFormat = ForcedFormatOption.Auto;
|
public Interaction<bool, bool?> CloseInteraction { get; } = new();
|
||||||
public ForcedFormatOption ForcedFormat
|
// Prefer new UI VM; keep old model for compatibility by wrapping when needed
|
||||||
{
|
public ServerConfigurationViewModel Configuration { get; set; }
|
||||||
get => _forcedFormat;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.RaiseAndSetIfChanged(ref _forcedFormat, value);
|
|
||||||
// When forcing off Auto, clear detected label; when switching to Auto, re-detect
|
|
||||||
if (value == ForcedFormatOption.Auto)
|
|
||||||
DetectFormat();
|
|
||||||
else
|
|
||||||
DetectedFormat = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private ConnStringFormat? _detectedFormat;
|
// Connection string IO
|
||||||
public ConnStringFormat? DetectedFormat
|
[Reactive] public partial string? InputConnectionString { get; set; }
|
||||||
{
|
|
||||||
get => _detectedFormat;
|
|
||||||
private set => this.RaiseAndSetIfChanged(ref _detectedFormat, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
private ConnStringFormat _outputFormat = ConnStringFormat.Url;
|
[Reactive] public partial ForcedFormatOption ForcedFormat { get; set; }
|
||||||
public ConnStringFormat OutputFormat
|
|
||||||
{
|
|
||||||
get => _outputFormat;
|
|
||||||
set => this.RaiseAndSetIfChanged(ref _outputFormat, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
private string _outputConnectionString = string.Empty;
|
[ObservableAsProperty] private ConnStringFormat? _detectedFormat;
|
||||||
public string OutputConnectionString
|
[Reactive] public partial ConnStringFormat OutputFormat { get; set; }
|
||||||
{
|
|
||||||
get => _outputConnectionString;
|
[Reactive] public partial string? OutputConnectionString { get; set; }
|
||||||
set => this.RaiseAndSetIfChanged(ref _outputConnectionString, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> ParseConnectionStringCommand { get; }
|
public ReactiveCommand<Unit, Unit> ParseConnectionStringCommand { get; }
|
||||||
public ReactiveCommand<Unit, Unit> GenerateConnectionStringCommand { get; }
|
public ReactiveCommand<Unit, Unit> GenerateConnectionStringCommand { get; }
|
||||||
public ReactiveCommand<Unit, Unit> CopyOutputConnectionStringCommand { get; }
|
public ReactiveCommand<Unit, Unit> CopyOutputConnectionStringCommand { get; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> SaveAndCloseCommand { get; }
|
public ReactiveCommand<Unit, Unit> SaveCommand { get; }
|
||||||
public ReactiveCommand<Unit, Unit> CloseCommand { get; }
|
public ReactiveCommand<Unit, Unit> RevertCommand { get; }
|
||||||
|
|
||||||
private readonly IConnectionStringService _service;
|
|
||||||
|
|
||||||
public EditServerConfigurationViewModel()
|
public EditServerConfigurationViewModel()
|
||||||
{
|
{
|
||||||
|
|
@ -94,25 +54,31 @@ public class EditServerConfigurationViewModel : ViewModelBase
|
||||||
GenerateConnectionStringCommand = ReactiveCommand.Create(GenerateConnectionString);
|
GenerateConnectionStringCommand = ReactiveCommand.Create(GenerateConnectionString);
|
||||||
CopyOutputConnectionStringCommand = ReactiveCommand.Create(() => { /* no-op placeholder */ });
|
CopyOutputConnectionStringCommand = ReactiveCommand.Create(() => { /* no-op placeholder */ });
|
||||||
|
|
||||||
SaveAndCloseCommand = ReactiveCommand.Create(() => { });
|
SaveCommand = ReactiveCommand.CreateFromTask(Save);
|
||||||
CloseCommand = ReactiveCommand.Create(() => { });
|
RevertCommand = ReactiveCommand.CreateFromTask(Revert);
|
||||||
|
|
||||||
|
_detectedFormatHelper = this.WhenAnyValue(x => x.ForcedFormat, x => x.InputConnectionString,
|
||||||
|
DetectFormat)
|
||||||
|
.ToProperty(this, x => x.DetectedFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EditServerConfigurationViewModel(ServerConfigurationViewModel configuration)
|
public EditServerConfigurationViewModel(ServerConfigurationViewModel configuration)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
Configuration = configuration;
|
Configuration = configuration;
|
||||||
|
InitializeFromCopy();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DetectFormat()
|
private ConnStringFormat? DetectFormat(ForcedFormatOption format, string? input)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(InputConnectionString))
|
if (format != ForcedFormatOption.Auto)
|
||||||
{
|
return null;
|
||||||
DetectedFormat = null;
|
|
||||||
return;
|
if (string.IsNullOrWhiteSpace(input))
|
||||||
}
|
return null;
|
||||||
|
|
||||||
var res = _service.DetectFormat(InputConnectionString);
|
var res = _service.DetectFormat(InputConnectionString);
|
||||||
DetectedFormat = res.IsSuccess ? res.Value : null;
|
return res.IsSuccess ? res.Value : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ParseConnectionString()
|
private void ParseConnectionString()
|
||||||
|
|
@ -173,4 +139,73 @@ public class EditServerConfigurationViewModel : ViewModelBase
|
||||||
if (r.IsSuccess)
|
if (r.IsSuccess)
|
||||||
OutputConnectionString = r.Value;
|
OutputConnectionString = r.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a deep copy of the configuration for editing.
|
||||||
|
/// This ensures changes are isolated until Save is called.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeFromCopy()
|
||||||
|
{
|
||||||
|
_originalConfiguration = Configuration;
|
||||||
|
|
||||||
|
// Create a copy of the entity
|
||||||
|
var copiedEntity = new ServerConfigurationEntity
|
||||||
|
{
|
||||||
|
Id = _originalConfiguration.Entity.Id,
|
||||||
|
Name = _originalConfiguration.Entity.Name,
|
||||||
|
Host = _originalConfiguration.Entity.Host,
|
||||||
|
Port = _originalConfiguration.Entity.Port,
|
||||||
|
InitialDatabase = _originalConfiguration.Entity.InitialDatabase,
|
||||||
|
SslMode = _originalConfiguration.Entity.SslMode,
|
||||||
|
ColorEnabled = _originalConfiguration.Entity.ColorEnabled,
|
||||||
|
ColorArgb = _originalConfiguration.Entity.ColorArgb,
|
||||||
|
UserName = _originalConfiguration.Entity.UserName,
|
||||||
|
Password = _originalConfiguration.Entity.Password
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create a new ViewModel wrapping the copied entity
|
||||||
|
Configuration = new ServerConfigurationViewModel(copiedEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Copies changes from the edited configuration back to the original.
|
||||||
|
/// </summary>
|
||||||
|
private async Task Save()
|
||||||
|
{
|
||||||
|
if (_originalConfiguration == null) return;
|
||||||
|
|
||||||
|
// Copy all properties from the edited configuration back to the original
|
||||||
|
_originalConfiguration.Name = Configuration.Name;
|
||||||
|
_originalConfiguration.Host = Configuration.Host;
|
||||||
|
_originalConfiguration.Port = Configuration.Port;
|
||||||
|
_originalConfiguration.InitialDatabase = Configuration.InitialDatabase;
|
||||||
|
_originalConfiguration.DefaultSslMode = Configuration.DefaultSslMode;
|
||||||
|
_originalConfiguration.ColorEnabled = Configuration.ColorEnabled;
|
||||||
|
_originalConfiguration.Color = Configuration.Color;
|
||||||
|
_originalConfiguration.UserName = Configuration.UserName;
|
||||||
|
_originalConfiguration.Password = Configuration.Password;
|
||||||
|
|
||||||
|
await CloseInteraction.Handle(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reverts to the original configuration, discarding all changes.
|
||||||
|
/// </summary>
|
||||||
|
private async Task Revert()
|
||||||
|
{
|
||||||
|
if (_originalConfiguration == null) return;
|
||||||
|
|
||||||
|
// Copy all properties from the original back to the working configuration
|
||||||
|
Configuration.Name = _originalConfiguration.Name;
|
||||||
|
Configuration.Host = _originalConfiguration.Host;
|
||||||
|
Configuration.Port = _originalConfiguration.Port;
|
||||||
|
Configuration.InitialDatabase = _originalConfiguration.InitialDatabase;
|
||||||
|
Configuration.DefaultSslMode = _originalConfiguration.DefaultSslMode;
|
||||||
|
Configuration.ColorEnabled = _originalConfiguration.ColorEnabled;
|
||||||
|
Configuration.Color = _originalConfiguration.Color;
|
||||||
|
Configuration.UserName = _originalConfiguration.UserName;
|
||||||
|
Configuration.Password = _originalConfiguration.Password;
|
||||||
|
|
||||||
|
await CloseInteraction.Handle(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,4 @@
|
||||||
|
namespace pgLabII.ViewModels;
|
||||||
using System;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
|
|
||||||
namespace pgLabII.ViewModels;
|
|
||||||
|
|
||||||
public class MainViewModel : ViewModelBase
|
public class MainViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
using System;
|
using System.Collections.ObjectModel;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Reactive;
|
using System.Reactive;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Npgsql;
|
using Npgsql;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
using ReactiveUI.SourceGenerators;
|
using ReactiveUI.SourceGenerators;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
using System;
|
using System.Reactive;
|
||||||
using System.Reactive;
|
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
using Npgsql;
|
using Npgsql;
|
||||||
using pgLabII.Model;
|
using pgLabII.Model;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
|
using ReactiveUI.SourceGenerators;
|
||||||
|
|
||||||
namespace pgLabII.ViewModels;
|
namespace pgLabII.ViewModels;
|
||||||
|
|
||||||
// UI ViewModel that wraps the persistence entity
|
// UI ViewModel that wraps the persistence entity
|
||||||
public class ServerConfigurationViewModel : ReactiveObject
|
public partial class ServerConfigurationViewModel : ReactiveObject
|
||||||
{
|
{
|
||||||
private readonly ServerConfigurationEntity _entity;
|
private readonly ServerConfigurationEntity _entity;
|
||||||
|
|
||||||
|
|
@ -17,7 +17,7 @@ public class ServerConfigurationViewModel : ReactiveObject
|
||||||
_entity = entity ?? throw new ArgumentNullException(nameof(entity));
|
_entity = entity ?? throw new ArgumentNullException(nameof(entity));
|
||||||
EditCommand = ReactiveCommand.Create(() =>
|
EditCommand = ReactiveCommand.Create(() =>
|
||||||
{
|
{
|
||||||
var window = new Views.EditServerConfigurationWindow(new(this)) { New = false };
|
var window = new Views.EditServerConfigurationWindow(new(this));
|
||||||
window.Show();
|
window.Show();
|
||||||
});
|
});
|
||||||
ExploreCommand = ReactiveCommand.Create(() =>
|
ExploreCommand = ReactiveCommand.Create(() =>
|
||||||
|
|
@ -25,6 +25,10 @@ public class ServerConfigurationViewModel : ReactiveObject
|
||||||
var window = new Views.SingleDatabaseWindow(entity);
|
var window = new Views.SingleDatabaseWindow(entity);
|
||||||
window.Show();
|
window.Show();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
_backgroundBrushHelper = this.WhenAnyValue(x => x.ColorEnabled, x => x.Color,
|
||||||
|
(enabled, color) => enabled ? new SolidColorBrush(color) : null)
|
||||||
|
.ToProperty(this, x => x.BackgroundBrush);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerConfigurationEntity Entity => _entity;
|
public ServerConfigurationEntity Entity => _entity;
|
||||||
|
|
@ -68,7 +72,7 @@ public class ServerConfigurationViewModel : ReactiveObject
|
||||||
public bool ColorEnabled
|
public bool ColorEnabled
|
||||||
{
|
{
|
||||||
get => _entity.ColorEnabled;
|
get => _entity.ColorEnabled;
|
||||||
set { if (_entity.ColorEnabled != value) { _entity.ColorEnabled = value; this.RaisePropertyChanged(); this.RaisePropertyChanged(nameof(BackgroundBrush)); } }
|
set { if (_entity.ColorEnabled != value) { _entity.ColorEnabled = value; this.RaisePropertyChanged(); } }
|
||||||
}
|
}
|
||||||
|
|
||||||
public Color Color
|
public Color Color
|
||||||
|
|
@ -81,12 +85,12 @@ public class ServerConfigurationViewModel : ReactiveObject
|
||||||
{
|
{
|
||||||
_entity.ColorArgb = argb;
|
_entity.ColorArgb = argb;
|
||||||
this.RaisePropertyChanged();
|
this.RaisePropertyChanged();
|
||||||
this.RaisePropertyChanged(nameof(BackgroundBrush));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IBrush? BackgroundBrush => ColorEnabled ? new SolidColorBrush(Color) : null;
|
//public IBrush? BackgroundBrush => ColorEnabled ? new SolidColorBrush(Color) : null;
|
||||||
|
[ObservableAsProperty] private IBrush? _backgroundBrush;
|
||||||
|
|
||||||
public string UserName
|
public string UserName
|
||||||
{
|
{
|
||||||
|
|
@ -117,6 +121,7 @@ public class ServerConfigurationViewModel : ReactiveObject
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> EditCommand { get; }
|
public ReactiveCommand<Unit, Unit> EditCommand { get; }
|
||||||
public ReactiveCommand<Unit, Unit> ExploreCommand { get; }
|
public ReactiveCommand<Unit, Unit> ExploreCommand { get; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,14 @@ using ReactiveUI;
|
||||||
using System.Reactive;
|
using System.Reactive;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
using pgLabII.Views;
|
using pgLabII.Views;
|
||||||
using pgLabII.Model;
|
using ReactiveUI.SourceGenerators;
|
||||||
|
|
||||||
namespace pgLabII.ViewModels;
|
namespace pgLabII.ViewModels;
|
||||||
|
|
||||||
public class ServerListViewModel : ViewModelBase
|
public partial class ServerListViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
|
[Reactive] public partial ServerConfigurationViewModel? SelectedServerConfiguration { get; set; }
|
||||||
|
|
||||||
public ObservableCollection<ServerConfigurationViewModel> ServerConfigurations { get; } =
|
public ObservableCollection<ServerConfigurationViewModel> ServerConfigurations { get; } =
|
||||||
[
|
[
|
||||||
new (new()
|
new (new()
|
||||||
|
|
@ -19,7 +21,7 @@ public class ServerListViewModel : ViewModelBase
|
||||||
Port = 5418,
|
Port = 5418,
|
||||||
InitialDatabase = "postgres",
|
InitialDatabase = "postgres",
|
||||||
UserName = "postgres",
|
UserName = "postgres",
|
||||||
Password = "admin",
|
Password = "admin"
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
Color = Colors.Aquamarine,
|
Color = Colors.Aquamarine,
|
||||||
|
|
@ -32,22 +34,48 @@ public class ServerListViewModel : ViewModelBase
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
|
||||||
public ReactiveCommand<ServerConfigurationViewModel, Unit> RemoveServerCommand { get; }
|
public ReactiveCommand<ServerConfigurationViewModel?, Unit> ExploreServerCommand { get; }
|
||||||
|
public ReactiveCommand<ServerConfigurationViewModel?, Unit> EditServerCommand { get; }
|
||||||
|
public ReactiveCommand<ServerConfigurationViewModel?, Unit> RemoveServerCommand { get; }
|
||||||
public ReactiveCommand<Unit, Unit> AddServerCommand { get; }
|
public ReactiveCommand<Unit, Unit> AddServerCommand { get; }
|
||||||
|
|
||||||
public ServerListViewModel()
|
public ServerListViewModel()
|
||||||
{
|
{
|
||||||
RemoveServerCommand = ReactiveCommand.Create<ServerConfigurationViewModel, Unit>((sc) =>
|
ExploreServerCommand = ReactiveCommand.Create<ServerConfigurationViewModel?, Unit>((sc) =>
|
||||||
{
|
{
|
||||||
ServerConfigurations.Remove(sc);
|
var conf = sc ?? SelectedServerConfiguration;
|
||||||
|
if (conf is null)
|
||||||
|
return Unit.Default;
|
||||||
|
|
||||||
|
var window = new Views.SingleDatabaseWindow(conf.Entity);
|
||||||
|
window.Show();
|
||||||
|
return Unit.Default;
|
||||||
|
});
|
||||||
|
|
||||||
|
EditServerCommand = ReactiveCommand.Create<ServerConfigurationViewModel?, Unit>((sc) =>
|
||||||
|
{
|
||||||
|
var conf = sc ?? SelectedServerConfiguration;
|
||||||
|
if (conf is null)
|
||||||
|
return Unit.Default;
|
||||||
|
|
||||||
|
EditServerConfigurationWindow window = new(new(conf));
|
||||||
|
window.Show();
|
||||||
|
return Unit.Default;
|
||||||
|
});
|
||||||
|
|
||||||
|
RemoveServerCommand = ReactiveCommand.Create<ServerConfigurationViewModel?, Unit>((sc) =>
|
||||||
|
{
|
||||||
|
var conf = sc ?? SelectedServerConfiguration;
|
||||||
|
if (conf is null)
|
||||||
|
return Unit.Default;
|
||||||
|
|
||||||
|
ServerConfigurations.Remove(conf);
|
||||||
return Unit.Default;
|
return Unit.Default;
|
||||||
});
|
});
|
||||||
|
|
||||||
AddServerCommand = ReactiveCommand.Create(() =>
|
AddServerCommand = ReactiveCommand.Create(() =>
|
||||||
{
|
{
|
||||||
EditServerConfigurationViewModel vm = new();
|
EditServerConfigurationWindow window = new(new());
|
||||||
EditServerConfigurationWindow window = new() { DataContext = vm, New = true };
|
|
||||||
window.Show();
|
window.Show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,8 @@
|
||||||
using System.IO;
|
using Avalonia;
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Data;
|
|
||||||
using AvaloniaEdit.Document;
|
using AvaloniaEdit.Document;
|
||||||
using AvaloniaEdit.TextMate;
|
using AvaloniaEdit.TextMate;
|
||||||
using TextMateSharp.Grammars;
|
using TextMateSharp.Grammars;
|
||||||
using System;
|
|
||||||
using System.Reactive.Linq;
|
|
||||||
|
|
||||||
namespace pgLabII.Views.Controls;
|
namespace pgLabII.Views.Controls;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using Avalonia;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace pgLabII.Views;
|
namespace pgLabII.Views;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<vm:EditServerConfigurationViewModel />
|
<vm:EditServerConfigurationViewModel />
|
||||||
</Design.DataContext>
|
</Design.DataContext>
|
||||||
|
|
||||||
<Grid Margin="12" RowDefinitions="Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="*">
|
<Grid Margin="12" RowDefinitions="Auto,Auto,Auto,Auto" ColumnDefinitions="*">
|
||||||
<!-- Basic Details -->
|
<!-- Basic Details -->
|
||||||
<StackPanel Grid.Row="0" Spacing="6">
|
<StackPanel Grid.Row="0" Spacing="6">
|
||||||
<TextBlock FontWeight="Bold" Text="Details" Margin="0,0,0,4"/>
|
<TextBlock FontWeight="Bold" Text="Details" Margin="0,0,0,4"/>
|
||||||
|
|
@ -93,6 +93,10 @@
|
||||||
<TextBox TextWrapping="Wrap" AcceptsReturn="True" MinHeight="60" IsReadOnly="True" Text="{Binding OutputConnectionString}"/>
|
<TextBox TextWrapping="Wrap" AcceptsReturn="True" MinHeight="60" IsReadOnly="True" Text="{Binding OutputConnectionString}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Spacer / Future buttons row could go here -->
|
<!-- Buttons Row -->
|
||||||
|
<StackPanel Grid.Row="3" Orientation="Horizontal" Spacing="8" Margin="0,12,0,0" HorizontalAlignment="Right">
|
||||||
|
<Button Content="Revert" Command="{Binding RevertCommand}" MinWidth="80"/>
|
||||||
|
<Button Content="Save" Command="{Binding SaveCommand}" MinWidth="80"/>
|
||||||
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,36 @@
|
||||||
using Avalonia;
|
using System.Reactive.Disposables;
|
||||||
using Avalonia.Controls;
|
using Avalonia.ReactiveUI;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using pgLabII.ViewModels;
|
using pgLabII.ViewModels;
|
||||||
|
using ReactiveUI;
|
||||||
|
|
||||||
namespace pgLabII.Views;
|
namespace pgLabII.Views;
|
||||||
|
|
||||||
public partial class EditServerConfigurationWindow : Window
|
public partial class EditServerConfigurationWindow : ReactiveWindow<EditServerConfigurationWindow>
|
||||||
{
|
{
|
||||||
|
private readonly EditServerConfigurationViewModel _viewModel;
|
||||||
public EditServerConfigurationWindow()
|
public EditServerConfigurationWindow()
|
||||||
: this(null)
|
: this(null)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public EditServerConfigurationWindow(EditServerConfigurationViewModel? viewModel)
|
public EditServerConfigurationWindow(EditServerConfigurationViewModel? viewModel)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
DataContext = viewModel ?? new EditServerConfigurationViewModel(
|
DataContext = _viewModel = viewModel ?? new EditServerConfigurationViewModel(
|
||||||
new(new()));
|
new(new()));
|
||||||
|
|
||||||
|
this.WhenActivated(disposables =>
|
||||||
|
{
|
||||||
|
// Subscribe to the CloseInteraction
|
||||||
|
_viewModel!.CloseInteraction.RegisterHandler(interaction =>
|
||||||
|
{
|
||||||
|
//DialogResult = interaction.Input; // true/false/null
|
||||||
|
Close();
|
||||||
|
interaction.SetOutput(true);
|
||||||
|
}).DisposeWith(disposables);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool New { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,56 +15,35 @@
|
||||||
</Design.DataContext>
|
</Design.DataContext>
|
||||||
|
|
||||||
<StackPanel x:Name="ServerList" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
<StackPanel x:Name="ServerList" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
<StackPanel Orientation="Horizontal"
|
||||||
<Button Grid.Column="2" Content="+" Command="{Binding AddServerCommand}"/>
|
HorizontalAlignment="Stretch"
|
||||||
</Grid>
|
VerticalAlignment="Top">
|
||||||
<ListBox x:Name="Servers" ItemsSource="{Binding ServerConfigurations}">
|
<Button Content="New"
|
||||||
<ListBox.ItemTemplate>
|
Command="{Binding AddServerCommand}"/>
|
||||||
<DataTemplate>
|
<Button Content="Edit"
|
||||||
<Border BorderBrush="{Binding BackgroundBrush}" BorderThickness="2">
|
Command="{Binding EditServerCommand}"/>
|
||||||
<Grid ColumnDefinitions="*,*">
|
<Button Content="Open"
|
||||||
<StackPanel
|
Command="{Binding ExploreServerCommand}"/>
|
||||||
Orientation="Vertical"
|
</StackPanel>
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="0">
|
|
||||||
<TextBlock Text="{Binding Name}" FontSize="18" />
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock Text="{Binding Host}" />
|
|
||||||
<TextBlock Text=":" />
|
|
||||||
<TextBlock Text="{Binding Port}" />
|
|
||||||
<TextBlock Text="/" />
|
|
||||||
<TextBlock Text="{Binding InitialDatabase}" />
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
</StackPanel>
|
<DataGrid ItemsSource="{Binding ServerConfigurations}"
|
||||||
|
SelectedItem="{Binding SelectedServerConfiguration, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
AutoGenerateColumns="False"
|
||||||
|
IsReadOnly="True"
|
||||||
|
GridLinesVisibility="All"
|
||||||
|
BorderThickness="1">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
|
||||||
|
<DataGridTextColumn Header="Host" Binding="{Binding Host}" />
|
||||||
|
<DataGridTextColumn Header="Port" Binding="{Binding Port}" />
|
||||||
|
<DataGridTextColumn Header="Db" Binding="{Binding InitialDatabase}" />
|
||||||
|
<DataGridTextColumn Header="User" Binding="{Binding UserName}" />
|
||||||
|
<DataGridTextColumn Header="SSL" Binding="{Binding DefaultSslMode}" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
|
||||||
<StackPanel
|
|
||||||
Orientation="Horizontal"
|
</DataGrid>
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="1">
|
|
||||||
<Button Command="{Binding ExploreCommand}">
|
|
||||||
DB
|
|
||||||
</Button>
|
|
||||||
<Button>Server</Button>
|
|
||||||
<Button Content="...">
|
|
||||||
<Button.Flyout>
|
|
||||||
<MenuFlyout>
|
|
||||||
<MenuItem Header="Edit" Command="{Binding EditCommand}" />
|
|
||||||
<Separator />
|
|
||||||
<MenuItem Header="Remove"
|
|
||||||
Command="{Binding #ServerList.((vm:ServerListViewModel)DataContext).RemoveServerCommand}"
|
|
||||||
CommandParameter="{Binding .}"
|
|
||||||
Foreground="Crimson" />
|
|
||||||
</MenuFlyout>
|
|
||||||
</Button.Flyout>
|
|
||||||
</Button>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
</DataTemplate>
|
|
||||||
</ListBox.ItemTemplate>
|
|
||||||
</ListBox>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using pgLabII.ViewModels;
|
|
||||||
|
|
||||||
namespace pgLabII.Views;
|
namespace pgLabII.Views;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using Avalonia;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace pgLabII.Views;
|
namespace pgLabII.Views;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
using Avalonia;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using pgLabII.Model;
|
using pgLabII.Model;
|
||||||
using pgLabII.ViewModels;
|
using pgLabII.ViewModels;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue