using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;


namespace CustomControls
{
    /// <summary>
    /// Interakční logika pro BackgroudBox.xaml
    /// </summary>
    public partial class BackgroudBox : UserControl
    {
        public BackgroudBox()
        {
            InitializeComponent();
            LayoutRoot.DataContext = this;
        }

        public enum Positions { Left, Center, Right }

        public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register("Header", typeof(string), typeof(BackgroudBox));
        public string Header
        {
            get { return (string)GetValue(HeaderProperty); }
            set { SetValueDp(HeaderProperty, value); }
        }

        public static readonly DependencyProperty HeaderHeightProperty = DependencyProperty.Register("HeaderHeight", typeof(int), typeof(BackgroudBox));
        public int HeaderHeight
        {
            get { return (int)GetValue(HeaderHeightProperty); }
            set { SetValueDp(HeaderHeightProperty, value); }
        }

        public static readonly DependencyProperty HeaderPositionProperty = DependencyProperty.Register("HeaderPosition", typeof(Positions), typeof(BackgroudBox));
        public Positions HeaderPosition
        {
            get { return (Positions)GetValue(HeaderPositionProperty); }
            set { SetValueDp(HeaderPositionProperty, value); }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        void SetValueDp(DependencyProperty property, object value, [System.Runtime.CompilerServices.CallerMemberName] string p = null)
        {
            SetCurrentValue(property, value);
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(p));
        }
    }
}
