|
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|
|
using System.ComponentModel;
|
|
|
using System.Linq;
|
|
|
using System.Windows.Controls;
|
|
|
+using System.Windows.Media;
|
|
|
using System.Windows.Threading;
|
|
|
using InABox.Configuration;
|
|
|
using InABox.Core;
|
|
@@ -42,8 +43,6 @@ public abstract class MasterDetailPanel<TMaster, TMasterGrid, TSettings> : Maste
|
|
|
new UserConfiguration<TSettings>().Save(Settings);
|
|
|
}
|
|
|
|
|
|
- protected abstract string MasterCaption { get; }
|
|
|
- protected abstract string DetailCaption { get; }
|
|
|
protected abstract void CreatePages();
|
|
|
protected abstract void AfterLoadSettings(TSettings settings);
|
|
|
protected abstract void BeforeSaveSettings(TSettings settings);
|
|
@@ -213,12 +212,50 @@ public abstract class MasterDetailPanel<TMaster, TMasterGrid, TSettings> : Maste
|
|
|
|
|
|
}
|
|
|
|
|
|
-public abstract partial class MasterDetailPanel : UserControl
|
|
|
+public abstract class MasterDetailPanel : UserControl
|
|
|
{
|
|
|
+ protected DynamicSplitPanel _splitPanel;
|
|
|
+ protected Label _header;
|
|
|
+ protected DynamicTabControl _tabControl;
|
|
|
+
|
|
|
+ protected abstract string MasterCaption { get; }
|
|
|
+ protected abstract string DetailCaption { get; }
|
|
|
+
|
|
|
|
|
|
protected MasterDetailPanel()
|
|
|
{
|
|
|
- InitializeComponent();
|
|
|
+ _splitPanel = new DynamicSplitPanel
|
|
|
+ {
|
|
|
+ View = DynamicSplitPanelView.Combined,
|
|
|
+ AnchorWidth = 300,
|
|
|
+ MasterCaption = MasterCaption,
|
|
|
+ DetailCaption = DetailCaption
|
|
|
+ };
|
|
|
+ _splitPanel.OnChanged += SplitPanel_OnChanged;
|
|
|
+
|
|
|
+ _header = new Label
|
|
|
+ {
|
|
|
+ HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center,
|
|
|
+ VerticalContentAlignment = System.Windows.VerticalAlignment.Center,
|
|
|
+ };
|
|
|
+
|
|
|
+ _splitPanel.Header = new Border
|
|
|
+ {
|
|
|
+ BorderBrush = new SolidColorBrush(Colors.Gray),
|
|
|
+ BorderThickness = new System.Windows.Thickness(0.75),
|
|
|
+ Background = new SolidColorBrush(Colors.WhiteSmoke),
|
|
|
+ Height = 25,
|
|
|
+ Child = _header
|
|
|
+ };
|
|
|
+
|
|
|
+ _tabControl = new DynamicTabControl();
|
|
|
+ Grid.SetColumn(_tabControl, 2);
|
|
|
+ Grid.SetRow(_tabControl, 0);
|
|
|
+ Grid.SetRowSpan(_tabControl, 2);
|
|
|
+ _tabControl.SelectionChanged += Pages_OnChanged;
|
|
|
+ _splitPanel.Detail = _tabControl;
|
|
|
+
|
|
|
+ Content = _splitPanel;
|
|
|
}
|
|
|
|
|
|
protected abstract void DoSplitPanelChanged();
|