UI - Add PropertyChanged.SourceGenerator and use it in the profile editor

This commit is contained in:
Robert committed 2023-10-18 22:50:28 +02:00
1 parent fb6845be5d
commit 6921561317
24 files changed
+139 -311

No files matched your search

+37
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Artemis.UI.Shared.Events;
using FluentAvalonia.UI.Controls;
@@ -100,6 +101,24 @@ public abstract class ValidatableViewModelBase : ReactiveValidationObject, IActi
/// <inheritdoc />
public ViewModelActivator Activator { get; } = new();
/// <summary>
/// Raises the property changed event for the provided property.
/// </summary>
/// <param name="args">The event arguments containing the name of the property that changed.</param>
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
{
this.RaisePropertyChanged(args.PropertyName);
}
/// <summary>
/// Raises the property changing event for the provided property.
/// </summary>
/// <param name="args">The event arguments containing the name of the property that is changing.</param>
protected virtual void OnPropertyChanging(PropertyChangingEventArgs args)
{
this.RaisePropertyChanging(args.PropertyName);
}
}
/// <summary>
@@ -153,4 +172,22 @@ public abstract class ViewModelBase : ReactiveObject
this.RaisePropertyChanged(propertyName);
return newValue;
}
/// <summary>
/// Raises the property changed event for the provided property.
/// </summary>
/// <param name="args">The event arguments containing the name of the property that changed.</param>
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
{
this.RaisePropertyChanged(args.PropertyName);
}
/// <summary>
/// Raises the property changing event for the provided property.
/// </summary>
/// <param name="args">The event arguments containing the name of the property that is changing.</param>
protected virtual void OnPropertyChanging(PropertyChangingEventArgs args)
{
this.RaisePropertyChanging(args.PropertyName);
}
}