diff --git a/Directory.Packages.props b/Directory.Packages.props index 9f272a54a..e0c88a8b0 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,12 +1,13 @@ true - 12.0.0 + 12.0.5 + 12.0.4 - + diff --git a/Dock.slnx b/Dock.slnx index ce7e9f5d3..aa0f4290a 100644 --- a/Dock.slnx +++ b/Dock.slnx @@ -61,6 +61,7 @@ + @@ -84,6 +85,7 @@ + @@ -112,6 +114,7 @@ + diff --git a/build/Avalonia.Diagnostics.props b/build/Avalonia.Diagnostics.props index cb73056df..a4398c715 100644 --- a/build/Avalonia.Diagnostics.props +++ b/build/Avalonia.Diagnostics.props @@ -1,6 +1,6 @@  - + diff --git a/samples/DockDeferredContentSample/App.axaml.cs b/samples/DockDeferredContentSample/App.axaml.cs index 78761e49b..10509d1ca 100644 --- a/samples/DockDeferredContentSample/App.axaml.cs +++ b/samples/DockDeferredContentSample/App.axaml.cs @@ -1,6 +1,9 @@ using System; using Avalonia; using Avalonia.Controls.ApplicationLifetimes; +#if DEBUG +using Avalonia.Diagnostics; +#endif using Avalonia.Markup.Xaml; using Dock.Controls.DeferredContentControl; using DockDeferredContentSample.ViewModels; diff --git a/samples/DockDeferredContentSample/DockDeferredContentSample.csproj b/samples/DockDeferredContentSample/DockDeferredContentSample.csproj index 38ab241c6..b50d17813 100644 --- a/samples/DockDeferredContentSample/DockDeferredContentSample.csproj +++ b/samples/DockDeferredContentSample/DockDeferredContentSample.csproj @@ -12,6 +12,7 @@ + diff --git a/samples/DockReactiveUIFlatSample/App.axaml b/samples/DockReactiveUIFlatSample/App.axaml new file mode 100644 index 000000000..4c5713b72 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/App.axaml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + #FFFAFAFA + #E2E2E2 + + + #FF212121 + #1F1F1F + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/App.axaml.cs b/samples/DockReactiveUIFlatSample/App.axaml.cs new file mode 100644 index 000000000..836215f44 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/App.axaml.cs @@ -0,0 +1,89 @@ +using System.Diagnostics.CodeAnalysis; +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +#if DEBUG +using Avalonia.Diagnostics; +#endif +using Avalonia.Input; +using Avalonia.Markup.Xaml; +using Dock.Avalonia.Diagnostics.Controls; +using Dock.Avalonia.Diagnostics; +using Dock.Avalonia.Themes; +using Dock.Avalonia.Themes.Fluent; +using DockReactiveUIFlatSample.Services; +using DockReactiveUIFlatSample.ViewModels; +using DockReactiveUIFlatSample.Views; + +namespace DockReactiveUIFlatSample; + +[RequiresUnreferencedCode("Requires unreferenced code for MainWindowViewModel.")] +[RequiresDynamicCode("Requires unreferenced code for MainWindowViewModel.")] +public partial class App : Application +{ + public static IDockThemeManager? ThemeManager; + + public override void Initialize() + { + ThemeManager = new DockFluentThemeManager(); +#if DOCK_USE_GENERATED_APP_INITIALIZE_COMPONENT + InitializeComponent(); +#else + AvaloniaXamlLoader.Load(this); +#endif + } + + public override void OnFrameworkInitializationCompleted() + { + // DockManager.s_enableSplitToWindow = true; + + var themeService = ThemeManager is null ? null : new DockThemeService(ThemeManager); + var mainWindowViewModel = new MainWindowViewModel(themeService); + + switch (ApplicationLifetime) + { + case IClassicDesktopStyleApplicationLifetime desktopLifetime: + { + var mainWindow = new MainWindow + { + DataContext = mainWindowViewModel + }; +#if DEBUG + mainWindow.AttachDockDebug( + () => mainWindowViewModel.Layout!, + new KeyGesture(Key.F11)); + mainWindow.AttachDockDebugOverlay(new KeyGesture(Key.F9)); +#endif + mainWindow.Closing += (_, _) => + { + mainWindowViewModel.CloseLayout(); + }; + + desktopLifetime.MainWindow = mainWindow; + + desktopLifetime.Exit += (_, _) => + { + mainWindowViewModel.CloseLayout(); + }; + + break; + } + case ISingleViewApplicationLifetime singleViewLifetime: + { + var mainView = new MainView() + { + DataContext = mainWindowViewModel + }; + + singleViewLifetime.MainView = mainView; + + break; + } + } + + base.OnFrameworkInitializationCompleted(); + +#if DEBUG + this.AttachDevTools(); +#endif + } +} diff --git a/samples/DockReactiveUIFlatSample/DockReactiveUIFlatSample.csproj b/samples/DockReactiveUIFlatSample/DockReactiveUIFlatSample.csproj new file mode 100644 index 000000000..1dc097293 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/DockReactiveUIFlatSample.csproj @@ -0,0 +1,42 @@ + + + + net10.0 + WinExe + False + False + enable + InitializeComponent + true + true + $(BaseIntermediateOutputPath)\GeneratedFiles + + + + true + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/Models/DemoData.cs b/samples/DockReactiveUIFlatSample/Models/DemoData.cs new file mode 100644 index 000000000..862c32669 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Models/DemoData.cs @@ -0,0 +1,6 @@ + +namespace DockReactiveUIFlatSample.Models; + +public class DemoData +{ +} diff --git a/samples/DockReactiveUIFlatSample/Models/Documents/DemoDocument.cs b/samples/DockReactiveUIFlatSample/Models/Documents/DemoDocument.cs new file mode 100644 index 000000000..7881564da --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Models/Documents/DemoDocument.cs @@ -0,0 +1,6 @@ + +namespace DockReactiveUIFlatSample.Models.Documents; + +public class DemoDocument +{ +} diff --git a/samples/DockReactiveUIFlatSample/Models/Tools/Tool1.cs b/samples/DockReactiveUIFlatSample/Models/Tools/Tool1.cs new file mode 100644 index 000000000..5e6bc2289 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Models/Tools/Tool1.cs @@ -0,0 +1,6 @@ + +namespace DockReactiveUIFlatSample.Models.Tools; + +public class Tool1 +{ +} diff --git a/samples/DockReactiveUIFlatSample/Models/Tools/Tool2.cs b/samples/DockReactiveUIFlatSample/Models/Tools/Tool2.cs new file mode 100644 index 000000000..1c6faaa08 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Models/Tools/Tool2.cs @@ -0,0 +1,6 @@ + +namespace DockReactiveUIFlatSample.Models.Tools; + +public class Tool2 +{ +} diff --git a/samples/DockReactiveUIFlatSample/Models/Tools/Tool3.cs b/samples/DockReactiveUIFlatSample/Models/Tools/Tool3.cs new file mode 100644 index 000000000..492c40b24 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Models/Tools/Tool3.cs @@ -0,0 +1,6 @@ + +namespace DockReactiveUIFlatSample.Models.Tools; + +public class Tool3 +{ +} diff --git a/samples/DockReactiveUIFlatSample/Models/Tools/Tool4.cs b/samples/DockReactiveUIFlatSample/Models/Tools/Tool4.cs new file mode 100644 index 000000000..335379e0f --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Models/Tools/Tool4.cs @@ -0,0 +1,6 @@ + +namespace DockReactiveUIFlatSample.Models.Tools; + +public class Tool4 +{ +} diff --git a/samples/DockReactiveUIFlatSample/Models/Tools/Tool5.cs b/samples/DockReactiveUIFlatSample/Models/Tools/Tool5.cs new file mode 100644 index 000000000..2e2ce7ff6 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Models/Tools/Tool5.cs @@ -0,0 +1,6 @@ + +namespace DockReactiveUIFlatSample.Models.Tools; + +public class Tool5 +{ +} diff --git a/samples/DockReactiveUIFlatSample/Models/Tools/Tool6.cs b/samples/DockReactiveUIFlatSample/Models/Tools/Tool6.cs new file mode 100644 index 000000000..28ffe4214 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Models/Tools/Tool6.cs @@ -0,0 +1,6 @@ + +namespace DockReactiveUIFlatSample.Models.Tools; + +public class Tool6 +{ +} diff --git a/samples/DockReactiveUIFlatSample/Models/Tools/Tool7.cs b/samples/DockReactiveUIFlatSample/Models/Tools/Tool7.cs new file mode 100644 index 000000000..db9585a1d --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Models/Tools/Tool7.cs @@ -0,0 +1,6 @@ + +namespace DockReactiveUIFlatSample.Models.Tools; + +public class Tool7 +{ +} diff --git a/samples/DockReactiveUIFlatSample/Models/Tools/Tool8.cs b/samples/DockReactiveUIFlatSample/Models/Tools/Tool8.cs new file mode 100644 index 000000000..ecfcf1c3a --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Models/Tools/Tool8.cs @@ -0,0 +1,6 @@ + +namespace DockReactiveUIFlatSample.Models.Tools; + +public class Tool8 +{ +} diff --git a/samples/DockReactiveUIFlatSample/Program.cs b/samples/DockReactiveUIFlatSample/Program.cs new file mode 100644 index 000000000..3bddbd4cc --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Program.cs @@ -0,0 +1,30 @@ +// Copyright (c) Wiesław Šoltés. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for details. +using Avalonia; +using ReactiveUI.Avalonia; +using System; +using System.Diagnostics.CodeAnalysis; +using Dock.Settings; + +namespace DockReactiveUIFlatSample; + +[RequiresUnreferencedCode("Requires unreferenced code for App.")] +[RequiresDynamicCode("Requires unreferenced code for App.")] +internal class Program +{ + [STAThread] + private static void Main(string[] args) + { + BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); + } + + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure() + .UsePlatformDetect() + .WithInterFont() + .UseReactiveUI() + .ShowDockablePreviewOnDrag() + .SetDragPreviewOpacity(0.6) + // .UseManagedWindows() + .LogToTrace(); +} diff --git a/samples/DockReactiveUIFlatSample/Services/DockThemeService.cs b/samples/DockReactiveUIFlatSample/Services/DockThemeService.cs new file mode 100644 index 000000000..53e9d72ed --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Services/DockThemeService.cs @@ -0,0 +1,33 @@ +using System.Collections.Generic; +using Avalonia; +using Avalonia.Styling; +using Dock.Avalonia.Themes; +using DockReactiveUIFlatSample.ViewModels; + +namespace DockReactiveUIFlatSample.Services; + +internal sealed class DockThemeService : IThemeService +{ + private readonly IDockThemeManager _themeManager; + + public DockThemeService(IDockThemeManager themeManager) + { + _themeManager = themeManager; + } + + public IReadOnlyList PresetNames => _themeManager.PresetNames; + + public int CurrentPresetIndex => _themeManager.CurrentPresetIndex; + + public bool IsDark => Application.Current?.RequestedThemeVariant == ThemeVariant.Dark; + + public void SwitchDark(bool isDark) + { + _themeManager.Switch(isDark ? 1 : 0); + } + + public void SwitchPreset(int index) + { + _themeManager.SwitchPreset(index); + } +} diff --git a/samples/DockReactiveUIFlatSample/ViewLocator.cs b/samples/DockReactiveUIFlatSample/ViewLocator.cs new file mode 100644 index 000000000..28866dd11 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewLocator.cs @@ -0,0 +1,41 @@ +using System; +using Avalonia.Controls; +using Avalonia.Controls.Templates; +//using CommunityToolkit.Mvvm.ComponentModel; +using Dock.Model.Core; +using ReactiveUI; +using StaticViewLocator; + +namespace DockReactiveUIFlatSample; + +[StaticViewLocator] +public partial class ViewLocator : IDataTemplate +{ + public Control? Build(object? data) + { + if (data is null) + { + return null; + } + + var type = data.GetType(); + + if (s_views.TryGetValue(type, out var func)) + { + return func.Invoke(); + } + + throw new Exception($"Unable to create view for type: {type}"); + } + + public bool Match(object? data) + { + if (data is null) + { + return false; + } + + var type = data.GetType(); + return data is IDockable || s_views.ContainsKey(type); + } +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/DockFactory.cs b/samples/DockReactiveUIFlatSample/ViewModels/DockFactory.cs new file mode 100644 index 000000000..a9a5d839b --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/DockFactory.cs @@ -0,0 +1,283 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using DockReactiveUIFlatSample.Models.Documents; +using DockReactiveUIFlatSample.Models.Tools; +using DockReactiveUIFlatSample.ViewModels.Docks; +using DockReactiveUIFlatSample.ViewModels.Documents; +using DockReactiveUIFlatSample.ViewModels.Tools; +using DockReactiveUIFlatSample.ViewModels.Views; +using Dock.Avalonia.Controls; +using Dock.Settings; +using Dock.Model.Controls; +using Dock.Model.Core; +using Dock.Model.ReactiveUI; +using Dock.Model.ReactiveUI.Controls; + +namespace DockReactiveUIFlatSample.ViewModels; + +[RequiresUnreferencedCode("Requires unreferenced code for CustomDocumentDock.")] +[RequiresDynamicCode("Requires unreferenced code for CustomDocumentDock.")] +public class DockFactory : Factory +{ + private readonly object _context; + private IRootDock? _rootDock; + private IDocumentDock? _documentDock; + + public DockFactory(object context) + { + _context = context; + } + + public override IRootDock CreateRootDock() => DockingDefaults.EnableDocking(base.CreateRootDock()); + + public override IProportionalDock CreateProportionalDock() => DockingDefaults.EnableDocking(base.CreateProportionalDock()); + + public override IDockDock CreateDockDock() => DockingDefaults.EnableDocking(base.CreateDockDock()); + + public override IStackDock CreateStackDock() => DockingDefaults.EnableDocking(base.CreateStackDock()); + + public override IGridDock CreateGridDock() => DockingDefaults.EnableDocking(base.CreateGridDock()); + + public override IWrapDock CreateWrapDock() => DockingDefaults.EnableDocking(base.CreateWrapDock()); + + public override IUniformGridDock CreateUniformGridDock() => DockingDefaults.EnableDocking(base.CreateUniformGridDock()); + + public override IProportionalDockSplitter CreateProportionalDockSplitter() => DockingDefaults.EnableDocking(base.CreateProportionalDockSplitter()); + + public override IGridDockSplitter CreateGridDockSplitter() => DockingDefaults.EnableDocking(base.CreateGridDockSplitter()); + + public override IToolDock CreateToolDock() => DockingDefaults.EnableDocking(base.CreateToolDock()); + + public override IDocumentDock CreateDocumentDock() => DockingDefaults.EnableDocking(new CustomDocumentDock()); + + public override ISplitViewDock CreateSplitViewDock() => DockingDefaults.EnableDocking(base.CreateSplitViewDock()); + + public override IDocument CreateDocument() => DockingDefaults.EnableDocking(base.CreateDocument()); + + public override ITool CreateTool() => DockingDefaults.EnableDocking(base.CreateTool()); + + public override void AddDockable(IDock dock, IDockable dockable) + { + EnableDocking(dock); + DockingDefaults.EnableDockingTree(dockable); + base.AddDockable(dock, dockable); + } + + public override void InsertDockable(IDock dock, IDockable dockable, int index) + { + EnableDocking(dock); + DockingDefaults.EnableDockingTree(dockable); + base.InsertDockable(dock, dockable, index); + } + + public override IDock CreateSplitLayout(IDock dock, IDockable dockable, DockOperation operation) + { + EnableDocking(dock); + DockingDefaults.EnableDockingTree(dockable); + return DockingDefaults.EnableDockingTree(base.CreateSplitLayout(dock, dockable, operation)); + } + + public override void SplitToDock(IDock dock, IDockable dockable, DockOperation operation) + { + EnableDocking(dock); + DockingDefaults.EnableDockingTree(dockable); + base.SplitToDock(dock, dockable, operation); + } + + public override IRootDock CreateLayout() + { + var document1 = EnableDocking(new DocumentViewModel {Id = "Document1", Title = "Document1"}); + var document2 = EnableDocking(new DocumentViewModel {Id = "Document2", Title = "Document2"}); + var document3 = EnableDocking(new DocumentViewModel {Id = "Document3", Title = "Document3", CanClose = true}); + var tool1 = EnableDocking(new Tool1ViewModel {Id = "Tool1", Title = "Tool1", KeepPinnedDockableVisible = true}); + var tool2 = EnableDocking(new Tool2ViewModel {Id = "Tool2", Title = "Tool2", KeepPinnedDockableVisible = true}); + var tool3 = EnableDocking(new Tool3ViewModel {Id = "Tool3", Title = "Tool3"}); + var tool4 = EnableDocking(new Tool4ViewModel {Id = "Tool4", Title = "Tool4"}); + var tool5 = EnableDocking(new Tool5ViewModel {Id = "Tool5", Title = "Tool5"}); + var tool6 = EnableDocking(new Tool6ViewModel {Id = "Tool6", Title = "Tool6", CanClose = true, CanPin = true}); + var tool7 = EnableDocking(new Tool7ViewModel {Id = "Tool7", Title = "Tool7", CanClose = false, CanPin = false}); + var tool8 = EnableDocking(new Tool8ViewModel {Id = "Tool8", Title = "Tool8", CanClose = false, CanPin = true}); + + var leftDock = EnableDocking(new ProportionalDock + { + Proportion = 0.25, + Orientation = Orientation.Vertical, + ActiveDockable = null, + VisibleDockables = CreateList + ( + EnableDocking(new ToolDock + { + ActiveDockable = tool1, + VisibleDockables = CreateList(tool1, tool2), + Alignment = Alignment.Left + }), + CreateProportionalDockSplitter(), + EnableDocking(new ToolDock + { + ActiveDockable = tool3, + VisibleDockables = CreateList(tool3, tool4), + Alignment = Alignment.Bottom + }) + ) + }); + + var rightDock = EnableDocking(new ProportionalDock + { + Proportion = 0.25, + Orientation = Orientation.Vertical, + ActiveDockable = null, + VisibleDockables = CreateList + ( + EnableDocking(new ToolDock + { + ActiveDockable = tool5, + VisibleDockables = CreateList(tool5, tool6), + Alignment = Alignment.Top, + GripMode = GripMode.Visible + }), + CreateProportionalDockSplitter(), + EnableDocking(new ToolDock + { + ActiveDockable = tool7, + VisibleDockables = CreateList(tool7, tool8), + Alignment = Alignment.Right, + GripMode = GripMode.Visible + }) + ) + }); + + var documentDock = EnableDocking(new CustomDocumentDock + { + IsCollapsable = false, + ActiveDockable = document1, + VisibleDockables = CreateList(document1, document2, document3), + CanCreateDocument = true, + EnableWindowDrag = true + }); + + var mainLayout = EnableDocking(new ProportionalDock + { + Orientation = Orientation.Horizontal, + VisibleDockables = CreateList + ( + leftDock, + CreateProportionalDockSplitter(), + documentDock, + CreateProportionalDockSplitter(), + rightDock + ) + }); + + var dashboardView = EnableDocking(new DashboardViewModel + { + Id = "Dashboard", + Title = "Dashboard" + }); + + var homeView = EnableDocking(new HomeViewModel + { + Id = "Home", + Title = "Home", + ActiveDockable = mainLayout, + VisibleDockables = CreateList(mainLayout) + }); + + var rootDock = EnableDocking(CreateRootDock()); + + rootDock.IsCollapsable = false; + rootDock.ActiveDockable = dashboardView; + rootDock.DefaultDockable = homeView; + rootDock.VisibleDockables = CreateList(dashboardView, homeView); + + rootDock.LeftPinnedDockables = CreateList(); + rootDock.RightPinnedDockables = CreateList(); + rootDock.TopPinnedDockables = CreateList(); + rootDock.BottomPinnedDockables = CreateList(); + + rootDock.PinnedDock = null; + + _documentDock = documentDock; + _rootDock = rootDock; + + return DockingDefaults.EnableDockingTree(rootDock); + } + + public override IDockWindow? CreateWindowFrom(IDockable dockable) + { + var window = base.CreateWindowFrom(dockable); + + if (window != null) + { + window.Title = "Dock Avalonia Demo"; + if (window.Layout is { } layout) + { + DockingDefaults.EnableDockingTree(layout); + } + } + return window; + } + + public override void InitLayout(IDockable layout) + { + ContextLocator = new Dictionary> + { + ["Document1"] = () => new DemoDocument(), + ["Document2"] = () => new DemoDocument(), + ["Document3"] = () => new DemoDocument(), + ["Tool1"] = () => new Tool1(), + ["Tool2"] = () => new Tool2(), + ["Tool3"] = () => new Tool3(), + ["Tool4"] = () => new Tool4(), + ["Tool5"] = () => new Tool5(), + ["Tool6"] = () => new Tool6(), + ["Tool7"] = () => new Tool7(), + ["Tool8"] = () => new Tool8(), + ["Dashboard"] = () => layout, + ["Home"] = () => _context + }; + + DockableLocator = new Dictionary>() + { + ["Root"] = () => _rootDock, + ["Documents"] = () => _documentDock + }; + + HostWindowLocator = new Dictionary> + { + [nameof(IDockWindow)] = () => DockSettings.UseManagedWindows ? new ManagedHostWindow() : new HostWindow() + }; + + base.InitLayout(layout); + DockingDefaults.EnableDockingTree(layout); + } + + public override void InitDockWindow(IDockWindow window, IDockable? owner) + { + InitDockWindow(window, owner, GetHostWindow(window.Id)); + } + + public override void InitDockWindow(IDockWindow window, IDockable? owner, IHostWindow? hostWindow) + { + EnableDockWindowDocking(window, owner); + base.InitDockWindow(window, owner, hostWindow); + } + + private static void EnableDockWindowDocking(IDockWindow window, IDockable? owner) + { + if (owner is not null) + { + EnableDocking(owner); + } + + if (window.Layout is { } layout) + { + DockingDefaults.EnableDockingTree(layout); + } + } + + private static T EnableDocking(T dockable) where T : IDockable + { + return DockingDefaults.EnableDocking(dockable); + } +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/DockingDefaults.cs b/samples/DockReactiveUIFlatSample/ViewModels/DockingDefaults.cs new file mode 100644 index 000000000..fe28b8eb6 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/DockingDefaults.cs @@ -0,0 +1,133 @@ +using System.Collections.Generic; +using Dock.Model.Controls; +using Dock.Model.Core; + +namespace DockReactiveUIFlatSample.ViewModels; + +internal static class DockingDefaults +{ + public static T EnableDocking(T dockable) where T : IDockable + { + dockable.CanFloat = true; + dockable.CanDrag = true; + dockable.CanDrop = true; + dockable.CanDockAsDocument = true; + + if (dockable is IDockableDockingRestrictions restrictions) + { + restrictions.AllowedDockOperations = DockOperationMask.All; + restrictions.AllowedDropOperations = DockOperationMask.All; + } + + if (dockable is IDock dock) + { + dock.EnableGlobalDocking = true; + } + + return dockable; + } + + public static T EnableDockingTree(T dockable) where T : IDockable + { + EnableDockingTree(dockable, new HashSet()); + return dockable; + } + + private static void EnableDockingTree(IDockable dockable, ISet visited) + { + if (!visited.Add(dockable)) + { + return; + } + + EnableDocking(dockable); + + if (dockable is IDock dock && dock.VisibleDockables is { } visibleDockables) + { + EnableDockingTree(visibleDockables, visited); + } + + if (dockable is IDock dockWithSelection) + { + if (dockWithSelection.ActiveDockable is { } activeDockable) + { + EnableDockingTree(activeDockable, visited); + } + + if (dockWithSelection.DefaultDockable is { } defaultDockable) + { + EnableDockingTree(defaultDockable, visited); + } + + if (dockWithSelection.FocusedDockable is { } focusedDockable) + { + EnableDockingTree(focusedDockable, visited); + } + } + + if (dockable is ISplitViewDock splitViewDock) + { + if (splitViewDock.PaneDockable is { } paneDockable) + { + EnableDockingTree(paneDockable, visited); + } + + if (splitViewDock.ContentDockable is { } contentDockable) + { + EnableDockingTree(contentDockable, visited); + } + } + + if (dockable is IRootDock rootDock) + { + if (rootDock.HiddenDockables is { } hiddenDockables) + { + EnableDockingTree(hiddenDockables, visited); + } + + if (rootDock.LeftPinnedDockables is { } leftPinnedDockables) + { + EnableDockingTree(leftPinnedDockables, visited); + } + + if (rootDock.RightPinnedDockables is { } rightPinnedDockables) + { + EnableDockingTree(rightPinnedDockables, visited); + } + + if (rootDock.TopPinnedDockables is { } topPinnedDockables) + { + EnableDockingTree(topPinnedDockables, visited); + } + + if (rootDock.BottomPinnedDockables is { } bottomPinnedDockables) + { + EnableDockingTree(bottomPinnedDockables, visited); + } + + if (rootDock.PinnedDock is { } pinnedDock) + { + EnableDockingTree(pinnedDock, visited); + } + + if (rootDock.Windows is { } windows) + { + foreach (var window in windows) + { + if (window.Layout is { } windowLayout) + { + EnableDockingTree(windowLayout, visited); + } + } + } + } + } + + private static void EnableDockingTree(IEnumerable dockables, ISet visited) + { + foreach (var dockable in dockables) + { + EnableDockingTree(dockable, visited); + } + } +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/Docks/CustomDocumentDock.cs b/samples/DockReactiveUIFlatSample/ViewModels/Docks/CustomDocumentDock.cs new file mode 100644 index 000000000..206715742 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/Docks/CustomDocumentDock.cs @@ -0,0 +1,32 @@ +using System.Diagnostics.CodeAnalysis; +using DockReactiveUIFlatSample.ViewModels; +using DockReactiveUIFlatSample.ViewModels.Documents; +using Dock.Model.ReactiveUI.Controls; +using ReactiveUI; + +namespace DockReactiveUIFlatSample.ViewModels.Docks; + +[RequiresUnreferencedCode("Requires unreferenced code for ReactiveCommand.Create.")] +[RequiresDynamicCode("Requires unreferenced code for ReactiveCommand.Create.")] +public class CustomDocumentDock : DocumentDock +{ + public CustomDocumentDock() + { + CreateDocument = ReactiveCommand.Create(CreateNewDocument); + } + + private void CreateNewDocument() + { + if (!CanCreateDocument) + { + return; + } + + var index = VisibleDockables?.Count + 1; + var document = DockingDefaults.EnableDocking(new DocumentViewModel {Id = $"Document{index}", Title = $"Document{index}"}); + + Factory?.AddDockable(this, document); + Factory?.SetActiveDockable(document); + Factory?.SetFocusedDockable(this, document); + } +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/Documents/DocumentViewModel.cs b/samples/DockReactiveUIFlatSample/ViewModels/Documents/DocumentViewModel.cs new file mode 100644 index 000000000..a2ca4260e --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/Documents/DocumentViewModel.cs @@ -0,0 +1,7 @@ +using Dock.Model.ReactiveUI.Controls; + +namespace DockReactiveUIFlatSample.ViewModels.Documents; + +public class DocumentViewModel : Document +{ +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/IThemeService.cs b/samples/DockReactiveUIFlatSample/ViewModels/IThemeService.cs new file mode 100644 index 000000000..0a8edefab --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/IThemeService.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace DockReactiveUIFlatSample.ViewModels; + +internal interface IThemeService +{ + IReadOnlyList PresetNames { get; } + + int CurrentPresetIndex { get; } + + bool IsDark { get; } + + void SwitchDark(bool isDark); + + void SwitchPreset(int index); +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/MainWindowViewModel.cs b/samples/DockReactiveUIFlatSample/ViewModels/MainWindowViewModel.cs new file mode 100644 index 000000000..113ac6a72 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/MainWindowViewModel.cs @@ -0,0 +1,265 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Windows.Input; +using DockReactiveUIFlatSample.Models; +using Dock.Model.Controls; +using Dock.Model.Core; +using ReactiveUI; + +namespace DockReactiveUIFlatSample.ViewModels; + +[RequiresUnreferencedCode("Requires unreferenced code for RaiseAndSetIfChanged.")] +[RequiresDynamicCode("Requires unreferenced code for RaiseAndSetIfChanged.")] +public class MainWindowViewModel : ReactiveObject +{ + private readonly IFactory? _factory; + private readonly IThemeService? _themeService; + private IRootDock? _layout; + private string _globalStatus = "Global: (none)"; + private int _selectedPresetIndex = -1; + private bool _isDarkTheme; + + public IRootDock? Layout + { + get => _layout; + set => this.RaiseAndSetIfChanged(ref _layout, value); + } + + public string GlobalStatus + { + get => _globalStatus; + set => this.RaiseAndSetIfChanged(ref _globalStatus, value); + } + + public IReadOnlyList PresetNames { get; } + + public int SelectedPresetIndex + { + get => _selectedPresetIndex; + set + { + if (_selectedPresetIndex == value) + { + return; + } + + this.RaiseAndSetIfChanged(ref _selectedPresetIndex, value); + if (value >= 0) + { + _themeService?.SwitchPreset(value); + } + } + } + + public ICommand NewLayout { get; } + + public ICommand ToggleTheme { get; } + + public MainWindowViewModel() + : this(null) + { + } + + internal MainWindowViewModel(IThemeService? themeService) + { + _themeService = themeService; + PresetNames = themeService?.PresetNames ?? Array.Empty(); + _selectedPresetIndex = themeService?.CurrentPresetIndex ?? -1; + _isDarkTheme = themeService?.IsDark == true; + _factory = new DockFactory(new DemoData()); + + DebugFactoryEvents(_factory); + + var layout = _factory?.CreateLayout(); + if (layout is not null) + { + _factory?.InitLayout(layout); + layout.Navigate.Execute("Home"); + } + Layout = layout; + GlobalStatus = layout is null + ? "Global: (none)" + : FormatGlobalStatus(_factory?.GlobalDockTrackingState ?? GlobalDockTrackingState.Empty); + + NewLayout = ReactiveCommand.Create(ResetLayout); + ToggleTheme = ReactiveCommand.Create(ToggleThemeVariant); + } + + private void ToggleThemeVariant() + { + _isDarkTheme = !_isDarkTheme; + _themeService?.SwitchDark(_isDarkTheme); + } + + private void DebugFactoryEvents(IFactory factory) + { + factory.ActiveDockableChanged += (_, args) => + { + Debug.WriteLine($"[ActiveDockableChanged] Title='{args.Dockable?.Title}', Root='{args.RootDock?.Id}', Window='{args.Window?.Id}'"); + }; + + factory.FocusedDockableChanged += (_, args) => + { + Debug.WriteLine($"[FocusedDockableChanged] Title='{args.Dockable?.Title}', Root='{args.RootDock?.Id}', Window='{args.Window?.Id}'"); + }; + + factory.GlobalDockTrackingChanged += (_, args) => + { + GlobalStatus = FormatGlobalStatus(args.Current); + Debug.WriteLine($"[GlobalDockTrackingChanged] Reason='{args.Reason}', Dockable='{args.Current.Dockable?.Title}', Root='{args.Current.RootDock?.Id}', Window='{args.Current.Window?.Id}'"); + }; + + factory.DockableAdded += (_, args) => + { + Debug.WriteLine($"[DockableAdded] Title='{args.Dockable?.Title}'"); + }; + + factory.DockableRemoved += (_, args) => + { + Debug.WriteLine($"[DockableRemoved] Title='{args.Dockable?.Title}'"); + }; + + factory.DockableClosed += (_, args) => + { + Debug.WriteLine($"[DockableClosed] Title='{args.Dockable?.Title}'"); + }; + + factory.DockableMoved += (_, args) => + { + Debug.WriteLine($"[DockableMoved] Title='{args.Dockable?.Title}'"); + }; + + factory.DockableDocked += (_, args) => + { + Debug.WriteLine($"[DockableDocked] Title='{args.Dockable?.Title}', Operation='{args.Operation}'"); + }; + + factory.DockableUndocked += (_, args) => + { + Debug.WriteLine($"[DockableUndocked] Title='{args.Dockable?.Title}', Operation='{args.Operation}'"); + }; + + factory.DockableSwapped += (_, args) => + { + Debug.WriteLine($"[DockableSwapped] Title='{args.Dockable?.Title}'"); + }; + + factory.DockablePinned += (_, args) => + { + Debug.WriteLine($"[DockablePinned] Title='{args.Dockable?.Title}'"); + }; + + factory.DockableUnpinned += (_, args) => + { + Debug.WriteLine($"[DockableUnpinned] Title='{args.Dockable?.Title}'"); + }; + + factory.WindowOpened += (_, args) => + { + Debug.WriteLine($"[WindowOpened] Title='{args.Window?.Title}'"); + }; + + factory.WindowClosed += (_, args) => + { + Debug.WriteLine($"[WindowClosed] Title='{args.Window?.Title}'"); + }; + + factory.WindowClosing += (_, args) => + { + // NOTE: Set to True to cancel window closing. +#if false + args.Cancel = true; +#endif + Debug.WriteLine($"[WindowClosing] Title='{args.Window?.Title}', Cancel={args.Cancel}"); + }; + + factory.WindowAdded += (_, args) => + { + Debug.WriteLine($"[WindowAdded] Title='{args.Window?.Title}'"); + }; + + factory.WindowRemoved += (_, args) => + { + Debug.WriteLine($"[WindowRemoved] Title='{args.Window?.Title}'"); + }; + + factory.WindowMoveDragBegin += (_, args) => + { + // NOTE: Set to True to cancel window dragging. +#if false + args.Cancel = true; +#endif + Debug.WriteLine($"[WindowMoveDragBegin] Title='{args.Window?.Title}', Cancel={args.Cancel}, X='{args.Window?.X}', Y='{args.Window?.Y}'"); + }; + + factory.WindowMoveDrag += (_, args) => + { + Debug.WriteLine($"[WindowMoveDrag] Title='{args.Window?.Title}', X='{args.Window?.X}', Y='{args.Window?.Y}"); + }; + + factory.WindowMoveDragEnd += (_, args) => + { + Debug.WriteLine($"[WindowMoveDragEnd] Title='{args.Window?.Title}', X='{args.Window?.X}', Y='{args.Window?.Y}"); + }; + + factory.WindowActivated += (_, args) => + { + Debug.WriteLine($"[WindowActivated] Title='{args.Window?.Title}'"); + }; + + factory.DockableActivated += (_, args) => + { + Debug.WriteLine($"[DockableActivated] Title='{args.Dockable?.Title}'"); + }; + + factory.WindowDeactivated += (_, args) => + { + Debug.WriteLine($"[WindowDeactivated] Title='{args.Window?.Title}'"); + }; + + factory.DockableDeactivated += (_, args) => + { + Debug.WriteLine($"[DockableDeactivated] Title='{args.Dockable?.Title}'"); + }; + } + + public void CloseLayout() + { + if (Layout is IDock dock) + { + if (dock.Close.CanExecute(null)) + { + dock.Close.Execute(null); + } + } + } + + public void ResetLayout() + { + if (Layout is not null) + { + if (Layout.Close.CanExecute(null)) + { + Layout.Close.Execute(null); + } + } + + var layout = _factory?.CreateLayout(); + if (layout is not null) + { + _factory?.InitLayout(layout); + Layout = layout; + } + } + + private static string FormatGlobalStatus(GlobalDockTrackingState state) + { + var dockableTitle = state.Dockable?.Title ?? "(none)"; + var rootId = state.RootDock?.Id ?? "(none)"; + var windowTitle = state.Window?.Title ?? "(main)"; + var host = state.HostWindow?.GetType().Name ?? "(main)"; + return $"Dockable: {dockableTitle} | Root: {rootId} | Window: {windowTitle} | Host: {host}"; + } +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool1ViewModel.cs b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool1ViewModel.cs new file mode 100644 index 000000000..e7342f000 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool1ViewModel.cs @@ -0,0 +1,7 @@ +using Dock.Model.ReactiveUI.Controls; + +namespace DockReactiveUIFlatSample.ViewModels.Tools; + +public class Tool1ViewModel : Tool +{ +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool2ViewModel.cs b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool2ViewModel.cs new file mode 100644 index 000000000..669503140 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool2ViewModel.cs @@ -0,0 +1,7 @@ +using Dock.Model.ReactiveUI.Controls; + +namespace DockReactiveUIFlatSample.ViewModels.Tools; + +public class Tool2ViewModel : Tool +{ +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool3ViewModel.cs b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool3ViewModel.cs new file mode 100644 index 000000000..0698f6349 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool3ViewModel.cs @@ -0,0 +1,7 @@ +using Dock.Model.ReactiveUI.Controls; + +namespace DockReactiveUIFlatSample.ViewModels.Tools; + +public class Tool3ViewModel : Tool +{ +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool4ViewModel.cs b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool4ViewModel.cs new file mode 100644 index 000000000..7bd1f3503 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool4ViewModel.cs @@ -0,0 +1,7 @@ +using Dock.Model.ReactiveUI.Controls; + +namespace DockReactiveUIFlatSample.ViewModels.Tools; + +public class Tool4ViewModel : Tool +{ +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool5ViewModel.cs b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool5ViewModel.cs new file mode 100644 index 000000000..d3b27b1e1 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool5ViewModel.cs @@ -0,0 +1,7 @@ +using Dock.Model.ReactiveUI.Controls; + +namespace DockReactiveUIFlatSample.ViewModels.Tools; + +public class Tool5ViewModel : Tool +{ +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool6ViewModel.cs b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool6ViewModel.cs new file mode 100644 index 000000000..b695242cd --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool6ViewModel.cs @@ -0,0 +1,7 @@ +using Dock.Model.ReactiveUI.Controls; + +namespace DockReactiveUIFlatSample.ViewModels.Tools; + +public class Tool6ViewModel : Tool +{ +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool7ViewModel.cs b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool7ViewModel.cs new file mode 100644 index 000000000..48ef5b812 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool7ViewModel.cs @@ -0,0 +1,7 @@ +using Dock.Model.ReactiveUI.Controls; + +namespace DockReactiveUIFlatSample.ViewModels.Tools; + +public class Tool7ViewModel : Tool +{ +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool8ViewModel.cs b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool8ViewModel.cs new file mode 100644 index 000000000..01a872edf --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/Tools/Tool8ViewModel.cs @@ -0,0 +1,7 @@ +using Dock.Model.ReactiveUI.Controls; + +namespace DockReactiveUIFlatSample.ViewModels.Tools; + +public class Tool8ViewModel : Tool +{ +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/Views/DashboardViewModel.cs b/samples/DockReactiveUIFlatSample/ViewModels/Views/DashboardViewModel.cs new file mode 100644 index 000000000..580826e61 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/Views/DashboardViewModel.cs @@ -0,0 +1,7 @@ +using Dock.Model.ReactiveUI.Core; + +namespace DockReactiveUIFlatSample.ViewModels.Views; + +public class DashboardViewModel : DockBase +{ +} diff --git a/samples/DockReactiveUIFlatSample/ViewModels/Views/HomeViewModel.cs b/samples/DockReactiveUIFlatSample/ViewModels/Views/HomeViewModel.cs new file mode 100644 index 000000000..a2aa4d897 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/ViewModels/Views/HomeViewModel.cs @@ -0,0 +1,7 @@ +using Dock.Model.ReactiveUI.Controls; + +namespace DockReactiveUIFlatSample.ViewModels.Views; + +public class HomeViewModel : RootDock +{ +} diff --git a/samples/DockReactiveUIFlatSample/Views/DockableOptionsView.axaml b/samples/DockReactiveUIFlatSample/Views/DockableOptionsView.axaml new file mode 100644 index 000000000..5cdb6c888 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/DockableOptionsView.axaml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/Views/DockableOptionsView.axaml.cs b/samples/DockReactiveUIFlatSample/Views/DockableOptionsView.axaml.cs new file mode 100644 index 000000000..aa96156a1 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/DockableOptionsView.axaml.cs @@ -0,0 +1,35 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using Dock.Model.Core; + +namespace DockReactiveUIFlatSample.Views; + +public partial class DockableOptionsView : UserControl +{ + public static object?[] PinnedDockDisplayModeOptions { get; } = + { + null, + PinnedDockDisplayMode.Overlay, + PinnedDockDisplayMode.Inline + }; + + public static DockingWindowState[] DockingWindowStateOptions { get; } = + { + DockingWindowState.Docked, + DockingWindowState.Pinned, + DockingWindowState.Document, + DockingWindowState.Docked | DockingWindowState.Floating, + DockingWindowState.Pinned | DockingWindowState.Floating, + DockingWindowState.Document | DockingWindowState.Floating, + DockingWindowState.Docked | DockingWindowState.Hidden, + DockingWindowState.Pinned | DockingWindowState.Hidden, + DockingWindowState.Document | DockingWindowState.Hidden, + DockingWindowState.Docked | DockingWindowState.Floating | DockingWindowState.Hidden, + DockingWindowState.Document | DockingWindowState.Floating | DockingWindowState.Hidden + }; + + public DockableOptionsView() + { + InitializeComponent(); + } +} diff --git a/samples/DockReactiveUIFlatSample/Views/Documents/DocumentView.axaml b/samples/DockReactiveUIFlatSample/Views/Documents/DocumentView.axaml new file mode 100644 index 000000000..b54f2e0ca --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Documents/DocumentView.axaml @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/Views/Documents/DocumentView.axaml.cs b/samples/DockReactiveUIFlatSample/Views/Documents/DocumentView.axaml.cs new file mode 100644 index 000000000..810729078 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Documents/DocumentView.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace DockReactiveUIFlatSample.Views.Documents; + +public partial class DocumentView : UserControl +{ + public DocumentView() + { + InitializeComponent(); + } +} diff --git a/samples/DockReactiveUIFlatSample/Views/MainView.axaml b/samples/DockReactiveUIFlatSample/Views/MainView.axaml new file mode 100644 index 000000000..2b34ab2d5 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/MainView.axaml @@ -0,0 +1,86 @@ + + + + + + M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm0-2V4a8 8 0 1 1 0 16Z + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/Views/MainView.axaml.cs b/samples/DockReactiveUIFlatSample/Views/MainView.axaml.cs new file mode 100644 index 000000000..20e27101c --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/MainView.axaml.cs @@ -0,0 +1,11 @@ +using Avalonia.Controls; + +namespace DockReactiveUIFlatSample.Views; + +public partial class MainView : UserControl +{ + public MainView() + { + InitializeComponent(); + } +} diff --git a/samples/DockReactiveUIFlatSample/Views/MainWindow.axaml b/samples/DockReactiveUIFlatSample/Views/MainWindow.axaml new file mode 100644 index 000000000..78532671e --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/MainWindow.axaml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/Views/MainWindow.axaml.cs b/samples/DockReactiveUIFlatSample/Views/MainWindow.axaml.cs new file mode 100644 index 000000000..88dc090b1 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/MainWindow.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace DockReactiveUIFlatSample.Views; + +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } +} diff --git a/samples/DockReactiveUIFlatSample/Views/ProportionalStackPanelView.axaml b/samples/DockReactiveUIFlatSample/Views/ProportionalStackPanelView.axaml new file mode 100644 index 000000000..bbbbeea16 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/ProportionalStackPanelView.axaml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/Views/ProportionalStackPanelView.axaml.cs b/samples/DockReactiveUIFlatSample/Views/ProportionalStackPanelView.axaml.cs new file mode 100644 index 000000000..b8ad0b838 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/ProportionalStackPanelView.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace DockReactiveUIFlatSample.Views; + +public partial class ProportionalStackPanelView : UserControl +{ + public ProportionalStackPanelView() + { + InitializeComponent(); + } +} diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool1View.axaml b/samples/DockReactiveUIFlatSample/Views/Tools/Tool1View.axaml new file mode 100644 index 000000000..ff6f7ed2c --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool1View.axaml @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool1View.axaml.cs b/samples/DockReactiveUIFlatSample/Views/Tools/Tool1View.axaml.cs new file mode 100644 index 000000000..d6e249b19 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool1View.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace DockReactiveUIFlatSample.Views.Tools; + +public partial class Tool1View : UserControl +{ + public Tool1View() + { + InitializeComponent(); + } +} diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool2View.axaml b/samples/DockReactiveUIFlatSample/Views/Tools/Tool2View.axaml new file mode 100644 index 000000000..c2534c801 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool2View.axaml @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool2View.axaml.cs b/samples/DockReactiveUIFlatSample/Views/Tools/Tool2View.axaml.cs new file mode 100644 index 000000000..286273415 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool2View.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace DockReactiveUIFlatSample.Views.Tools; + +public partial class Tool2View : UserControl +{ + public Tool2View() + { + InitializeComponent(); + } +} diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool3View.axaml b/samples/DockReactiveUIFlatSample/Views/Tools/Tool3View.axaml new file mode 100644 index 000000000..0be9dee0b --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool3View.axaml @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool3View.axaml.cs b/samples/DockReactiveUIFlatSample/Views/Tools/Tool3View.axaml.cs new file mode 100644 index 000000000..ad6b7b914 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool3View.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace DockReactiveUIFlatSample.Views.Tools; + +public partial class Tool3View : UserControl +{ + public Tool3View() + { + InitializeComponent(); + } +} diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool4View.axaml b/samples/DockReactiveUIFlatSample/Views/Tools/Tool4View.axaml new file mode 100644 index 000000000..aa5d2a00a --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool4View.axaml @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool4View.axaml.cs b/samples/DockReactiveUIFlatSample/Views/Tools/Tool4View.axaml.cs new file mode 100644 index 000000000..f4c6182fd --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool4View.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace DockReactiveUIFlatSample.Views.Tools; + +public partial class Tool4View : UserControl +{ + public Tool4View() + { + InitializeComponent(); + } +} diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool5View.axaml b/samples/DockReactiveUIFlatSample/Views/Tools/Tool5View.axaml new file mode 100644 index 000000000..3b51e3aff --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool5View.axaml @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool5View.axaml.cs b/samples/DockReactiveUIFlatSample/Views/Tools/Tool5View.axaml.cs new file mode 100644 index 000000000..05b2359fb --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool5View.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace DockReactiveUIFlatSample.Views.Tools; + +public partial class Tool5View : UserControl +{ + public Tool5View() + { + InitializeComponent(); + } +} diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool6View.axaml b/samples/DockReactiveUIFlatSample/Views/Tools/Tool6View.axaml new file mode 100644 index 000000000..2730107eb --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool6View.axaml @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool6View.axaml.cs b/samples/DockReactiveUIFlatSample/Views/Tools/Tool6View.axaml.cs new file mode 100644 index 000000000..75590d0e8 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool6View.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace DockReactiveUIFlatSample.Views.Tools; + +public partial class Tool6View : UserControl +{ + public Tool6View() + { + InitializeComponent(); + } +} diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool7View.axaml b/samples/DockReactiveUIFlatSample/Views/Tools/Tool7View.axaml new file mode 100644 index 000000000..b0c5e0435 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool7View.axaml @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool7View.axaml.cs b/samples/DockReactiveUIFlatSample/Views/Tools/Tool7View.axaml.cs new file mode 100644 index 000000000..53bf6f456 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool7View.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace DockReactiveUIFlatSample.Views.Tools; + +public partial class Tool7View : UserControl +{ + public Tool7View() + { + InitializeComponent(); + } +} diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool8View.axaml b/samples/DockReactiveUIFlatSample/Views/Tools/Tool8View.axaml new file mode 100644 index 000000000..3d45f9b9d --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool8View.axaml @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/samples/DockReactiveUIFlatSample/Views/Tools/Tool8View.axaml.cs b/samples/DockReactiveUIFlatSample/Views/Tools/Tool8View.axaml.cs new file mode 100644 index 000000000..dee50dee2 --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Tools/Tool8View.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace DockReactiveUIFlatSample.Views.Tools; + +public partial class Tool8View : UserControl +{ + public Tool8View() + { + InitializeComponent(); + } +} diff --git a/samples/DockReactiveUIFlatSample/Views/Views/DashboardView.axaml b/samples/DockReactiveUIFlatSample/Views/Views/DashboardView.axaml new file mode 100644 index 000000000..92d74e03b --- /dev/null +++ b/samples/DockReactiveUIFlatSample/Views/Views/DashboardView.axaml @@ -0,0 +1,25 @@ + + + + + + +