|
|
@@ -28,6 +28,45 @@ namespace InABox.DynamicGrid
|
|
|
|
|
|
public interface IDynamicEditorForm
|
|
|
{
|
|
|
+ public delegate Document? FindDocumentEvent(string FileName);
|
|
|
+ public delegate Document? GetDocumentEvent(Guid id);
|
|
|
+ public delegate void SaveDocumentEvent(Document document);
|
|
|
+
|
|
|
+ public event OnValidateData? OnValidateData;
|
|
|
+
|
|
|
+ public event OnCustomiseColumns? OnCustomiseColumns;
|
|
|
+ public event OnDefineFilter? OnDefineFilter;
|
|
|
+
|
|
|
+ public event OnDefineLookup? OnDefineLookups;
|
|
|
+ public event OnLookupsDefined? OnLookupsDefined;
|
|
|
+
|
|
|
+ public event DefineEditorEventHandler? OnDefineEditor;
|
|
|
+ public event OnFormCustomiseEditor? OnFormCustomiseEditor;
|
|
|
+ public event OnReconfigureEditors? ReconfigureEditors;
|
|
|
+
|
|
|
+ public event EditorValueChangedHandler? OnEditorValueChanged;
|
|
|
+
|
|
|
+ public event GetDocumentEvent? OnGetDocument;
|
|
|
+ public event FindDocumentEvent? OnFindDocument;
|
|
|
+ public event SaveDocumentEvent? OnSaveDocument;
|
|
|
+
|
|
|
+ public event OnSelectPage? OnSelectPage;
|
|
|
+
|
|
|
+ public event DynamicGridSaveEvent? OnSaveItem;
|
|
|
+
|
|
|
+
|
|
|
+ DynamicEditorPages? Pages { get; }
|
|
|
+
|
|
|
+ bool ReadOnly { get; set; }
|
|
|
+
|
|
|
+ BaseObject[] Items { get; set; }
|
|
|
+
|
|
|
+ void Setup(Type type, DynamicEditorPages? pages = null, DynamicEditorButtons? buttons = null,
|
|
|
+ Func<Type, CoreTable>? pageDataHandler = null, bool preloadPages = false);
|
|
|
+
|
|
|
+ IDynamicEditorControl FindEditor(string columnName);
|
|
|
+
|
|
|
+ void UnloadEditorPages(bool saved);
|
|
|
}
|
|
|
|
|
|
public class UtilityItem
|
|
|
@@ -78,312 +117,73 @@ namespace InABox.DynamicGrid
|
|
|
/// </summary>
|
|
|
public partial class DynamicEditorForm : ThemableChromelessWindow, IDynamicEditorForm
|
|
|
{
|
|
|
- public delegate Document? FindDocumentEvent(string FileName);
|
|
|
+ #region IDynamicEditorForm
|
|
|
|
|
|
- public delegate Document? GetDocumentEvent(Guid id);
|
|
|
-
|
|
|
- public delegate void SaveDocumentEvent(Document document);
|
|
|
-
|
|
|
- private BaseObject[] _items;
|
|
|
-
|
|
|
- public DynamicEditorGrid Editor;
|
|
|
-
|
|
|
- public DynamicEditorForm(Type type, DynamicEditorPages? pages = null, DynamicEditorButtons? buttons = null,
|
|
|
- Func<Type, CoreTable>? PageDataHandler = null, bool PreloadPages = false)
|
|
|
- {
|
|
|
- ReadOnly = false;
|
|
|
-
|
|
|
- InitializeComponent();
|
|
|
-
|
|
|
- //this.Loaded += new RoutedEventHandler(ConfigureSystemMenu);
|
|
|
-
|
|
|
- var grid = Content as Grid;
|
|
|
- Editor = grid.Children.OfType<DynamicEditorGrid>().FirstOrDefault();
|
|
|
-
|
|
|
- Editor.UnderlyingType = type;
|
|
|
-
|
|
|
- Editor.OnCustomiseColumns += Editor_OnCustomiseColumns;
|
|
|
-
|
|
|
- Editor.OnDefineFilter += (sender, t) => OnDefineFilter?.Invoke(sender, t);
|
|
|
+ public bool ReadOnly { get => Form.ReadOnly; set => Form.ReadOnly = value; }
|
|
|
+ public BaseObject[] Items { get => Form.Items; set => Form.Items = value; }
|
|
|
+ public DynamicEditorPages? Pages { get => Form.Pages; }
|
|
|
|
|
|
- Editor.OnEditorCreated += Editor_OnEditorCreated;
|
|
|
|
|
|
- Editor.OnLoadPage += page => { page.Load(Items.First(), PageDataHandler); };
|
|
|
+ public event OnValidateData? OnValidateData { add => Form.OnValidateData += value; remove => Form.OnValidateData -= value; }
|
|
|
|
|
|
- Editor.OnSelectPage += (tab, items) => { OnSelectPage?.Invoke(tab, items); };
|
|
|
+ public event OnCustomiseColumns? OnCustomiseColumns { add => Form.OnCustomiseColumns += value; remove => Form.OnCustomiseColumns -= value; }
|
|
|
+ public event OnDefineFilter? OnDefineFilter { add => Form.OnDefineFilter += value; remove => Form.OnDefineFilter -= value; }
|
|
|
|
|
|
- Editor.PreloadPages = PreloadPages;
|
|
|
-
|
|
|
- Editor.OnUnloadPage += (page, saved) =>
|
|
|
- {
|
|
|
- if (!saved)
|
|
|
- page.BeforeSave(Items.First());
|
|
|
- else
|
|
|
- page.AfterSave(Items.First());
|
|
|
- };
|
|
|
-
|
|
|
- //Editor.OnGetPropertyInfo += (o, c) => { return CoreUtils.GetProperty(_item.GetType(), c); };
|
|
|
-
|
|
|
- Editor.ReconfigureEditors += g => { ReconfigureEditors?.Invoke(g); };
|
|
|
-
|
|
|
- Editor.OnGetEditor += c =>
|
|
|
- {
|
|
|
- if (_items != null && _items.Any())
|
|
|
- {
|
|
|
- var property = DatabaseSchema.Property(type, c.ColumnName);
|
|
|
- if (property == null) return new NullEditor();
|
|
|
-
|
|
|
- if (property.Editor is NullEditor)
|
|
|
- return property.Editor;
|
|
|
-
|
|
|
- BaseEditor editor;
|
|
|
- if (property is CustomProperty)
|
|
|
- {
|
|
|
- editor = property.Editor.CloneEditor();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- editor = OnDefineEditor?.Invoke(_items[0], c) ?? c.Editor.CloneEditor();
|
|
|
- var propEditor = property.Editor;
|
|
|
- editor.Page = propEditor.Page;
|
|
|
- editor.Caption = propEditor.Caption;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //defaultEditor.EditorSequence
|
|
|
-
|
|
|
- //EditorUtils.GetPropertyEditor(type, property, defaultEditor);
|
|
|
-
|
|
|
- /*BaseEditor editor = new NullEditor();
|
|
|
- var caption = "";
|
|
|
- var page = "";
|
|
|
-
|
|
|
- try
|
|
|
- {
|
|
|
- var comps = c.ColumnName.Split('.');
|
|
|
- for (var i = 0; i < comps.Length; i++)
|
|
|
- {
|
|
|
- var column = string.Join(".", comps.Take(i + 1));
|
|
|
- var prop = CoreUtils.GetProperty(type, column);
|
|
|
-
|
|
|
- if (column.Equals(c.ColumnName))
|
|
|
- {
|
|
|
- if (OnDefineEditor != null)
|
|
|
- editor = OnDefineEditor(_items[0], c);
|
|
|
- else
|
|
|
- editor = c.Editor != null ? c.Editor : new NullEditor();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var pedit = prop.GetEditor();
|
|
|
- if (pedit is NullEditor)
|
|
|
- return pedit;
|
|
|
- }
|
|
|
-
|
|
|
- editor = editor == null ? new NullEditor() : editor.Clone() as BaseEditor;
|
|
|
-
|
|
|
- var capattr = prop.GetCustomAttribute<Caption>();
|
|
|
- var subcap = capattr != null ? capattr.Text : comps[i];
|
|
|
- var path = capattr != null ? capattr.IncludePath : true;
|
|
|
- if (!string.IsNullOrWhiteSpace(subcap))
|
|
|
- caption = string.IsNullOrWhiteSpace(caption) || path == false ? subcap : string.Format("{0} {1}", caption, subcap);
|
|
|
-
|
|
|
- if (string.IsNullOrWhiteSpace(page))
|
|
|
- {
|
|
|
- var pageattr = prop.GetCustomAttribute<EditorSequence>();
|
|
|
- if (pageattr != null)
|
|
|
- page = pageattr.Page;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- editor.Caption = caption;
|
|
|
- editor.Page = page;
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- var dmprop = DatabaseSchema.Property(_items[0].GetType(), c.ColumnName);
|
|
|
- if (dmprop is CustomProperty)
|
|
|
- {
|
|
|
- editor = dmprop.Editor.Clone() as BaseEditor;
|
|
|
- editor.Caption = dmprop.Caption;
|
|
|
- editor.Page = string.IsNullOrWhiteSpace(dmprop.Page) ? "Custom Fields" : dmprop.Page;
|
|
|
- }
|
|
|
- }*/
|
|
|
-
|
|
|
- if (ReadOnly && editor.Editable.Equals(Editable.Enabled))
|
|
|
- editor.Editable = Editable.Disabled;
|
|
|
- return editor;
|
|
|
- }
|
|
|
-
|
|
|
- return new NullEditor();
|
|
|
- };
|
|
|
-
|
|
|
- Editor.OnGridCustomiseEditor += (sender, column, editor) => OnFormCustomiseEditor?.Invoke(this, Items, column, editor);
|
|
|
-
|
|
|
- Editor.OnGetSequence += c => CoreUtils.GetPropertySequence(_items.First().GetType(), c.ColumnName);
|
|
|
-
|
|
|
- Editor.OnGetPropertyValue += (o, c) =>
|
|
|
- {
|
|
|
- if (!_items.Any())
|
|
|
- return null;
|
|
|
-
|
|
|
- object? result;
|
|
|
- try
|
|
|
- {
|
|
|
- result = CoreUtils.GetPropertyValue(_items.First(), c);
|
|
|
- }
|
|
|
- catch
|
|
|
- {
|
|
|
- result = _items.First().UserProperties.ContainsKey(c) ? _items.First().UserProperties[c] : null;
|
|
|
- }
|
|
|
+ public event OnDefineLookup? OnDefineLookups { add => Form.OnDefineLookups += value; remove => Form.OnDefineLookups -= value; }
|
|
|
+ public event OnLookupsDefined? OnLookupsDefined { add => Form.OnLookupsDefined += value; remove => Form.OnLookupsDefined -= value; }
|
|
|
|
|
|
- if (result == null)
|
|
|
- return null;
|
|
|
-
|
|
|
- foreach (var _item in _items)
|
|
|
- {
|
|
|
- object? curvalue;
|
|
|
- try
|
|
|
- {
|
|
|
- curvalue = CoreUtils.GetPropertyValue(_item, c);
|
|
|
- }
|
|
|
- catch
|
|
|
- {
|
|
|
- curvalue = _item.UserProperties.ContainsKey(c) ? _item.UserProperties[c] : null;
|
|
|
- }
|
|
|
-
|
|
|
- if (curvalue == null)
|
|
|
- return null;
|
|
|
-
|
|
|
- if (!curvalue.Equals(result))
|
|
|
- return null;
|
|
|
- }
|
|
|
+ public event DefineEditorEventHandler? OnDefineEditor { add => Form.OnDefineEditor += value; remove => Form.OnDefineEditor -= value; }
|
|
|
+ public event OnFormCustomiseEditor? OnFormCustomiseEditor { add => Form.OnFormCustomiseEditor += value; remove => Form.OnFormCustomiseEditor -= value; }
|
|
|
+ public event OnReconfigureEditors? ReconfigureEditors { add => Form.ReconfigureEditors += value; remove => Form.ReconfigureEditors -= value; }
|
|
|
+
|
|
|
+ public event EditorValueChangedHandler? OnEditorValueChanged { add => Form.OnEditorValueChanged += value; remove => Form.OnEditorValueChanged -= value; }
|
|
|
|
|
|
- return result;
|
|
|
- };
|
|
|
+ public event IDynamicEditorForm.GetDocumentEvent? OnGetDocument { add => Form.OnGetDocument += value; remove => Form.OnGetDocument -= value; }
|
|
|
+ public event IDynamicEditorForm.FindDocumentEvent? OnFindDocument { add => Form.OnFindDocument += value; remove => Form.OnFindDocument -= value; }
|
|
|
+ public event IDynamicEditorForm.SaveDocumentEvent? OnSaveDocument { add => Form.OnSaveDocument += value; remove => Form.OnSaveDocument -= value; }
|
|
|
|
|
|
- Editor.OnSetPropertyValue += (o, c, v) =>
|
|
|
- {
|
|
|
- foreach (var _item in _items)
|
|
|
- if (_item.UserProperties.ContainsKey(c))
|
|
|
- _item.UserProperties[c] = v;
|
|
|
- else
|
|
|
- CoreUtils.SetPropertyValue(_item, c, v);
|
|
|
- };
|
|
|
+ public event OnSelectPage? OnSelectPage { add => Form.OnSelectPage += value; remove => Form.OnSelectPage -= value; }
|
|
|
|
|
|
- Editor.OnEditorValueChanged += EditorValueChanged;
|
|
|
+ public event DynamicGridSaveEvent? OnSaveItem { add => Form.OnSaveItem += value; remove => Form.OnSaveItem -= value; }
|
|
|
|
|
|
- Editor.OnDefineLookups += sender => { OnDefineLookups?.Invoke(sender); };
|
|
|
- Editor.OnLookupsDefined += sender => { OnLookupsDefined?.Invoke(sender); };
|
|
|
|
|
|
- Editor.OnGetDocument += id => { return OnGetDocument?.Invoke(id); };
|
|
|
- Editor.OnSaveDocument += doc => { OnSaveDocument?.Invoke(doc); };
|
|
|
- Editor.OnFindDocument += file => { return OnFindDocument?.Invoke(file); };
|
|
|
+ public IDynamicEditorControl FindEditor(string columnName) => Form.FindEditor(columnName);
|
|
|
|
|
|
- Editor.GetItems += () => _items;
|
|
|
+ public void UnloadEditorPages(bool saved) => Form.UnloadEditorPages(saved);
|
|
|
|
|
|
- Pages = pages;
|
|
|
+ #endregion
|
|
|
|
|
|
- if (Pages == null || Pages.Count == 0)
|
|
|
- Editor.Margin = new Thickness(5, 5, 5, 0);
|
|
|
+ public DynamicEditorForm()
|
|
|
+ {
|
|
|
+ InitializeComponent();
|
|
|
+
|
|
|
+ //this.Loaded += new RoutedEventHandler(ConfigureSystemMenu);
|
|
|
|
|
|
- if (buttons != null)
|
|
|
- foreach (var button in buttons)
|
|
|
- {
|
|
|
- var btn = new Button();
|
|
|
- UpdateButton(btn, button.Image, button.Name);
|
|
|
- btn.Tag = button;
|
|
|
- btn.Margin = new Thickness(5, 5, 0, 5);
|
|
|
- btn.Padding = new Thickness(5, 0, 5, 0);
|
|
|
- btn.Click += Btn_Click;
|
|
|
- Buttons.Children.Add(btn);
|
|
|
- button.Button = btn;
|
|
|
- button.Form = this;
|
|
|
- }
|
|
|
+ Form.OnEditorCreated += Editor_OnEditorCreated;
|
|
|
+ Form.OnOK += Form_OnOK;
|
|
|
+ Form.OnCancel += Form_OnCancel;
|
|
|
}
|
|
|
|
|
|
- public DynamicEditorPages? Pages { get; }
|
|
|
-
|
|
|
- public BaseObject[] Items
|
|
|
+ public DynamicEditorForm(Type type, DynamicEditorPages? pages = null, DynamicEditorButtons? buttons = null,
|
|
|
+ Func<Type, CoreTable>? pageDataHandler = null, bool preloadPages = false): this()
|
|
|
{
|
|
|
- get => _items;
|
|
|
- set
|
|
|
- {
|
|
|
- _items = value;
|
|
|
- UtilityViewModel.Slug = Items != null ? Items.Any() ? Items.First().GetType().EntityName().Split('.').Last() : "" : "";
|
|
|
- Editor.Load(_items.First().GetType().EntityName(), Pages);
|
|
|
- }
|
|
|
+ Setup(type, pages, buttons, pageDataHandler, preloadPages);
|
|
|
}
|
|
|
|
|
|
- public bool ReadOnly { get; set; }
|
|
|
-
|
|
|
- public OnValidateData? OnValidateData;
|
|
|
-
|
|
|
- public event OnCustomiseColumns? OnCustomiseColumns;
|
|
|
-
|
|
|
- public event OnDefineFilter? OnDefineFilter;
|
|
|
-
|
|
|
- public event DefineEditorEventHandler? OnDefineEditor;
|
|
|
-
|
|
|
- public event OnFormCustomiseEditor? OnFormCustomiseEditor;
|
|
|
-
|
|
|
- public event OnReconfigureEditors? ReconfigureEditors;
|
|
|
-
|
|
|
- //public delegate void EditorValueChangedHandler(object sender, String name, object value, List<String> changes);
|
|
|
- //public event EditorValueChangedHandler OnEditorValueChanged;
|
|
|
-
|
|
|
- public event EditorValueChangedHandler? OnEditorValueChanged;
|
|
|
-
|
|
|
- //public event DefineFilter OnDefineFilter;
|
|
|
-
|
|
|
- public event OnDefineLookup? OnDefineLookups;
|
|
|
-
|
|
|
- public event OnLookupsDefined? OnLookupsDefined;
|
|
|
- public event GetDocumentEvent? OnGetDocument;
|
|
|
- public event FindDocumentEvent? OnFindDocument;
|
|
|
- public event SaveDocumentEvent? OnSaveDocument;
|
|
|
-
|
|
|
- public event OnSelectPage? OnSelectPage;
|
|
|
-
|
|
|
- public event DynamicGridSaveEvent? OnSaveItem;
|
|
|
-
|
|
|
- public void UnloadEditorPages(DynamicEditorPages pages, object item, bool saved)
|
|
|
+ public void Setup(Type type, DynamicEditorPages? pages = null, DynamicEditorButtons? buttons = null,
|
|
|
+ Func<Type, CoreTable>? pageDataHandler = null, bool preloadPages = false)
|
|
|
{
|
|
|
- Editor.UnloadPages(saved);
|
|
|
+ Form.Setup(type, pages, buttons, pageDataHandler, preloadPages);
|
|
|
}
|
|
|
|
|
|
- protected void UpdateButton(Button button, BitmapImage? image, string text)
|
|
|
+ private void Form_OnCancel()
|
|
|
{
|
|
|
- var stackPnl = new StackPanel();
|
|
|
- stackPnl.Orientation = Orientation.Horizontal;
|
|
|
- //stackPnl.Margin = new Thickness(2);
|
|
|
-
|
|
|
- if (image != null)
|
|
|
- {
|
|
|
- var img = new Image();
|
|
|
- img.Source = image;
|
|
|
- img.Margin = new Thickness(2);
|
|
|
- stackPnl.Children.Add(img);
|
|
|
- }
|
|
|
-
|
|
|
- if (!string.IsNullOrEmpty(text))
|
|
|
- {
|
|
|
- var lbl = new Label();
|
|
|
- lbl.Content = text;
|
|
|
- lbl.VerticalAlignment = VerticalAlignment.Stretch;
|
|
|
- lbl.VerticalContentAlignment = VerticalAlignment.Center;
|
|
|
- lbl.Margin = new Thickness(2, 0, 5, 0);
|
|
|
- stackPnl.Children.Add(lbl);
|
|
|
- }
|
|
|
-
|
|
|
- button.Content = stackPnl;
|
|
|
+ DialogResult = false;
|
|
|
}
|
|
|
|
|
|
- private Dictionary<string, object?> EditorValueChanged(object sender, string name, object value)
|
|
|
+ private void Form_OnOK()
|
|
|
{
|
|
|
- if (OnEditorValueChanged != null)
|
|
|
- return OnEditorValueChanged(sender, name, value);
|
|
|
- return DynamicGridUtils.UpdateEditorValue(_items, name, value);
|
|
|
+ DialogResult = true;
|
|
|
}
|
|
|
|
|
|
private void Editor_OnEditorCreated(object sender, double height, double width)
|
|
|
@@ -395,8 +195,8 @@ namespace InABox.DynamicGrid
|
|
|
|
|
|
var desiredheight = height + spareheight;
|
|
|
var desiredwidth = width + sparewidth;
|
|
|
- if (Pages != null)
|
|
|
- foreach (var page in Pages)
|
|
|
+ if (Form.Pages != null)
|
|
|
+ foreach (var page in Form.Pages)
|
|
|
{
|
|
|
if (desiredheight < page.MinimumSize().Height)
|
|
|
desiredheight = page.MinimumSize().Height;
|
|
|
@@ -413,74 +213,16 @@ namespace InABox.DynamicGrid
|
|
|
Left = screen.DeviceBounds.Left + (screen.DeviceBounds.Width - Width) / 2.0F;
|
|
|
Top = screen.DeviceBounds.Top + (screen.DeviceBounds.Height - Height) / 2.0F;
|
|
|
|
|
|
- Editor.VerticalAlignment = VerticalAlignment.Stretch;
|
|
|
- Editor.HorizontalAlignment = HorizontalAlignment.Stretch;
|
|
|
-
|
|
|
- var scaption = _items[0].GetType().GetCaption();
|
|
|
+ var scaption = Form.Items[0].GetType().GetCaption();
|
|
|
Title = "Edit " + scaption.SplitCamelCase();
|
|
|
- if (Editor.IsCustomLayout)
|
|
|
- Title = Title + "*";
|
|
|
-
|
|
|
- OKButton.IsEnabled = !ReadOnly;
|
|
|
- }
|
|
|
-
|
|
|
- private DynamicGridColumns Editor_OnCustomiseColumns(object sender, DynamicGridColumns? source)
|
|
|
- {
|
|
|
- var columns = new DynamicGridColumns();
|
|
|
- if (_items != null && _items.Any())
|
|
|
- columns.ExtractColumns(_items.First().GetType(), "");
|
|
|
- if (OnCustomiseColumns != null)
|
|
|
- columns = OnCustomiseColumns.Invoke(this, columns);
|
|
|
- return columns;
|
|
|
- }
|
|
|
-
|
|
|
- private void Btn_Click(object sender, RoutedEventArgs e)
|
|
|
- {
|
|
|
- var button = (Button)sender;
|
|
|
- var deb = (DynamicEditorButton)button.Tag;
|
|
|
- deb.Click();
|
|
|
- }
|
|
|
-
|
|
|
- private void OKButton_Click(object sender, RoutedEventArgs e)
|
|
|
- {
|
|
|
- var errors = OnValidateData?.Invoke(this, Items);
|
|
|
-
|
|
|
- if (errors != null && errors.Any())
|
|
|
- {
|
|
|
- MessageBox.Show(
|
|
|
- string.Format("The following errors have been found with your data!\nPlease correct them and try again.\n\n- {0}",
|
|
|
- string.Join("\n- ", errors)), "Validation Error");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- // Don't Commit the changes here, because we want to refer back to thos changes when we save the item
|
|
|
- // to trigger specific processes in the database
|
|
|
- DialogResult = true;
|
|
|
- //Close();
|
|
|
- }
|
|
|
-
|
|
|
- private void CancelButton_Click(object sender, RoutedEventArgs e)
|
|
|
- {
|
|
|
- // However, if we cancel the edits, then we can safely revert the items back to their original (loaded) state
|
|
|
- foreach (var item in _items)
|
|
|
- item.CancelChanges();
|
|
|
- DialogResult = false;
|
|
|
- //Close();
|
|
|
- }
|
|
|
-
|
|
|
- public bool TryFindEditor(string columnname, [NotNullWhen(true)] out IDynamicEditorControl? editor)
|
|
|
- {
|
|
|
- return Editor.TryFindEditor(columnname, out editor);
|
|
|
- }
|
|
|
- public IDynamicEditorControl? FindEditor(string columnname)
|
|
|
- {
|
|
|
- return Editor.FindEditor(columnname);
|
|
|
+ if (Form.Editor.IsCustomLayout)
|
|
|
+ Title += "*";
|
|
|
}
|
|
|
|
|
|
private void Window_Closing(object sender, CancelEventArgs e)
|
|
|
{
|
|
|
if (DialogResult == true)
|
|
|
- OnSaveItem?.Invoke(this, e);
|
|
|
+ Form.SaveItem(e);
|
|
|
}
|
|
|
|
|
|
#region Win32 API Stuff
|
|
|
@@ -512,14 +254,14 @@ namespace InABox.DynamicGrid
|
|
|
switch (wParam.ToInt32())
|
|
|
{
|
|
|
case _EditLayoutID:
|
|
|
- Editor.EditLayout();
|
|
|
+ Form.EditLayout();
|
|
|
handled = true;
|
|
|
break;
|
|
|
case _ResetLayoutID:
|
|
|
if (MessageBox.Show(
|
|
|
"WARNING: This will delete any customisations you have made!\n\nAre you sure you wish to reset this layout?",
|
|
|
"Confirm Layout Reset", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
|
|
|
- Editor.ResetLayout();
|
|
|
+ Form.ResetLayout();
|
|
|
handled = true;
|
|
|
break;
|
|
|
}
|