This commit is contained in:
Thomas Peterson 2024-11-24 18:12:22 +01:00
parent 8f5a5ce95f
commit 7a11a59f7b
14 changed files with 170 additions and 8 deletions

View File

@ -13,6 +13,7 @@
<entry key="PSCHelpdesk/PSCHelpdesk/Toasts/Display/ToastNotification.axaml" value="PSCHelpdesk/PSCHelpdesk.Desktop/PSCHelpdesk.Desktop.csproj" />
<entry key="PSCHelpdesk/PSCHelpdesk/Views/ContentDisplay.axaml" value="PSCHelpdesk/PSCHelpdesk.Desktop/PSCHelpdesk.Desktop.csproj" />
<entry key="PSCHelpdesk/PSCHelpdesk/Views/ContentDisplayView.axaml" value="PSCHelpdesk/PSCHelpdesk.Browser/PSCHelpdesk.Browser.csproj" />
<entry key="PSCHelpdesk/PSCHelpdesk/Views/MainDockWindow.axaml" value="PSCHelpdesk/PSCHelpdesk.Desktop/PSCHelpdesk.Desktop.csproj" />
<entry key="PSCHelpdesk/PSCHelpdesk/Views/MainView.axaml" value="PSCHelpdesk/PSCHelpdesk.Desktop/PSCHelpdesk.Desktop.csproj" />
<entry key="PSCHelpdesk/PSCHelpdesk/Views/MainWindow.axaml" value="PSCHelpdesk/PSCHelpdesk.Desktop/PSCHelpdesk.Desktop.csproj" />
<entry key="PSCHelpdesk/PSCHelpdesk/Views/MenuItem.axaml" value="PSCHelpdesk/PSCHelpdesk.Desktop/PSCHelpdesk.Desktop.csproj" />

View File

@ -11,7 +11,13 @@
</component>
<component name="ChangeListManager">
<list default="true" id="95257dc5-08bd-4c50-8726-85956b3c2c92" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.PSCHelpdesk/.idea/avalonia.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.PSCHelpdesk/.idea/avalonia.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.PSCHelpdesk/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.PSCHelpdesk/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/PSCHelpdesk.sln.DotSettings.user" beforeDir="false" afterPath="$PROJECT_DIR$/PSCHelpdesk.sln.DotSettings.user" afterDir="false" />
<change beforePath="$PROJECT_DIR$/PSCHelpdesk/PSCHelpdesk/App.axaml" beforeDir="false" afterPath="$PROJECT_DIR$/PSCHelpdesk/PSCHelpdesk/App.axaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/PSCHelpdesk/PSCHelpdesk/App.axaml.cs" beforeDir="false" afterPath="$PROJECT_DIR$/PSCHelpdesk/PSCHelpdesk/App.axaml.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/PSCHelpdesk/PSCHelpdesk/PSCHelpdesk.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/PSCHelpdesk/PSCHelpdesk/PSCHelpdesk.csproj" afterDir="false" />
<change beforePath="$PROJECT_DIR$/PSCHelpdesk/PSCHelpdesk/Startup.cs" beforeDir="false" afterPath="$PROJECT_DIR$/PSCHelpdesk/PSCHelpdesk/Startup.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/_dist/hetzner/HetznerServer.dll" beforeDir="false" afterPath="$PROJECT_DIR$/_dist/hetzner/HetznerServer.dll" afterDir="false" />
<change beforePath="$PROJECT_DIR$/_dist/hetzner/HetznerServer.pdb" beforeDir="false" afterPath="$PROJECT_DIR$/_dist/hetzner/HetznerServer.pdb" afterDir="false" />
<change beforePath="$PROJECT_DIR$/_dist/nextcloud/Nextcloud.dll" beforeDir="false" afterPath="$PROJECT_DIR$/_dist/nextcloud/Nextcloud.dll" afterDir="false" />
@ -29,8 +35,8 @@
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="HighlightingSettingsPerFile">
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/8b4806d72c8e4cc3b55824ab34018d6a31600/9a/c689be08/StackDockGroup.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/fa3c59274a754721f822d1776be91c7ffdd37ff4219098396aa16ba1fc5447/Ioc.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="mock://C:/Users/info/RiderProjects/pschelpdesk/FastBill/Models/Customer.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/HetznerServer/ViewModels/ServerViewModel.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/HetznerServer/Views/ServerView.axaml" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/HetznerServer/Views/ServerView.axaml.cs" root0="FORCE_HIGHLIGHTING" />
@ -237,7 +243,9 @@
<workItem from="1731934744692" duration="8712000" />
<workItem from="1731959435583" duration="1827000" />
<workItem from="1732006290483" duration="15015000" />
<workItem from="1732088722904" duration="9503000" />
<workItem from="1732088722904" duration="10121000" />
<workItem from="1732263256084" duration="10035000" />
<workItem from="1732368344000" duration="2447000" />
</task>
<task id="LOCAL-00001" summary="Backup">
<option name="closed" value="true" />
@ -247,7 +255,15 @@
<option name="project" value="LOCAL" />
<updated>1732043807193</updated>
</task>
<option name="localTasksCounter" value="2" />
<task id="LOCAL-00002" summary="Backup">
<option name="closed" value="true" />
<created>1732211861006</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1732211861007</updated>
</task>
<option name="localTasksCounter" value="3" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">

View File

@ -68,6 +68,7 @@
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AServiceDescriptor_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Ff53745e7f6e85d65317047eeae9af151fe9aca1cb284d27e5c83962a50be46_003FServiceDescriptor_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AServiceProvider_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F9d4f4ac7db6d2c5d183ab2d92602280ed4349fd6e6a1b6313546b3d01fdab5_003FServiceProvider_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AServiceProvider_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F9d4f4ac7db6d2c5d183ab2d92602280ed4349fd6e6a1b6313546b3d01fdab5_003FServiceProvider_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AStackDockGroup_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F8b4806d72c8e4cc3b55824ab34018d6a31600_003F9a_003Fc689be08_003FStackDockGroup_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AString_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fdad3f0ebff0dd1f8e1d244c3c44c649be8228d5e25fb37ef1de7f3c0e261c_003FString_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AStyledElement_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fb06c2ce0981bf6e5989cda2e3e737e53c2d54ee6ae7e7ce318d378f52e5f66_003FStyledElement_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASyntaxOverride_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F3271b3ee9bab4ce68ae772afd9932ac39000_003Fe2_003F9f2554b7_003FSyntaxOverride_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>

View File

@ -13,6 +13,9 @@
<Application.Styles>
<materialIcons:MaterialIconStyles />
<FluentTheme/>
<StyleInclude Source="avares://NP.Ava.Visuals/Themes/TextStyles.axaml"/>
<StyleInclude Source="avares://NP.Ava.Visuals/Themes/CustomWindowStyles.axaml"/>
<StyleInclude Source="avares://NP.Ava.UniDock/Themes/DockStyles.axaml"/>
<StyleInclude Source="avares://PSCHelpdesk/LightTheme.axaml"/>
<Style Selector="Button.styleless">
<Setter Property="BorderThickness" Value="0"/>

View File

@ -22,16 +22,16 @@ public partial class App : Application
// Line below is needed to remove Avalonia data validation.
// Without this line you will get duplicate validations from both Avalonia and CT
BindingPlugins.DataValidators.RemoveAt(0);
desktop.MainWindow = new MainWindow
desktop.MainWindow = new MainDockWindow
{
DataContext = new MainWindowViewModel()
DataContext = new MainDockWindowViewModel()
};
}
else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform)
{
singleViewPlatform.MainView = new MainWindow
singleViewPlatform.MainView = new MainDockWindow
{
DataContext = new MainWindowViewModel()
DataContext = new MainDockWindowViewModel()
};
}

View File

@ -22,6 +22,7 @@
<PackageReference Include="Material.Icons.Avalonia" Version="2.1.10" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NP.Ava.UniDock" Version="1.0.16" />
</ItemGroup>
<ItemGroup>

View File

@ -1,5 +1,7 @@
using CommunityToolkit.Mvvm.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using NP.Ava.UniDock;
using NP.Ava.UniDock.Factories;
using Prise.DependencyInjection;
using Prise.Proxy;
using PSCHelpdesk.Converter;
@ -23,7 +25,8 @@ class Startup
var settingsService = new SettingsService();
var taskManager = new TaskManager();
var toastManager = new ToastManager();
var theDockManager = new DockManager();
var te = new ServiceCollection()
.AddSingleton<IUserInterfaceDispatchService, AvaloniaDispatcherService>()
.AddFactory<IResultConverter>(()=> new AvaloniaPluginResultConverter())
@ -31,9 +34,11 @@ class Startup
.AddSingleton<ISettingsManager>(settingsManager)
.AddSingleton<ISettingsService>(settingsService)
.AddSingleton<ITaskManager>(taskManager)
.AddSingleton<IStackGroupFactory, StackGroupFactory>()
.AddSingleton<IMenuService>(menuService)
.AddSingleton<ITestService>(new TestService())
.AddSingleton<PluginManager>()
.AddSingleton<DockManager>(theDockManager)
.AddSingleton<IToastManager>(toastManager)
.AddTransient<PluginListViewModel>();

View File

@ -0,0 +1,45 @@
using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.DependencyInjection;
using NP.Ava.UniDock;
using NP.Ava.UniDockService;
using PSCHelpdesk.Shared.ViewModels;
namespace PSCHelpdesk.ViewModels;
public class MainDockWindowViewModel : ViewModelBase, IViewModelBase
{
private DockManager _dockManager;
private ObservableCollection<DockItemViewModelBase> _vms;
public ObservableCollection<DockItemViewModelBase> VMs
{
get => _vms;
set => SetAndRaisePropertyChanged(ref _vms, value);
}
public DockManager DockManager => _dockManager;
public MainDockWindowViewModel()
{
Startup.RegisterServices();
VMs = new ObservableCollection<DockItemViewModelBase>();
_dockManager = Ioc.Default.GetService<DockManager>();
DockItemViewModelBase vm1 = new DockItemViewModelBase
{
DockId = "Tab1",
Header = "Tab1",
DefaultDockGroupId = "Group1",
DefaultDockOrderInGroup = 1,
Content = "Hello World!"
};
VMs.Add(vm1);
_dockManager.DockItemsViewModels = VMs;
}
}

View File

@ -0,0 +1,77 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:PSCHelpdesk.ViewModels"
xmlns:vs="clr-namespace:PSCHelpdesk.Shared.Menu;assembly=Shared"
xmlns:views="clr-namespace:PSCHelpdesk.Views"
xmlns:toasts="clr-namespace:PSCHelpdesk.Toasts."
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="PSCHelpdesk.Views.MainDockWindow"
Icon="/Assets/avalonia-logo.ico"
xmlns:np="https://np.com/visuals"
np:DockAttachedProperties.TheDockManager="{Binding DockManager}"
np:DockAttachedProperties.DockChildWindowOwner="{Binding RelativeSource={RelativeSource Mode=Self}}"
np:DockAttachedProperties.WindowId="TheMainWindow"
x:DataType="vm:MainDockWindowViewModel"
Title="PSCHelpdesk"
x:Name="MainWindowView">
<Design.DataContext><vm:MainDockWindowViewModel></vm:MainDockWindowViewModel></Design.DataContext>
<Window.Resources>
<!-- Define the dock manager-->
<np:DockManager x:Key="TheDockManager"/>
</Window.Resources>
<Window.Styles>
<StyleInclude Source="avares://NP.Ava.UniDock/Themes/DockStyles.axaml"/>
</Window.Styles>
<Grid RowDefinitions="Auto, *, Auto"
Margin="5">
<ListBox ItemsSource="{Binding DockManager}"
Height="70">
</ListBox>
<!-- top level group should reference the dock manager-->
<np:RootDockGroup TheDockManager="{StaticResource TheDockManager}"
Grid.Row="1">
<!-- Second Level group arranges the top and the bottom parts
vertically-->
<np:StackDockGroup TheOrientation="Vertical"
DockId="RootGroup">
<!-- top group arranges two top Dock Panes horizontally-->
<np:StackDockGroup TheOrientation="Horizontal"
IsStableGroup="True"
DockId="TopStackGroup">
<np:DockItem Header="Hi">
<TextBlock Text="Hi World!"/>
</np:DockItem>
<np:DockItem Header="Hello">
<TextBlock Text="Hello World!"/>
</np:DockItem>
</np:StackDockGroup>
<!-- Tabbed group at the bottom -->
<np:TabbedDockGroup IsStableGroup="True"
DockId="Tabs"/>
</np:StackDockGroup>
</np:RootDockGroup>
<StackPanel Orientation="Horizontal"
Grid.Row="2"
HorizontalAlignment="Right">
<Button x:Name="AddTabButton"
Content="AddTab"
Padding="10,5"
Margin="5"/>
<Button x:Name="SaveButton"
Content="Save"
Padding="10,5"
Margin="5"/>
<Button x:Name="RestoreButton"
Content="Restore"
Padding="10,5"
Margin="5"/>
</StackPanel>
</Grid>
</Window>

View File

@ -0,0 +1,13 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace PSCHelpdesk.Views;
public partial class MainDockWindow : Window
{
public MainDockWindow()
{
InitializeComponent();
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.