fix(docking): address code quality issues in DockingLayout and DockRegionHighlight
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="local:DockRegionHighlight">
|
<ControlTemplate TargetType="local:DockRegionHighlight">
|
||||||
<Border Background="#400078D7" BorderBrush="#800078D7" BorderThickness="2" CornerRadius="4" />
|
<Border Background="{ThemeResource SystemControlHighlightAccentBrush}" Opacity="0.25" BorderBrush="{ThemeResource SystemControlHighlightAccentBrush}" BorderThickness="2" CornerRadius="4" />
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|||||||
@@ -34,14 +34,23 @@ public class DockingLayout : Control
|
|||||||
|
|
||||||
private static void OnRootPanelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
private static void OnRootPanelChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (d is DockingLayout layout && e.NewValue is DockPanel panel)
|
if (d is DockingLayout layout)
|
||||||
{
|
{
|
||||||
panel.Root = layout;
|
if (e.OldValue is DockPanel oldPanel)
|
||||||
|
{
|
||||||
|
oldPanel.Root = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.NewValue is DockPanel newPanel)
|
||||||
|
{
|
||||||
|
newPanel.Root = layout;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddDocument(DockDocument document, DockTarget target, DockGroup? targetGroup = null)
|
public void AddDocument(DockDocument document, DockTarget target, DockGroup? targetGroup = null)
|
||||||
{
|
{
|
||||||
|
// TODO: Handle non-Center targets (Task 5)
|
||||||
if (RootPanel == null)
|
if (RootPanel == null)
|
||||||
{
|
{
|
||||||
RootPanel = new DockPanel();
|
RootPanel = new DockPanel();
|
||||||
|
|||||||
Reference in New Issue
Block a user