Avalonia Start

This commit is contained in:
2024-03-10 19:33:34 +01:00
parent 99257c3422
commit 4d1df14fe5
32 changed files with 1284 additions and 3316 deletions

View File

@@ -0,0 +1,24 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using ReactiveUI;
namespace LaDOSE.DesktopApp.Avalonia.Utils;
public abstract class BaseViewModel : ReactiveObject, IRoutableViewModel,INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
protected void RaisePropertyChanged([CallerMemberName] string? propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
protected BaseViewModel(IScreen hostScreen, string? urlPathSegment)
{
UrlPathSegment = urlPathSegment;
HostScreen = hostScreen;
}
public string? UrlPathSegment { get; }
public IScreen HostScreen { get; }
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
namespace LaDOSE.DesktopApp.Avalonia.Utils
{
public static class CustomListExtension
{
public sealed class EqualityComparer<T> : IEqualityComparer<T> where T : class
{
private readonly Func<T, T, bool> _compare;
public EqualityComparer(Func<T, T, bool> c)
{
_compare = c;
}
public bool Equals(T x, T y)
{
return _compare(x, y);
}
public int GetHashCode(T obj)
{
return 0;
}
}
}
}