|
@@ -1,32 +1,38 @@
|
|
|
using System.Windows;
|
|
|
using NPOI.OpenXmlFormats.Spreadsheet;
|
|
|
|
|
|
-namespace InABox.DynamicGrid
|
|
|
+namespace InABox.DynamicGrid;
|
|
|
+
|
|
|
+public partial class DynamicContentDialog : Window
|
|
|
{
|
|
|
- public partial class DynamicContentDialog : Window
|
|
|
+ public static readonly DependencyProperty CanSaveProperty = DependencyProperty.Register(nameof(CanSave), typeof(bool), typeof(DynamicContentDialog));
|
|
|
+
|
|
|
+ public bool ButtonsVisible
|
|
|
{
|
|
|
-
|
|
|
- public bool ButtonsVisible
|
|
|
- {
|
|
|
- get => Buttons.Visibility == Visibility.Visible;
|
|
|
- set => Buttons.Visibility = value ? Visibility.Visible : Visibility.Collapsed;
|
|
|
- }
|
|
|
+ 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;
|
|
|
- }
|
|
|
+ public bool CanSave
|
|
|
+ {
|
|
|
+ get => (bool)GetValue(CanSaveProperty);
|
|
|
+ set => SetValue(CanSaveProperty, value);
|
|
|
+ }
|
|
|
|
|
|
- private void OK_OnClick(object sender, RoutedEventArgs e)
|
|
|
- {
|
|
|
- DialogResult = true;
|
|
|
- }
|
|
|
+ public DynamicContentDialog(FrameworkElement element, bool buttonsvisible = true)
|
|
|
+ {
|
|
|
+ InitializeComponent();
|
|
|
+ ButtonsVisible = buttonsvisible;
|
|
|
+ Presenter.Content = element;
|
|
|
+ }
|
|
|
|
|
|
- private void Cancel_OnClick(object sender, RoutedEventArgs e)
|
|
|
- {
|
|
|
- DialogResult = false;
|
|
|
- }
|
|
|
+ private void OKButton_Click(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ DialogResult = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void CancelButton_Click(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ DialogResult = false;
|
|
|
}
|
|
|
}
|