DynamicContentDialog.xaml.cs 854 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Windows;
  2. using NPOI.OpenXmlFormats.Spreadsheet;
  3. namespace InABox.DynamicGrid
  4. {
  5. public partial class DynamicContentDialog : Window
  6. {
  7. public bool ButtonsVisible
  8. {
  9. get => Buttons.Visibility == Visibility.Visible;
  10. set => Buttons.Visibility = value ? Visibility.Visible : Visibility.Collapsed;
  11. }
  12. public DynamicContentDialog(FrameworkElement element, bool buttonsvisible = true)
  13. {
  14. InitializeComponent();
  15. ButtonsVisible = buttonsvisible;
  16. Presenter.Content = element;
  17. }
  18. private void OK_OnClick(object sender, RoutedEventArgs e)
  19. {
  20. DialogResult = true;
  21. }
  22. private void Cancel_OnClick(object sender, RoutedEventArgs e)
  23. {
  24. DialogResult = false;
  25. }
  26. }
  27. }