mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
UI - Add PropertyChanged.SourceGenerator and use it in the profile editor
This commit is contained in:
1 parent
fb6845be5d
commit
6921561317
24 files changed
+139
-311
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user