diff --git a/src/Dock.Model.ReactiveUI/Controls/DockDock.cs b/src/Dock.Model.ReactiveUI/Controls/DockDock.cs
index 20790e557..c7790d32b 100644
--- a/src/Dock.Model.ReactiveUI/Controls/DockDock.cs
+++ b/src/Dock.Model.ReactiveUI/Controls/DockDock.cs
@@ -1,7 +1,6 @@
using System.Runtime.Serialization;
using Dock.Model.Controls;
using Dock.Model.ReactiveUI.Core;
-using ReactiveUI;
namespace Dock.Model.ReactiveUI.Controls;
@@ -9,15 +8,18 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Docking panel dock.
///
[DataContract(IsReference = true)]
-public class DockDock : DockBase, IDockDock
-{
- private bool _lastChildFill = true;
+public partial class DockDock : DockBase, IDockDock
+{
+ ///
+ /// Initializes new instance of the class.
+ ///
+ public DockDock()
+ {
+ _lastChildFill = true;
+ }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public bool LastChildFill
- {
- get => _lastChildFill;
- set => this.RaiseAndSetIfChanged(ref _lastChildFill, value);
- }
-}
\ No newline at end of file
+ [Reactive]
+ public partial bool LastChildFill { get; set; }
+}
diff --git a/src/Dock.Model.ReactiveUI/Controls/Document.cs b/src/Dock.Model.ReactiveUI/Controls/Document.cs
index a0a82cf3a..8305a2f1f 100644
--- a/src/Dock.Model.ReactiveUI/Controls/Document.cs
+++ b/src/Dock.Model.ReactiveUI/Controls/Document.cs
@@ -8,6 +8,6 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Document.
///
[DataContract(IsReference = true)]
-public class Document : DockableBase, IDocument
+public partial class Document : DockableBase, IDocument
{
-}
\ No newline at end of file
+}
diff --git a/src/Dock.Model.ReactiveUI/Controls/DocumentDock.cs b/src/Dock.Model.ReactiveUI/Controls/DocumentDock.cs
index 0335fedb6..21cfa8a74 100644
--- a/src/Dock.Model.ReactiveUI/Controls/DocumentDock.cs
+++ b/src/Dock.Model.ReactiveUI/Controls/DocumentDock.cs
@@ -2,7 +2,6 @@
using System.Windows.Input;
using Dock.Model.Controls;
using Dock.Model.ReactiveUI.Core;
-using ReactiveUI;
namespace Dock.Model.ReactiveUI.Controls;
@@ -10,17 +9,12 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Document dock.
///
[DataContract(IsReference = true)]
-public class DocumentDock : DockBase, IDocumentDock
+public partial class DocumentDock : DockBase, IDocumentDock
{
- private bool _canCreateDocument;
-
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public bool CanCreateDocument
- {
- get => _canCreateDocument;
- set => this.RaiseAndSetIfChanged(ref _canCreateDocument, value);
- }
+ [Reactive]
+ public partial bool CanCreateDocument { get; set; }
///
[IgnoreDataMember]
diff --git a/src/Dock.Model.ReactiveUI/Controls/ProportionalDock.cs b/src/Dock.Model.ReactiveUI/Controls/ProportionalDock.cs
index 201b26533..c58f79d6b 100644
--- a/src/Dock.Model.ReactiveUI/Controls/ProportionalDock.cs
+++ b/src/Dock.Model.ReactiveUI/Controls/ProportionalDock.cs
@@ -2,7 +2,6 @@
using Dock.Model.Controls;
using Dock.Model.Core;
using Dock.Model.ReactiveUI.Core;
-using ReactiveUI;
namespace Dock.Model.ReactiveUI.Controls;
@@ -10,15 +9,10 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Proportional dock.
///
[DataContract(IsReference = true)]
-public class ProportionalDock : DockBase, IProportionalDock
+public partial class ProportionalDock : DockBase, IProportionalDock
{
- private Orientation _orientation;
-
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public Orientation Orientation
- {
- get => _orientation;
- set => this.RaiseAndSetIfChanged(ref _orientation, value);
- }
-}
\ No newline at end of file
+ [Reactive]
+ public partial Orientation Orientation { get; set; }
+}
diff --git a/src/Dock.Model.ReactiveUI/Controls/ProportionalDockSplitter.cs b/src/Dock.Model.ReactiveUI/Controls/ProportionalDockSplitter.cs
index 3d3bc47f9..8f13f9593 100644
--- a/src/Dock.Model.ReactiveUI/Controls/ProportionalDockSplitter.cs
+++ b/src/Dock.Model.ReactiveUI/Controls/ProportionalDockSplitter.cs
@@ -8,6 +8,6 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Proportional dock splitter.
///
[DataContract(IsReference = true)]
-public class ProportionalDockSplitter : DockableBase, IProportionalDockSplitter
+public partial class ProportionalDockSplitter : DockableBase, IProportionalDockSplitter
{
-}
\ No newline at end of file
+}
diff --git a/src/Dock.Model.ReactiveUI/Controls/RootDock.cs b/src/Dock.Model.ReactiveUI/Controls/RootDock.cs
index add74922e..146f512ca 100644
--- a/src/Dock.Model.ReactiveUI/Controls/RootDock.cs
+++ b/src/Dock.Model.ReactiveUI/Controls/RootDock.cs
@@ -12,98 +12,62 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Root dock.
///
[DataContract(IsReference = true)]
-public class RootDock : DockBase, IRootDock
+public partial class RootDock : DockBase, IRootDock
{
- private bool _isFocusableRoot = true;
- private IList? _hiddenDockables;
- private IList? _leftPinnedDockables;
- private IList? _rightPinnedDockables;
- private IList? _topPinnedDockables;
- private IList? _bottomPinnedDockables;
- private IToolDock? _pinnedDock;
- private IDockWindow? _window;
- private IList? _windows;
-
///
/// Initializes new instance of the class.
///
public RootDock()
{
+ _isFocusableRoot = true;
ShowWindows = ReactiveCommand.Create(() => _navigateAdapter.ShowWindows());
ExitWindows = ReactiveCommand.Create(() => _navigateAdapter.ExitWindows());
}
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public bool IsFocusableRoot
- {
- get => _isFocusableRoot;
- set => this.RaiseAndSetIfChanged(ref _isFocusableRoot, value);
- }
+ [Reactive]
+ public partial bool IsFocusableRoot { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public IList? HiddenDockables
- {
- get => _hiddenDockables;
- set => this.RaiseAndSetIfChanged(ref _hiddenDockables, value);
- }
+ [Reactive]
+ public partial IList? HiddenDockables { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public IList? LeftPinnedDockables
- {
- get => _leftPinnedDockables;
- set => this.RaiseAndSetIfChanged(ref _leftPinnedDockables, value);
- }
+ [Reactive]
+ public partial IList? LeftPinnedDockables { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public IList? RightPinnedDockables
- {
- get => _rightPinnedDockables;
- set => this.RaiseAndSetIfChanged(ref _rightPinnedDockables, value);
- }
+ [Reactive]
+ public partial IList? RightPinnedDockables { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public IList? TopPinnedDockables
- {
- get => _topPinnedDockables;
- set => this.RaiseAndSetIfChanged(ref _topPinnedDockables, value);
- }
+ [Reactive]
+ public partial IList? TopPinnedDockables { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public IList? BottomPinnedDockables
- {
- get => _bottomPinnedDockables;
- set => this.RaiseAndSetIfChanged(ref _bottomPinnedDockables, value);
- }
+ [Reactive]
+ public partial IList? BottomPinnedDockables { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public IToolDock? PinnedDock
- {
- get => _pinnedDock;
- set => this.RaiseAndSetIfChanged(ref _pinnedDock, value);
- }
+ [Reactive]
+ public partial IToolDock? PinnedDock { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public IDockWindow? Window
- {
- get => _window;
- set => this.RaiseAndSetIfChanged(ref _window, value);
- }
+ [Reactive]
+ public partial IDockWindow? Window { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public IList? Windows
- {
- get => _windows;
- set => this.RaiseAndSetIfChanged(ref _windows, value);
- }
+ [Reactive]
+ public partial IList? Windows { get; set; }
///
[IgnoreDataMember]
diff --git a/src/Dock.Model.ReactiveUI/Controls/Tool.cs b/src/Dock.Model.ReactiveUI/Controls/Tool.cs
index c279ff2dc..3ac23e492 100644
--- a/src/Dock.Model.ReactiveUI/Controls/Tool.cs
+++ b/src/Dock.Model.ReactiveUI/Controls/Tool.cs
@@ -8,6 +8,6 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Tool.
///
[DataContract(IsReference = true)]
-public class Tool : DockableBase, ITool, IDocument
+public partial class Tool : DockableBase, ITool, IDocument
{
-}
\ No newline at end of file
+}
diff --git a/src/Dock.Model.ReactiveUI/Controls/ToolDock.cs b/src/Dock.Model.ReactiveUI/Controls/ToolDock.cs
index eec63e192..60439564a 100644
--- a/src/Dock.Model.ReactiveUI/Controls/ToolDock.cs
+++ b/src/Dock.Model.ReactiveUI/Controls/ToolDock.cs
@@ -2,7 +2,6 @@
using Dock.Model.Controls;
using Dock.Model.Core;
using Dock.Model.ReactiveUI.Core;
-using ReactiveUI;
namespace Dock.Model.ReactiveUI.Controls;
@@ -10,42 +9,35 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Tool dock.
///
[DataContract(IsReference = true)]
-public class ToolDock : DockBase, IToolDock
+public partial class ToolDock : DockBase, IToolDock
{
- private Alignment _alignment = Alignment.Unset;
- private bool _isExpanded;
- private bool _autoHide = true;
- private GripMode _gripMode = GripMode.Visible;
-
- ///
- [DataMember(IsRequired = false, EmitDefaultValue = true)]
- public Alignment Alignment
+ ///
+ /// Initializes new instance of the class.
+ ///
+ public ToolDock()
{
- get => _alignment;
- set => this.RaiseAndSetIfChanged(ref _alignment, value);
+ _alignment = Alignment.Unset;
+ _autoHide = true;
+ _gripMode = GripMode.Visible;
}
+
+ ///
+ [DataMember(IsRequired = false, EmitDefaultValue = true)]
+ [Reactive]
+ public partial Alignment Alignment { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public bool IsExpanded
- {
- get => _isExpanded;
- set => this.RaiseAndSetIfChanged(ref _isExpanded, value);
- }
+ [Reactive]
+ public partial bool IsExpanded { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public bool AutoHide
- {
- get => _autoHide;
- set => this.RaiseAndSetIfChanged(ref _autoHide, value);
- }
+ [Reactive]
+ public partial bool AutoHide { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public GripMode GripMode
- {
- get => _gripMode;
- set => this.RaiseAndSetIfChanged(ref _gripMode, value);
- }
-}
\ No newline at end of file
+ [Reactive]
+ public partial GripMode GripMode { get; set; }
+}
diff --git a/src/Dock.Model.ReactiveUI/Core/DockBase.cs b/src/Dock.Model.ReactiveUI/Core/DockBase.cs
index 92be7c260..7d22cba62 100644
--- a/src/Dock.Model.ReactiveUI/Core/DockBase.cs
+++ b/src/Dock.Model.ReactiveUI/Core/DockBase.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.Reactive;
using System.Runtime.Serialization;
using System.Windows.Input;
using Dock.Model.Adapters;
@@ -11,16 +12,9 @@ namespace Dock.Model.ReactiveUI.Core;
/// Dock base class.
///
[DataContract(IsReference = true)]
-public abstract class DockBase : DockableBase, IDock
+public abstract partial class DockBase : DockableBase, IDock
{
internal readonly INavigateAdapter _navigateAdapter;
- private IList? _visibleDockables;
- private IDockable? _activeDockable;
- private IDockable? _defaultDockable;
- private IDockable? _focusedDockable;
- private DockMode _dock = DockMode.Center;
- private bool _isActive;
- private int _openedDockablesCount;
///
/// Initializes new instance of the class.
@@ -28,77 +22,61 @@ public abstract class DockBase : DockableBase, IDock
protected DockBase()
{
_navigateAdapter = new NavigateAdapter(this);
+ _dock = DockMode.Center;
GoBack = ReactiveCommand.Create(() => _navigateAdapter.GoBack());
GoForward = ReactiveCommand.Create(() => _navigateAdapter.GoForward());
Navigate = ReactiveCommand.Create
[DataContract(IsReference = true)]
-public class DockWindow : ReactiveObject, IDockWindow
+public partial class DockWindow : ReactiveObject, IDockWindow
{
private readonly IHostAdapter _hostAdapter;
- private string _id;
- private double _x;
- private double _y;
- private double _width;
- private double _height;
- private bool _topmost;
- private string _title;
- private IDockable? _owner;
- private IFactory? _factory;
- private IRootDock? _layout;
- private IHostWindow? _host;
///
/// Initializes new instance of the class.
@@ -37,91 +26,58 @@ public DockWindow()
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public string Id
- {
- get => _id;
- set => this.RaiseAndSetIfChanged(ref _id, value);
- }
+ [Reactive]
+ public partial string Id { get; set; }
///
[DataMember(IsRequired = true, EmitDefaultValue = true)]
- public double X
- {
- get => _x;
- set => this.RaiseAndSetIfChanged(ref _x, value);
- }
+ [Reactive]
+ public partial double X { get; set; }
///
[DataMember(IsRequired = true, EmitDefaultValue = true)]
- public double Y
- {
- get => _y;
- set => this.RaiseAndSetIfChanged(ref _y, value);
- }
+ [Reactive]
+ public partial double Y { get; set; }
///
[DataMember(IsRequired = true, EmitDefaultValue = true)]
- public double Width
- {
- get => _width;
- set => this.RaiseAndSetIfChanged(ref _width, value);
- }
+ [Reactive]
+ public partial double Width { get; set; }
///
[DataMember(IsRequired = true, EmitDefaultValue = true)]
- public double Height
- {
- get => _height;
- set => this.RaiseAndSetIfChanged(ref _height, value);
- }
+ [Reactive]
+ public partial double Height { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public bool Topmost
- {
- get => _topmost;
- set => this.RaiseAndSetIfChanged(ref _topmost, value);
- }
+ [Reactive]
+ public partial bool Topmost { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public string Title
- {
- get => _title;
- set => this.RaiseAndSetIfChanged(ref _title, value);
- }
+ [Reactive]
+ public partial string Title { get; set; }
///
[IgnoreDataMember]
- public IDockable? Owner
- {
- get => _owner;
- set => this.RaiseAndSetIfChanged(ref _owner, value);
- }
+ [Reactive]
+ public partial IDockable? Owner { get; set; }
///
[IgnoreDataMember]
- public IFactory? Factory
- {
- get => _factory;
- set => this.RaiseAndSetIfChanged(ref _factory, value);
- }
+ [Reactive]
+ public partial IFactory? Factory { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public IRootDock? Layout
- {
- get => _layout;
- set => this.RaiseAndSetIfChanged(ref _layout, value);
- }
+ [Reactive]
+ public partial IRootDock? Layout { get; set; }
///
[IgnoreDataMember]
- public IHostWindow? Host
- {
- get => _host;
- set => this.RaiseAndSetIfChanged(ref _host, value);
- }
+ [Reactive]
+ public partial IHostWindow? Host { get; set; }
///
public virtual bool OnClose()
@@ -162,4 +118,4 @@ public void Exit()
{
_hostAdapter.Exit();
}
-}
\ No newline at end of file
+}
diff --git a/src/Dock.Model.ReactiveUI/Core/DockableBase.cs b/src/Dock.Model.ReactiveUI/Core/DockableBase.cs
index ec138b344..5e4d174da 100644
--- a/src/Dock.Model.ReactiveUI/Core/DockableBase.cs
+++ b/src/Dock.Model.ReactiveUI/Core/DockableBase.cs
@@ -9,125 +9,84 @@ namespace Dock.Model.ReactiveUI.Core;
/// Dockable base class.
///
[DataContract(IsReference = true)]
-public abstract class DockableBase : ReactiveObject, IDockable
+public abstract partial class DockableBase : ReactiveObject, IDockable
{
private readonly TrackingAdapter _trackingAdapter;
- private string _id = string.Empty;
- private string _title = string.Empty;
- private object? _context;
- private IDockable? _owner;
- private IDockable? _originalOwner;
- private IFactory? _factory;
- private bool _isEmpty;
- private bool _isCollapsable = true;
- private double _proportion = double.NaN;
- private bool _canClose = true;
- private bool _canPin = true;
- private bool _canFloat = true;
///
/// Initializes new instance of the class.
///
protected DockableBase()
{
+ _id = string.Empty;
+ _title = string.Empty;
+ _isCollapsable = true;
+ _proportion = double.NaN;
+ _canClose = true;
+ _canPin = true;
+ _canFloat = true;
_trackingAdapter = new TrackingAdapter();
}
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public string Id
- {
- get => _id;
- set => this.RaiseAndSetIfChanged(ref _id, value);
- }
+ [Reactive]
+ public partial string Id { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public string Title
- {
- get => _title;
- set => this.RaiseAndSetIfChanged(ref _title, value);
- }
+ [Reactive]
+ public partial string Title { get; set; }
///
[IgnoreDataMember]
- public object? Context
- {
- get => _context;
- set => this.RaiseAndSetIfChanged(ref _context, value);
- }
+ [Reactive]
+ public partial object? Context { get; set; }
///
[IgnoreDataMember]
- public IDockable? Owner
- {
- get => _owner;
- set => this.RaiseAndSetIfChanged(ref _owner, value);
- }
+ [Reactive]
+ public partial IDockable? Owner { get; set; }
///
[IgnoreDataMember]
- public IDockable? OriginalOwner
- {
- get => _originalOwner;
- set => this.RaiseAndSetIfChanged(ref _originalOwner, value);
- }
+ [Reactive]
+ public partial IDockable? OriginalOwner { get; set; }
///
[IgnoreDataMember]
- public IFactory? Factory
- {
- get => _factory;
- set => this.RaiseAndSetIfChanged(ref _factory, value);
- }
+ [Reactive]
+ public partial IFactory? Factory { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public bool IsEmpty
- {
- get => _isEmpty;
- set => this.RaiseAndSetIfChanged(ref _isEmpty, value);
- }
+ [Reactive]
+ public partial bool IsEmpty { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public bool IsCollapsable
- {
- get => _isCollapsable;
- set => this.RaiseAndSetIfChanged(ref _isCollapsable, value);
- }
+ [Reactive]
+ public partial bool IsCollapsable { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public double Proportion
- {
- get => _proportion;
- set => this.RaiseAndSetIfChanged(ref _proportion, value);
- }
+ [Reactive]
+ public partial double Proportion { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public bool CanClose
- {
- get => _canClose;
- set => this.RaiseAndSetIfChanged(ref _canClose, value);
- }
+ [Reactive]
+ public partial bool CanClose { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public bool CanPin
- {
- get => _canPin;
- set => this.RaiseAndSetIfChanged(ref _canPin, value);
- }
+ [Reactive]
+ public partial bool CanPin { get; set; }
///
[DataMember(IsRequired = false, EmitDefaultValue = true)]
- public bool CanFloat
- {
- get => _canFloat;
- set => this.RaiseAndSetIfChanged(ref _canFloat, value);
- }
+ [Reactive]
+ public partial bool CanFloat { get; set; }
///
public string? GetControlRecyclingId() => _id;
diff --git a/src/Dock.Model.ReactiveUI/Dock.Model.ReactiveUI.csproj b/src/Dock.Model.ReactiveUI/Dock.Model.ReactiveUI.csproj
index cac032f20..475312e61 100644
--- a/src/Dock.Model.ReactiveUI/Dock.Model.ReactiveUI.csproj
+++ b/src/Dock.Model.ReactiveUI/Dock.Model.ReactiveUI.csproj
@@ -7,6 +7,12 @@
enable
+
+ true
+ true
+ $(BaseIntermediateOutputPath)\GeneratedFiles
+
+
Dock.Model.ReactiveUI
@@ -21,4 +27,11 @@
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+