mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-08-16 09:31:40 +02:00
.github
.idea
.vscode
app
.idea
Desktop
Resources
Server
Utils
Collections
Compression
Http
Logging
Models
BaseModel.cs
Resources
Utils.csproj
.gitignore
DiscordHistoryTracker.sln
Version.cs
build.bat
build.sh
empty.dht
global.json
minify.py
bld
lib
src
tools
web
.gitattributes
.gitignore
LICENSE.md
README.md
build.py
reserve.txt
23 lines
724 B
C#
23 lines
724 B
C#
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Runtime.CompilerServices;
|
|
using JetBrains.Annotations;
|
|
|
|
namespace DHT.Utils.Models {
|
|
public abstract class BaseModel : INotifyPropertyChanged {
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
[NotifyPropertyChangedInvocator]
|
|
protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) {
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
|
|
protected void Change<T>(ref T field, T newValue, [CallerMemberName] string? propertyName = null) {
|
|
if (!EqualityComparer<T>.Default.Equals(field, newValue)) {
|
|
field = newValue;
|
|
OnPropertyChanged(propertyName);
|
|
}
|
|
}
|
|
}
|
|
}
|