// -----------------------------------------------------------------------
//
// Copyright 2015 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
namespace Perspex
{
using System;
using System.Collections.Generic;
using System.Reactive.Disposables;
internal class PriorityLevel
{
private Action changed;
private object directValue;
private int nextIndex;
public PriorityLevel(
int priority,
Action changed)
{
Contract.Requires(changed != null);
this.changed = changed;
this.Priority = priority;
this.Value = this.directValue = PerspexProperty.UnsetValue;
this.ActiveBindingIndex = -1;
this.Bindings = new LinkedList();
}
public int Priority { get; }
public object DirectValue
{
get
{
return this.directValue;
}
set
{
this.Value = this.directValue = value;
this.changed(this);
}
}
public object Value { get; private set; }
public int ActiveBindingIndex { get; private set; }
public LinkedList Bindings { get; }
public IDisposable Add(IObservable