-
-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
130 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
using JetBrains.Annotations; | ||
|
||
namespace Showcase.WPF.DragDrop.Models | ||
{ | ||
public class ItemModel : INotifyPropertyChanged | ||
{ | ||
private double _bindableDoubleValue; | ||
|
||
public ItemModel(int itemIndex) | ||
{ | ||
this.Caption = $"Item {itemIndex}"; | ||
this.BindableDoubleValue = Faker.RandomNumber.Next(0, 100); | ||
} | ||
|
||
public string Caption { get; set; } | ||
|
||
public double BindableDoubleValue | ||
{ | ||
get { return _bindableDoubleValue; } | ||
set | ||
{ | ||
if (value.Equals(_bindableDoubleValue)) return; | ||
_bindableDoubleValue = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return this.Caption; | ||
} | ||
|
||
public event PropertyChangedEventHandler PropertyChanged; | ||
|
||
[NotifyPropertyChangedInvocator] | ||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) | ||
{ | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
} | ||
} |
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