-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from xyx0826/dev
Release 1.6, see changelog
- Loading branch information
Showing
18 changed files
with
394 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using Priceall.Services; | ||
|
||
namespace Priceall.Appraisal | ||
{ | ||
/// <summary> | ||
/// A custom setting supported by an appraisal service. | ||
/// </summary> | ||
/// <typeparam name="T">The type of the setting value.</typeparam> | ||
internal class AppraisalSetting<T> : JsonSetting<T>, INotifyPropertyChanged where T : struct | ||
{ | ||
private Action<T> _onSet; | ||
|
||
public AppraisalSetting(JsonSetting<T> setting, Action<T> onSet = null) : base(setting) | ||
{ | ||
_onSet = onSet; | ||
} | ||
|
||
public override T Value | ||
{ | ||
get => base.Value; | ||
set | ||
{ | ||
// Updates backing setting, fires IPropertyChanged, calls optional action | ||
base.Value = value; | ||
_onSet?.Invoke(value); | ||
OnPropertyChanged(nameof(Value)); | ||
} | ||
} | ||
|
||
#region Binding | ||
public event PropertyChangedEventHandler PropertyChanged; | ||
|
||
protected void OnPropertyChanged(string name) | ||
{ | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); | ||
} | ||
#endregion | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.