Sostituisce WinForms, WebView2 e ui.html con una GUI Avalonia (XAML, ViewModel, tema chiaro/scuro) e un renderer markdown che trasforma l'albero di Markdig in controlli. Un solo progetto net10.0 per Windows e Linux, con publish single-file compresso. L'avvio di claude è in un solo punto (Core/Claude.cs) condiviso da CLI e GUI. Il nome dell'app viene dall'AssemblyName; ChatStore migra la cartella dati LlmRun alla nuova. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
29 lines
961 B
C#
29 lines
961 B
C#
using System.ComponentModel;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Windows.Input;
|
|
|
|
namespace AgentWikiUi.Gui;
|
|
|
|
class ObservableObject : INotifyPropertyChanged
|
|
{
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
protected bool Set<T>(ref T field, T value, [CallerMemberName] string? name = null)
|
|
{
|
|
if (EqualityComparer<T>.Default.Equals(field, value)) return false;
|
|
field = value;
|
|
Raise(name);
|
|
return true;
|
|
}
|
|
|
|
protected void Raise([CallerMemberName] string? name = null) => PropertyChanged?.Invoke(this, new(name));
|
|
}
|
|
|
|
class RelayCommand<T>(Action<T?> run, Func<bool>? canRun = null) : ICommand
|
|
{
|
|
public event EventHandler? CanExecuteChanged;
|
|
public bool CanExecute(object? parameter) => canRun?.Invoke() ?? true;
|
|
public void Execute(object? parameter) => run(parameter is T t ? t : default);
|
|
public void Refresh() => CanExecuteChanged?.Invoke(this, EventArgs.Empty);
|
|
}
|