Skip to content

Commit

Permalink
refactor: OrderBookLevel to use BindableBase
Browse files Browse the repository at this point in the history
  • Loading branch information
drusteeby committed Jul 22, 2023
1 parent 409cb84 commit 5725bb5
Showing 1 changed file with 11 additions and 45 deletions.
56 changes: 11 additions & 45 deletions Model/OrderBookLevel.cs
Original file line number Diff line number Diff line change
@@ -1,70 +1,36 @@
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Prism.Mvvm;
using System;

namespace VisualHFT.Model
{
public class OrderBookLevel : INotifyPropertyChanged
public class OrderBookLevel : BindableBase
{
public event PropertyChangedEventHandler PropertyChanged;
private void RaisePropertyChanged([CallerMemberName] String propertyName = "")
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
private DateTime _date;
public DateTime Date
{
get { return _date; }
set
{
if (_date != value)
{
_date = value;
RaisePropertyChanged();
}
}
get => _date;
set => SetProperty(ref _date, value);
}

private double _dateIndex;
public double DateIndex
{
get { return _dateIndex; }
set {
if (_dateIndex != value)
{
_dateIndex = value;
RaisePropertyChanged();
}
}
get => _dateIndex;
set => SetProperty(ref _dateIndex, value);
}

private double _price;
public double Price
{
get { return _price ; }
set {
if (_price != value)
{
_price = value;
RaisePropertyChanged();
}

}
get => _price;
set => SetProperty(ref _price, value);
}

private double _size;
public double Size
{
get { return _size; }
set {
if (_size != value)
{
_size = value;
RaisePropertyChanged();
}

}
get => _size;
set => SetProperty(ref _size, value);
}
}
}

0 comments on commit 5725bb5

Please sign in to comment.