Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

feat(bar): create `ViewModelBase` for simplifying property change notifications

Lars Berger3111c7d9d9ab
diff --git a/GlazeWM.Bar/Common/ViewModelBase.cs b/GlazeWM.Bar/Common/ViewModelBase.cs
new file mode 100644
index 00000000..d0768d57
--- /dev/null
+++ b/GlazeWM.Bar/Common/ViewModelBase.cs
@@ -0,0 +1,16 @@
+using System.ComponentModel;
+
+namespace GlazeWM.Bar.Common
+{
+ public class ViewModelBase : INotifyPropertyChanged
+ {
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected void OnPropertyChanged(string propertyName)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+
+ public virtual void Dispose() { }
+ }
+}