mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
* project converted to sdk style * image resizer core31 * image resizer test core31 * project and setup fixes
28 lines
852 B
C#
28 lines
852 B
C#
// Copyright (c) Microsoft Corporation
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System.ComponentModel;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace ImageResizer.Helpers
|
|
{
|
|
public class Observable : INotifyPropertyChanged
|
|
{
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
protected void Set<T>(ref T storage, T value, [CallerMemberName] string propertyName = null)
|
|
{
|
|
if (Equals(storage, value))
|
|
{
|
|
return;
|
|
}
|
|
|
|
storage = value;
|
|
OnPropertyChanged(propertyName);
|
|
}
|
|
|
|
protected void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
}
|