using Core.Common.Controls.Commands;
using Core.Plugins.OxyPlot.Legend;
namespace Core.Plugins.OxyPlot.Commands
{
///
/// This class describes commands which control the state of a and uses a
/// to do so. The state of this command is determined by the state of the .
///
public class ToggleLegendViewCommand : ICommand
{
private readonly LegendController controller;
///
/// Creates a new instance of .
///
/// The to use to invoke actions and determine state.
public ToggleLegendViewCommand(LegendController controller)
{
this.controller = controller;
}
public bool Enabled
{
get
{
return true;
}
}
public bool Checked
{
get
{
return controller.IsLegendViewOpen();
}
}
public void Execute(params object[] arguments)
{
controller.ToggleLegend();
}
}
}