using System.Windows;
using NPOI.OpenXmlFormats.Spreadsheet;

namespace InABox.DynamicGrid
{
    public partial class DynamicContentDialog : Window
    {
        
        public bool ButtonsVisible
        {
            get => Buttons.Visibility == Visibility.Visible;
            set => Buttons.Visibility = value ? Visibility.Visible : Visibility.Collapsed;
        }

        public DynamicContentDialog(FrameworkElement element, bool buttonsvisible = true)
        {
            InitializeComponent();
            ButtonsVisible = buttonsvisible;
            Presenter.Content = element;
        }

        private void OK_OnClick(object sender, RoutedEventArgs e)
        {
            DialogResult = true;
        }

        private void Cancel_OnClick(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
        }
    }
}