-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main'
- Loading branch information
Showing
20 changed files
with
497 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
167 changes: 167 additions & 0 deletions
167
SukiUI.Demo/Features/ControlsLibrary/DockControls/DockFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
using Dock.Avalonia.Controls; | ||
using Dock.Model.Avalonia; | ||
using Dock.Model.Controls; | ||
using Dock.Model.Core; | ||
using Dock.Model.Mvvm.Controls; | ||
|
||
namespace SukiUI.Demo.Features.ControlsLibrary.DockControls | ||
{ | ||
public class DockFactory(object context) : Factory | ||
{ | ||
private readonly object _context = context; | ||
private IRootDock? _rootDock; | ||
private IDocumentDock? _documentDock; | ||
|
||
public override IRootDock CreateLayout() | ||
{ | ||
var programDocument = new DocumentTextViewModel() | ||
{ Id = "DocumentText", Title = "Program.cs" }; | ||
var appDocument = new DocumentTextViewModel() | ||
{ Id = "DocumentText", Title = "App.axaml" }; | ||
|
||
var errorListTool = new ErrorListViewModel() | ||
{ Id = "ErrorListTool", Title = "Error List" }; | ||
var outputTool = new OutputViewModel() | ||
{ Id = "OutputTool", Title = "Output" }; | ||
var propertiesTool = new PropertiesViewModel() { Id = "PropertiesTool", Title = "Properties" }; | ||
var solutionExploreTool = new SolutionExploreViewModel() { Id = "SolutionExploreTool", Title = "Solution Explore" }; | ||
|
||
var leftDock = new ProportionalDock | ||
{ | ||
Proportion = 0.25, | ||
Orientation = Orientation.Vertical, | ||
ActiveDockable = null, | ||
VisibleDockables = CreateList<IDockable> | ||
( | ||
new ToolDock | ||
{ | ||
ActiveDockable = solutionExploreTool, | ||
VisibleDockables = CreateList<IDockable>(solutionExploreTool), | ||
Alignment = Alignment.Left | ||
} | ||
) | ||
}; | ||
|
||
var documentDock = new DocumentDock | ||
{ | ||
Proportion = 0.7, | ||
IsCollapsable = false, | ||
ActiveDockable = programDocument, | ||
VisibleDockables = CreateList<IDockable>(programDocument, appDocument), | ||
CanCreateDocument = true | ||
}; | ||
|
||
var rightTopDock = new ProportionalDock | ||
{ | ||
Proportion = 0.70, | ||
Orientation = Orientation.Horizontal, | ||
ActiveDockable = null, | ||
VisibleDockables = CreateList<IDockable> | ||
( | ||
documentDock, | ||
new ProportionalDockSplitter(), | ||
new ToolDock | ||
{ | ||
ActiveDockable = propertiesTool, | ||
VisibleDockables = CreateList<IDockable>(propertiesTool), | ||
Alignment = Alignment.Top, | ||
} | ||
) | ||
}; | ||
|
||
var rightBottomDock = new ProportionalDock | ||
{ | ||
Proportion = 0.30, | ||
Orientation = Orientation.Horizontal, | ||
ActiveDockable = null, | ||
VisibleDockables = CreateList<IDockable> | ||
( | ||
new ToolDock | ||
{ | ||
ActiveDockable = outputTool, | ||
VisibleDockables = CreateList<IDockable>(errorListTool, outputTool), | ||
Alignment = Alignment.Top, | ||
} | ||
) | ||
}; | ||
|
||
var rightDock = new ProportionalDock | ||
{ | ||
Proportion = 0.75, | ||
Orientation = Orientation.Vertical, | ||
ActiveDockable = null, | ||
VisibleDockables = CreateList<IDockable> | ||
( | ||
rightTopDock, | ||
new ProportionalDockSplitter(), | ||
rightBottomDock | ||
) | ||
}; | ||
|
||
var mainLayout = new ProportionalDock | ||
{ | ||
Orientation = Orientation.Horizontal, | ||
VisibleDockables = CreateList<IDockable> | ||
( | ||
leftDock, | ||
new ProportionalDockSplitter(), | ||
rightDock | ||
) | ||
}; | ||
|
||
var homeView = new HomeViewModel | ||
{ | ||
Id = "Home", | ||
Title = "Home", | ||
ActiveDockable = mainLayout, | ||
VisibleDockables = CreateList<IDockable>(mainLayout) | ||
}; | ||
|
||
var rootDock = CreateRootDock(); | ||
|
||
rootDock.IsCollapsable = false; | ||
rootDock.ActiveDockable = homeView; | ||
rootDock.DefaultDockable = homeView; | ||
rootDock.VisibleDockables = CreateList<IDockable>(homeView); | ||
|
||
_documentDock = documentDock; | ||
_rootDock = rootDock; | ||
|
||
return rootDock; | ||
} | ||
|
||
public override IDockWindow? CreateWindowFrom(IDockable dockable) | ||
{ | ||
var window = base.CreateWindowFrom(dockable); | ||
|
||
if (window != null) | ||
{ | ||
window.Title = "Dock Avalonia Demo"; | ||
} | ||
|
||
return window; | ||
} | ||
|
||
public override void InitLayout(IDockable layout) | ||
{ | ||
ContextLocator = new Dictionary<string, Func<object?>> | ||
{ | ||
["Dashboard"] = () => layout, | ||
["Home"] = () => _context | ||
}; | ||
|
||
DockableLocator = new Dictionary<string, Func<IDockable?>>() | ||
{ | ||
["Root"] = () => _rootDock, | ||
["Documents"] = () => _documentDock | ||
}; | ||
|
||
HostWindowLocator = new Dictionary<string, Func<IHostWindow?>> | ||
{ | ||
[nameof(IDockWindow)] = () => new HostWindow() | ||
}; | ||
|
||
base.InitLayout(layout); | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
SukiUI.Demo/Features/ControlsLibrary/DockControls/DocumentTextViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Dock.Model.Mvvm.Controls; | ||
|
||
namespace SukiUI.Demo.Features.ControlsLibrary.DockControls | ||
{ | ||
public class DocumentTextViewModel : Document | ||
{ | ||
|
||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
SukiUI.Demo/Features/ControlsLibrary/DockControls/ErrorListViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
| ||
using Dock.Model.Mvvm.Controls; | ||
|
||
namespace SukiUI.Demo.Features.ControlsLibrary.DockControls | ||
{ | ||
public class ErrorListViewModel : Tool | ||
{ | ||
|
||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
SukiUI.Demo/Features/ControlsLibrary/DockControls/HomeView.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<UserControl xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:dockControls="clr-namespace:SukiUI.Demo.Features.ControlsLibrary.DockControls" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:DataType="dockControls:HomeViewModel" | ||
x:Class="SukiUI.Demo.Features.ControlsLibrary.DockControls.HomeView"> | ||
<Grid | ||
RowDefinitions="*,25"> | ||
<ContentControl | ||
Content="{Binding ActiveDockable}" | ||
Margin="4" | ||
Grid.Row="0"/> | ||
<TextBlock | ||
Text="{Binding FocusedDockable}" | ||
Margin="4" | ||
Grid.Row="1"/> | ||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
SukiUI.Demo/Features/ControlsLibrary/DockControls/HomeViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Dock.Model.Mvvm.Controls; | ||
|
||
namespace SukiUI.Demo.Features.ControlsLibrary.DockControls | ||
{ | ||
public class HomeViewModel : RootDock | ||
{ | ||
|
||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
SukiUI.Demo/Features/ControlsLibrary/DockControls/OutputView.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<UserControl xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:dockControls="clr-namespace:SukiUI.Demo.Features.ControlsLibrary.DockControls" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:DataType="dockControls:OutputViewModel" | ||
x:Class="SukiUI.Demo.Features.ControlsLibrary.DockControls.OutputView"> | ||
<TextBlock HorizontalAlignment="Left" Margin="15,12" FontSize="13" Foreground="{DynamicResource SukiLowText}" > | ||
Build: Dock.Model.Avalonia.Controls.Tool, Id='SolutionExplorer'<LineBreak></LineBreak> | ||
<Run Foreground="Green"> [Added] </Run>SolutionExplorer, Dock.Avalonia.Controls.ToolContentControl<LineBreak></LineBreak> | ||
<Run Foreground="Green"> [Added] </Run> Avalonia.Markup.Xaml.XamlIl.Runtime.XamlIlRuntimeHelpers+PointerDeferredContent`1[Avalonia.Controls.Control], DockXamlSample.SolutionExplore<LineBreak></LineBreak> | ||
Build: Dock.Model.Avalonia.Controls.Document, Id='Document1'<LineBreak></LineBreak> | ||
<Run Foreground="Green"> [Added] </Run> Document1, Dock.Avalonia.Controls.DocumentContentControl<LineBreak></LineBreak> | ||
<Run Foreground="Green"> [Added] </Run> Avalonia.Markup.Xaml.XamlIl.Runtime.XamlIlRuntimeHelpers+PointerDeferredContent`1[Avalonia.Controls.Control], Avalonia.Controls.TextBlock<LineBreak></LineBreak> | ||
Build: Dock.Model.Avalonia.Controls.Tool, Id='Properties'<LineBreak></LineBreak> | ||
<Run Foreground="Green"> [Added] </Run> Properties, Dock.Avalonia.Controls.ToolContentControl<LineBreak></LineBreak> | ||
<Run Foreground="Green"> [Added] </Run> Avalonia.Markup.Xaml.XamlIl.Runtime.XamlIlRuntimeHelpers+PointerDeferredContent`1[Avalonia.Controls.Control], DockXamlSample.propertiesview<LineBreak></LineBreak> | ||
Build: Dock.Model.Avalonia.Controls.Tool, Id='Output'<LineBreak></LineBreak> | ||
<Run Foreground="Green"> [Added] </Run> Output, Dock.Avalonia.Controls.ToolContentControl<LineBreak></LineBreak> | ||
<Run Foreground="Green"> [Added] </Run> Avalonia.Markup.Xaml.XamlIl.Runtime.XamlIlRuntimeHelpers+PointerDeferredContent`1[Avalonia.Controls.Control], Avalonia.Controls.TextBlock<LineBreak></LineBreak> | ||
</TextBlock> | ||
</UserControl> |
14 changes: 14 additions & 0 deletions
14
SukiUI.Demo/Features/ControlsLibrary/DockControls/OutputView.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Avalonia; | ||
using Avalonia.Controls; | ||
using Avalonia.Markup.Xaml; | ||
|
||
namespace SukiUI.Demo.Features.ControlsLibrary.DockControls | ||
{ | ||
public partial class OutputView : UserControl | ||
{ | ||
public OutputView() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
SukiUI.Demo/Features/ControlsLibrary/DockControls/OutputViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Dock.Model.Mvvm.Controls; | ||
|
||
namespace SukiUI.Demo.Features.ControlsLibrary.DockControls | ||
{ | ||
public class OutputViewModel : Tool | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
SukiUI.Demo/Features/ControlsLibrary/DockControls/PropertiesView.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Avalonia.Controls; | ||
|
||
namespace SukiUI.Demo.Features.ControlsLibrary.DockControls | ||
{ | ||
public partial class PropertiesView : UserControl | ||
{ | ||
public PropertiesView() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
SukiUI.Demo/Features/ControlsLibrary/DockControls/PropertiesViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Dock.Model.Mvvm.Controls; | ||
|
||
namespace SukiUI.Demo.Features.ControlsLibrary.DockControls | ||
{ | ||
public class PropertiesViewModel : Tool | ||
{ | ||
|
||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
SukiUI.Demo/Features/ControlsLibrary/DockControls/SolutionExploreViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Dock.Model.Mvvm.Controls; | ||
|
||
namespace SukiUI.Demo.Features.ControlsLibrary.DockControls | ||
{ | ||
public class SolutionExploreViewModel : Tool | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<UserControl xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:controlsLibrary="clr-namespace:SukiUI.Demo.Features.ControlsLibrary" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:DataType="controlsLibrary:DockMvvmViewModel" | ||
x:Class="SukiUI.Demo.Features.ControlsLibrary.DockMvvmView"> | ||
<DockControl | ||
x:Name="DockControl" | ||
Layout="{Binding Layout}" | ||
Margin="4"/> | ||
</UserControl> |
12 changes: 12 additions & 0 deletions
12
SukiUI.Demo/Features/ControlsLibrary/DockMvvmView.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Avalonia.Controls; | ||
|
||
namespace SukiUI.Demo.Features.ControlsLibrary | ||
{ | ||
public partial class DockMvvmView : UserControl | ||
{ | ||
public DockMvvmView() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
Oops, something went wrong.