Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ReactiveGenerator #375

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resources:
variables:
BuildConfiguration: 'Release'
BuildPlatform: 'Any CPU'
PublishFramework: 'net8.0'
PublishFramework: 'net9.0'
PublishProject: 'DockMvvmSample'
PublishRuntime: ''
Workloads: 'wasm-tools wasm-experimental'
Expand Down
3 changes: 2 additions & 1 deletion build/build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<IsPackable>False</IsPackable>
<NoWarn>CS0649;CS0169</NoWarn>
Expand All @@ -12,6 +12,7 @@

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="5.3.0" />
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/DockMvvmSample/DockMvvmSample.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<OutputType>WinExe</OutputType>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<IsPackable>False</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion samples/DockXamlSample/DockXamlSample.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<OutputType>WinExe</OutputType>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<IsPackable>False</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion samples/Notepad/Notepad.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<OutputType>WinExe</OutputType>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<IsPackable>False</IsPackable>
Expand Down
22 changes: 12 additions & 10 deletions src/Dock.Model.ReactiveUI/Controls/DockDock.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
using System.Runtime.Serialization;
using Dock.Model.Controls;
using Dock.Model.ReactiveUI.Core;
using ReactiveUI;

namespace Dock.Model.ReactiveUI.Controls;

/// <summary>
/// Docking panel dock.
/// </summary>
[DataContract(IsReference = true)]
public class DockDock : DockBase, IDockDock
{
private bool _lastChildFill = true;
public partial class DockDock : DockBase, IDockDock
{
/// <summary>
/// Initializes new instance of the <see cref="DockDock"/> class.
/// </summary>
public DockDock()
{
_lastChildFill = true;
}

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public bool LastChildFill
{
get => _lastChildFill;
set => this.RaiseAndSetIfChanged(ref _lastChildFill, value);
}
}
[Reactive]
public partial bool LastChildFill { get; set; }
}
4 changes: 2 additions & 2 deletions src/Dock.Model.ReactiveUI/Controls/Document.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Document.
/// </summary>
[DataContract(IsReference = true)]
public class Document : DockableBase, IDocument
public partial class Document : DockableBase, IDocument
{
}
}
12 changes: 3 additions & 9 deletions src/Dock.Model.ReactiveUI/Controls/DocumentDock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,19 @@
using System.Windows.Input;
using Dock.Model.Controls;
using Dock.Model.ReactiveUI.Core;
using ReactiveUI;

namespace Dock.Model.ReactiveUI.Controls;

/// <summary>
/// Document dock.
/// </summary>
[DataContract(IsReference = true)]
public class DocumentDock : DockBase, IDocumentDock
public partial class DocumentDock : DockBase, IDocumentDock
{
private bool _canCreateDocument;

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public bool CanCreateDocument
{
get => _canCreateDocument;
set => this.RaiseAndSetIfChanged(ref _canCreateDocument, value);
}
[Reactive]
public partial bool CanCreateDocument { get; set; }

/// <inheritdoc/>
[IgnoreDataMember]
Expand Down
14 changes: 4 additions & 10 deletions src/Dock.Model.ReactiveUI/Controls/ProportionalDock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@
using Dock.Model.Controls;
using Dock.Model.Core;
using Dock.Model.ReactiveUI.Core;
using ReactiveUI;

namespace Dock.Model.ReactiveUI.Controls;

/// <summary>
/// Proportional dock.
/// </summary>
[DataContract(IsReference = true)]
public class ProportionalDock : DockBase, IProportionalDock
public partial class ProportionalDock : DockBase, IProportionalDock
{
private Orientation _orientation;

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public Orientation Orientation
{
get => _orientation;
set => this.RaiseAndSetIfChanged(ref _orientation, value);
}
}
[Reactive]
public partial Orientation Orientation { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Proportional dock splitter.
/// </summary>
[DataContract(IsReference = true)]
public class ProportionalDockSplitter : DockableBase, IProportionalDockSplitter
public partial class ProportionalDockSplitter : DockableBase, IProportionalDockSplitter
{
}
}
76 changes: 20 additions & 56 deletions src/Dock.Model.ReactiveUI/Controls/RootDock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,98 +12,62 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Root dock.
/// </summary>
[DataContract(IsReference = true)]
public class RootDock : DockBase, IRootDock
public partial class RootDock : DockBase, IRootDock
{
private bool _isFocusableRoot = true;
private IList<IDockable>? _hiddenDockables;
private IList<IDockable>? _leftPinnedDockables;
private IList<IDockable>? _rightPinnedDockables;
private IList<IDockable>? _topPinnedDockables;
private IList<IDockable>? _bottomPinnedDockables;
private IToolDock? _pinnedDock;
private IDockWindow? _window;
private IList<IDockWindow>? _windows;

/// <summary>
/// Initializes new instance of the <see cref="RootDock"/> class.
/// </summary>
public RootDock()
{
_isFocusableRoot = true;
ShowWindows = ReactiveCommand.Create(() => _navigateAdapter.ShowWindows());
ExitWindows = ReactiveCommand.Create(() => _navigateAdapter.ExitWindows());
}

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public bool IsFocusableRoot
{
get => _isFocusableRoot;
set => this.RaiseAndSetIfChanged(ref _isFocusableRoot, value);
}
[Reactive]
public partial bool IsFocusableRoot { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IList<IDockable>? HiddenDockables
{
get => _hiddenDockables;
set => this.RaiseAndSetIfChanged(ref _hiddenDockables, value);
}
[Reactive]
public partial IList<IDockable>? HiddenDockables { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IList<IDockable>? LeftPinnedDockables
{
get => _leftPinnedDockables;
set => this.RaiseAndSetIfChanged(ref _leftPinnedDockables, value);
}
[Reactive]
public partial IList<IDockable>? LeftPinnedDockables { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IList<IDockable>? RightPinnedDockables
{
get => _rightPinnedDockables;
set => this.RaiseAndSetIfChanged(ref _rightPinnedDockables, value);
}
[Reactive]
public partial IList<IDockable>? RightPinnedDockables { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IList<IDockable>? TopPinnedDockables
{
get => _topPinnedDockables;
set => this.RaiseAndSetIfChanged(ref _topPinnedDockables, value);
}
[Reactive]
public partial IList<IDockable>? TopPinnedDockables { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IList<IDockable>? BottomPinnedDockables
{
get => _bottomPinnedDockables;
set => this.RaiseAndSetIfChanged(ref _bottomPinnedDockables, value);
}
[Reactive]
public partial IList<IDockable>? BottomPinnedDockables { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IToolDock? PinnedDock
{
get => _pinnedDock;
set => this.RaiseAndSetIfChanged(ref _pinnedDock, value);
}
[Reactive]
public partial IToolDock? PinnedDock { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IDockWindow? Window
{
get => _window;
set => this.RaiseAndSetIfChanged(ref _window, value);
}
[Reactive]
public partial IDockWindow? Window { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public IList<IDockWindow>? Windows
{
get => _windows;
set => this.RaiseAndSetIfChanged(ref _windows, value);
}
[Reactive]
public partial IList<IDockWindow>? Windows { get; set; }

/// <inheritdoc/>
[IgnoreDataMember]
Expand Down
4 changes: 2 additions & 2 deletions src/Dock.Model.ReactiveUI/Controls/Tool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ namespace Dock.Model.ReactiveUI.Controls;
/// Tool.
/// </summary>
[DataContract(IsReference = true)]
public class Tool : DockableBase, ITool, IDocument
public partial class Tool : DockableBase, ITool, IDocument
{
}
}
48 changes: 20 additions & 28 deletions src/Dock.Model.ReactiveUI/Controls/ToolDock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,42 @@
using Dock.Model.Controls;
using Dock.Model.Core;
using Dock.Model.ReactiveUI.Core;
using ReactiveUI;

namespace Dock.Model.ReactiveUI.Controls;

/// <summary>
/// Tool dock.
/// </summary>
[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;

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public Alignment Alignment
/// <summary>
/// Initializes new instance of the <see cref="ToolDock"/> class.
/// </summary>
public ToolDock()
{
get => _alignment;
set => this.RaiseAndSetIfChanged(ref _alignment, value);
_alignment = Alignment.Unset;
_autoHide = true;
_gripMode = GripMode.Visible;
}

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
[Reactive]
public partial Alignment Alignment { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public bool IsExpanded
{
get => _isExpanded;
set => this.RaiseAndSetIfChanged(ref _isExpanded, value);
}
[Reactive]
public partial bool IsExpanded { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public bool AutoHide
{
get => _autoHide;
set => this.RaiseAndSetIfChanged(ref _autoHide, value);
}
[Reactive]
public partial bool AutoHide { get; set; }

/// <inheritdoc/>
[DataMember(IsRequired = false, EmitDefaultValue = true)]
public GripMode GripMode
{
get => _gripMode;
set => this.RaiseAndSetIfChanged(ref _gripMode, value);
}
}
[Reactive]
public partial GripMode GripMode { get; set; }
}
Loading
Loading