Filtration/Filtration.ObjectModel/BlockItemBaseTypes/ActionBlockItem.cs

85 lines
2.0 KiB
C#
Raw Normal View History

using System.Windows.Media;
2015-06-24 14:57:16 -04:00
using Filtration.ObjectModel.Enums;
using Filtration.ObjectModel.Extensions;
using Filtration.ObjectModel.LootExplosionStudio;
2015-06-04 13:15:54 -04:00
2015-06-24 14:57:16 -04:00
namespace Filtration.ObjectModel.BlockItemBaseTypes
2015-06-04 13:15:54 -04:00
{
2015-06-24 14:57:16 -04:00
public class ActionBlockItem : BlockItemBase
2015-06-04 13:15:54 -04:00
{
private BlockAction _action;
public ActionBlockItem(BlockAction action)
{
Action = action;
}
public BlockAction Action
{
get { return _action; }
set
{
_action = value;
OnPropertyChanged();
OnPropertyChanged("SummaryText");
OnPropertyChanged("SummaryBackgroundColor");
OnPropertyChanged("SummaryTextColor");
}
}
2015-06-23 17:21:10 -04:00
public override string OutputText
{
get { return Action.GetAttributeDescription(); }
}
public override string PrefixText
2015-06-04 13:15:54 -04:00
{
get { return string.Empty; }
}
public override int MaximumAllowed
2015-06-04 13:15:54 -04:00
{
get { return 1; }
}
public override string DisplayHeading
2015-06-04 13:15:54 -04:00
{
get
{
return "Action";
}
}
public override string SummaryText
2015-06-04 13:15:54 -04:00
{
get
{
return Action == BlockAction.Show ? "Show" : "Hide";
}
}
public override Color SummaryBackgroundColor
2015-06-04 13:15:54 -04:00
{
get
{
return Action == BlockAction.Show ? Colors.LimeGreen : Colors.OrangeRed;
}
}
public override Color SummaryTextColor
2015-06-04 13:15:54 -04:00
{
get
{
return Action == BlockAction.Show ? Colors.Black : Colors.White;
}
}
public override int SortOrder { get { return 0; } }
2015-06-04 13:15:54 -04:00
public void ToggleAction()
2015-06-04 13:15:54 -04:00
{
Action = Action == BlockAction.Show ? BlockAction.Hide : BlockAction.Show;
2015-06-04 13:15:54 -04:00
}
}
}