-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
75ffc13
commit 825b32a
Showing
36 changed files
with
3,338 additions
and
3,333 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
using Avalonia; | ||
using Avalonia.Controls.ApplicationLifetimes; | ||
using Avalonia.Markup.Xaml; | ||
|
||
using ReDocking.Views; | ||
|
||
namespace ReDocking; | ||
|
||
public partial class App : Application | ||
{ | ||
public override void Initialize() | ||
{ | ||
AvaloniaXamlLoader.Load(this); | ||
} | ||
|
||
public override void OnFrameworkInitializationCompleted() | ||
{ | ||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) | ||
{ | ||
desktop.MainWindow = new MainWindow(); | ||
} | ||
|
||
base.OnFrameworkInitializationCompleted(); | ||
} | ||
using Avalonia; | ||
using Avalonia.Controls.ApplicationLifetimes; | ||
using Avalonia.Markup.Xaml; | ||
|
||
using ReDocking.Views; | ||
|
||
namespace ReDocking; | ||
|
||
public partial class App : Application | ||
{ | ||
public override void Initialize() | ||
{ | ||
AvaloniaXamlLoader.Load(this); | ||
} | ||
|
||
public override void OnFrameworkInitializationCompleted() | ||
{ | ||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) | ||
{ | ||
desktop.MainWindow = new MainWindow(); | ||
} | ||
|
||
base.OnFrameworkInitializationCompleted(); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,21 +1,22 @@ | ||
using Avalonia; | ||
using System; | ||
|
||
namespace ReDocking; | ||
|
||
class Program | ||
{ | ||
// Initialization code. Don't use any Avalonia, third-party APIs or any | ||
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized | ||
// yet and stuff might break. | ||
[STAThread] | ||
public static void Main(string[] args) => BuildAvaloniaApp() | ||
.StartWithClassicDesktopLifetime(args); | ||
|
||
// Avalonia configuration, don't remove; also used by visual designer. | ||
public static AppBuilder BuildAvaloniaApp() | ||
=> AppBuilder.Configure<App>() | ||
.UsePlatformDetect() | ||
.WithInterFont() | ||
.LogToTrace(); | ||
using System; | ||
|
||
using Avalonia; | ||
|
||
namespace ReDocking; | ||
|
||
class Program | ||
{ | ||
// Initialization code. Don't use any Avalonia, third-party APIs or any | ||
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized | ||
// yet and stuff might break. | ||
[STAThread] | ||
public static void Main(string[] args) => BuildAvaloniaApp() | ||
.StartWithClassicDesktopLifetime(args); | ||
|
||
// Avalonia configuration, don't remove; also used by visual designer. | ||
public static AppBuilder BuildAvaloniaApp() | ||
=> AppBuilder.Configure<App>() | ||
.UsePlatformDetect() | ||
.WithInterFont() | ||
.LogToTrace(); | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
namespace ReDocking.ViewModels; | ||
|
||
public class DebugViewModel | ||
{ | ||
namespace ReDocking.ViewModels; | ||
|
||
public class DebugViewModel | ||
{ | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
namespace ReDocking.ViewModels; | ||
|
||
public class ExplorerViewModel | ||
{ | ||
namespace ReDocking.ViewModels; | ||
|
||
public class ExplorerViewModel | ||
{ | ||
} |
210 changes: 105 additions & 105 deletions
210
samples/ReDocking.Sample/ViewModels/MainWindowViewModel.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 |
---|---|---|
@@ -1,106 +1,106 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Reactive.Linq; | ||
|
||
using Reactive.Bindings; | ||
using Reactive.Bindings.Extensions; | ||
|
||
namespace ReDocking.ViewModels; | ||
|
||
public class MainWindowViewModel : IDisposable | ||
{ | ||
public MainWindowViewModel() | ||
{ | ||
void ConfigureToolsList(ReactiveCollection<ToolWindowViewModel> list, | ||
ReactiveProperty<ToolWindowViewModel?> selected) | ||
{ | ||
selected.Subscribe(x => | ||
list.ToObservable() | ||
.Where(y => y != x && y.DisplayMode.Value == DockableDisplayMode.Docked) | ||
.Subscribe(y => y.IsSelected.Value = false)); | ||
|
||
list.ObserveAddChanged() | ||
.Select(x => x.IsSelected.Select(y => (x, y))) | ||
.Subscribe(z => | ||
{ | ||
z.Subscribe(w => | ||
{ | ||
if (w is { y: true, x.DisplayMode.Value: DockableDisplayMode.Docked }) | ||
{ | ||
selected.Value = w.x; | ||
} | ||
else | ||
{ | ||
selected.Value = list.FirstOrDefault(xx => | ||
xx.IsSelected.Value && xx.DisplayMode.Value == DockableDisplayMode.Docked); | ||
} | ||
}); | ||
}); | ||
|
||
list.ObserveRemoveChanged() | ||
.Subscribe(x => x.Dispose()); | ||
} | ||
|
||
ConfigureToolsList(LeftUpperTopTools, SelectedLeftUpperTopTool); | ||
ConfigureToolsList(LeftUpperBottomTools, SelectedLeftUpperBottomTool); | ||
ConfigureToolsList(LeftLowerTopTools, SelectedLeftLowerTopTool); | ||
ConfigureToolsList(LeftLowerBottomTools, SelectedLeftLowerBottomTool); | ||
ConfigureToolsList(RightUpperTopTools, SelectedRightUpperTopTool); | ||
ConfigureToolsList(RightUpperBottomTools, SelectedRightUpperBottomTool); | ||
ConfigureToolsList(RightLowerTopTools, SelectedRightLowerTopTool); | ||
ConfigureToolsList(RightLowerBottomTools, SelectedRightLowerBottomTool); | ||
|
||
LeftUpperTopTools.Add(new ToolWindowViewModel("Search", "\ue721", new SearchViewModel())); | ||
LeftUpperBottomTools.Add(new ToolWindowViewModel("Explorer", "\uec50", new ExplorerViewModel())); | ||
LeftLowerBottomTools.Add(new ToolWindowViewModel("Debug", "\uebe8", new DebugViewModel())); | ||
RightUpperTopTools.Add(new ToolWindowViewModel("Notifications", "\uea8f", new NotificationsViewModel())); | ||
RightUpperBottomTools.Add(new ToolWindowViewModel("Properties", "\ue15e", new PropertiesViewModel())); | ||
RightLowerBottomTools.Add(new ToolWindowViewModel("Problem", "\ue946", new ProblemViewModel())); | ||
} | ||
|
||
public ReactiveCollection<ToolWindowViewModel> LeftUpperTopTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedLeftUpperTopTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> LeftUpperBottomTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedLeftUpperBottomTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> LeftLowerTopTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedLeftLowerTopTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> LeftLowerBottomTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedLeftLowerBottomTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> RightUpperTopTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedRightUpperTopTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> RightUpperBottomTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedRightUpperBottomTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> RightLowerTopTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedRightLowerTopTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> RightLowerBottomTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedRightLowerBottomTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> FloatingWindows { get; } = []; | ||
|
||
public void Dispose() | ||
{ | ||
SelectedLeftUpperTopTool.Dispose(); | ||
SelectedLeftUpperBottomTool.Dispose(); | ||
SelectedLeftLowerTopTool.Dispose(); | ||
SelectedLeftLowerBottomTool.Dispose(); | ||
SelectedRightUpperTopTool.Dispose(); | ||
SelectedRightUpperBottomTool.Dispose(); | ||
SelectedRightLowerTopTool.Dispose(); | ||
SelectedRightLowerBottomTool.Dispose(); | ||
} | ||
using System; | ||
using System.Linq; | ||
using System.Reactive.Linq; | ||
|
||
using Reactive.Bindings; | ||
using Reactive.Bindings.Extensions; | ||
|
||
namespace ReDocking.ViewModels; | ||
|
||
public class MainWindowViewModel : IDisposable | ||
{ | ||
public MainWindowViewModel() | ||
{ | ||
void ConfigureToolsList(ReactiveCollection<ToolWindowViewModel> list, | ||
ReactiveProperty<ToolWindowViewModel?> selected) | ||
{ | ||
selected.Subscribe(x => | ||
list.ToObservable() | ||
.Where(y => y != x && y.DisplayMode.Value == DockableDisplayMode.Docked) | ||
.Subscribe(y => y.IsSelected.Value = false)); | ||
|
||
list.ObserveAddChanged() | ||
.Select(x => x.IsSelected.Select(y => (x, y))) | ||
.Subscribe(z => | ||
{ | ||
z.Subscribe(w => | ||
{ | ||
if (w is { y: true, x.DisplayMode.Value: DockableDisplayMode.Docked }) | ||
{ | ||
selected.Value = w.x; | ||
} | ||
else | ||
{ | ||
selected.Value = list.FirstOrDefault(xx => | ||
xx.IsSelected.Value && xx.DisplayMode.Value == DockableDisplayMode.Docked); | ||
} | ||
}); | ||
}); | ||
|
||
list.ObserveRemoveChanged() | ||
.Subscribe(x => x.Dispose()); | ||
} | ||
|
||
ConfigureToolsList(LeftUpperTopTools, SelectedLeftUpperTopTool); | ||
ConfigureToolsList(LeftUpperBottomTools, SelectedLeftUpperBottomTool); | ||
ConfigureToolsList(LeftLowerTopTools, SelectedLeftLowerTopTool); | ||
ConfigureToolsList(LeftLowerBottomTools, SelectedLeftLowerBottomTool); | ||
ConfigureToolsList(RightUpperTopTools, SelectedRightUpperTopTool); | ||
ConfigureToolsList(RightUpperBottomTools, SelectedRightUpperBottomTool); | ||
ConfigureToolsList(RightLowerTopTools, SelectedRightLowerTopTool); | ||
ConfigureToolsList(RightLowerBottomTools, SelectedRightLowerBottomTool); | ||
|
||
LeftUpperTopTools.Add(new ToolWindowViewModel("Search", "\ue721", new SearchViewModel())); | ||
LeftUpperBottomTools.Add(new ToolWindowViewModel("Explorer", "\uec50", new ExplorerViewModel())); | ||
LeftLowerBottomTools.Add(new ToolWindowViewModel("Debug", "\uebe8", new DebugViewModel())); | ||
RightUpperTopTools.Add(new ToolWindowViewModel("Notifications", "\uea8f", new NotificationsViewModel())); | ||
RightUpperBottomTools.Add(new ToolWindowViewModel("Properties", "\ue15e", new PropertiesViewModel())); | ||
RightLowerBottomTools.Add(new ToolWindowViewModel("Problem", "\ue946", new ProblemViewModel())); | ||
} | ||
|
||
public ReactiveCollection<ToolWindowViewModel> LeftUpperTopTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedLeftUpperTopTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> LeftUpperBottomTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedLeftUpperBottomTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> LeftLowerTopTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedLeftLowerTopTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> LeftLowerBottomTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedLeftLowerBottomTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> RightUpperTopTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedRightUpperTopTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> RightUpperBottomTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedRightUpperBottomTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> RightLowerTopTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedRightLowerTopTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> RightLowerBottomTools { get; } = []; | ||
|
||
public ReactiveProperty<ToolWindowViewModel?> SelectedRightLowerBottomTool { get; } = new(); | ||
|
||
public ReactiveCollection<ToolWindowViewModel> FloatingWindows { get; } = []; | ||
|
||
public void Dispose() | ||
{ | ||
SelectedLeftUpperTopTool.Dispose(); | ||
SelectedLeftUpperBottomTool.Dispose(); | ||
SelectedLeftLowerTopTool.Dispose(); | ||
SelectedLeftLowerBottomTool.Dispose(); | ||
SelectedRightUpperTopTool.Dispose(); | ||
SelectedRightUpperBottomTool.Dispose(); | ||
SelectedRightLowerTopTool.Dispose(); | ||
SelectedRightLowerBottomTool.Dispose(); | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
samples/ReDocking.Sample/ViewModels/NotificationsViewModel.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
namespace ReDocking.ViewModels; | ||
|
||
public class NotificationsViewModel | ||
{ | ||
namespace ReDocking.ViewModels; | ||
|
||
public class NotificationsViewModel | ||
{ | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace ReDocking.ViewModels; | ||
|
||
public class ProblemViewModel | ||
{ | ||
namespace ReDocking.ViewModels; | ||
|
||
public class ProblemViewModel | ||
{ | ||
|
||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
namespace ReDocking.ViewModels; | ||
|
||
public class PropertiesViewModel | ||
{ | ||
namespace ReDocking.ViewModels; | ||
|
||
public class PropertiesViewModel | ||
{ | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace ReDocking.ViewModels; | ||
|
||
public class SearchViewModel | ||
{ | ||
namespace ReDocking.ViewModels; | ||
|
||
public class SearchViewModel | ||
{ | ||
|
||
} |
Oops, something went wrong.