using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using Microsoft.Research.DynamicDataDisplay.Common;
namespace Microsoft.Research.DynamicDataDisplay.ViewportConstraints
{
///
/// Represents a base class for all constraints that are being applied to viewport's visible rect.
///
public abstract class ViewportConstraint
{
///
/// Applies the constraint.
///
/// Previous data rectangle.
/// Proposed data rectangle.
/// The viewport, to which current restriction is being applied.
/// New changed visible rectangle.
public abstract DataRect Apply(DataRect previousDataRect, DataRect proposedDataRect, Viewport2D viewport);
///
/// Raises the changed event.
///
protected void RaiseChanged()
{
Changed.Raise(this);
}
///
/// Occurs when constraint changes.
/// Causes update of 's Visible property.
///
public event EventHandler Changed;
}
}