using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;

namespace ControlExplorer.Controls.Chart
{
    public partial class LegendCheckBox : UserControl
    {
        public LegendCheckBox()
        {
            InitializeComponent();
        }
    }

    public class VisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value is Visibility)
            {
                var vis = (Visibility)value;
                return (vis == Visibility.Visible);
            }

            return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            if (value is bool)
            {
                var bval = (bool)value;
                return bval ? Visibility.Visible : Visibility.Collapsed;
            }
            return value;
        }
    }
}
