From a85b2c9da9ea4b346d13e58ae8eada305dc6f561 Mon Sep 17 00:00:00 2001 From: Class_Student Date: Wed, 18 Dec 2024 11:42:44 +0300 Subject: [PATCH] init commit --- Presence.Desktop/App.axaml.cs | 1 - .../DI/ServiceCollectionExtensions.cs | 4 +- Presence.Desktop/ViewModels/GroupViewModel.cs | 13 +- .../ViewModels/MainWindowViewModel.cs | 11 +- Presence.Desktop/Views/GroupView.axaml | 183 ++++++------------ Presence.Desktop/Views/PresenceView.axaml | 4 +- .../bin/Debug/net8.0/Presence.Desktop.dll | Bin 224768 -> 228352 bytes .../bin/Debug/net8.0/Presence.Desktop.exe | Bin 143360 -> 143360 bytes .../bin/Debug/net8.0/Presence.Desktop.pdb | Bin 21456 -> 23388 bytes Presence.Desktop/bin/Debug/net8.0/data.dll | Bin 34304 -> 34304 bytes Presence.Desktop/bin/Debug/net8.0/data.pdb | Bin 19900 -> 19900 bytes Presence.Desktop/bin/Debug/net8.0/domain.dll | Bin 22016 -> 22016 bytes Presence.Desktop/bin/Debug/net8.0/domain.pdb | Bin 18340 -> 18340 bytes .../net8.0/Avalonia/Presence.Desktop.dll | Bin 224768 -> 228352 bytes .../net8.0/Avalonia/Presence.Desktop.pdb | Bin 21456 -> 23388 bytes .../obj/Debug/net8.0/Avalonia/resources | Bin 183571 -> 182494 bytes .../net8.0/Presence.Desktop.AssemblyInfo.cs | 2 +- .../Presence.Desktop.AssemblyInfoInputs.cache | 2 +- ...nce.Desktop.csproj.AssemblyReference.cache | Bin 33426 -> 33426 bytes ...nce.Desktop.csproj.CoreCompileInputs.cache | 2 +- ...esence.Desktop.csproj.FileListAbsolute.txt | 3 - .../obj/Debug/net8.0/Presence.Desktop.dll | Bin 206336 -> 207872 bytes .../obj/Debug/net8.0/Presence.Desktop.pdb | Bin 20124 -> 22176 bytes Presence.Desktop/obj/Debug/net8.0/apphost.exe | Bin 143360 -> 143360 bytes .../obj/Debug/net8.0/ref/Presence.Desktop.dll | Bin 10752 -> 11776 bytes .../refint/Avalonia/Presence.Desktop.dll | Bin 10752 -> 11776 bytes .../Debug/net8.0/refint/Presence.Desktop.dll | Bin 11264 -> 12288 bytes .../bin/Debug/net8.0/console_ui.deps.json | 15 +- console_ui/bin/Debug/net8.0/console_ui.dll | Bin 6144 -> 6144 bytes console_ui/bin/Debug/net8.0/console_ui.exe | Bin 138752 -> 142848 bytes console_ui/bin/Debug/net8.0/console_ui.pdb | Bin 12176 -> 12184 bytes console_ui/bin/Debug/net8.0/data.dll | Bin 31232 -> 34304 bytes console_ui/bin/Debug/net8.0/data.pdb | Bin 19080 -> 19900 bytes console_ui/bin/Debug/net8.0/domain.dll | Bin 19968 -> 22016 bytes console_ui/bin/Debug/net8.0/domain.pdb | Bin 17648 -> 18340 bytes console_ui/bin/Debug/net8.0/ui.dll | Bin 23040 -> 23040 bytes console_ui/bin/Debug/net8.0/ui.pdb | Bin 17312 -> 17320 bytes console_ui/obj/Debug/net8.0/apphost.exe | Bin 138752 -> 142848 bytes .../Debug/net8.0/console_ui.AssemblyInfo.cs | 2 +- .../console_ui.AssemblyInfoInputs.cache | 2 +- .../console_ui.csproj.AssemblyReference.cache | Bin 14468 -> 16451 bytes .../console_ui.csproj.CoreCompileInputs.cache | 2 +- console_ui/obj/Debug/net8.0/console_ui.dll | Bin 6144 -> 6144 bytes .../net8.0/console_ui.genruntimeconfig.cache | 2 +- console_ui/obj/Debug/net8.0/console_ui.pdb | Bin 12176 -> 12184 bytes .../obj/Debug/net8.0/ref/console_ui.dll | Bin 5120 -> 5120 bytes .../obj/Debug/net8.0/refint/console_ui.dll | Bin 5120 -> 5120 bytes data/bin/Debug/net8.0/data.dll | Bin 34304 -> 34304 bytes data/bin/Debug/net8.0/data.pdb | Bin 19900 -> 19900 bytes data/obj/Debug/net8.0/data.AssemblyInfo.cs | 2 +- .../net8.0/data.AssemblyInfoInputs.cache | 2 +- data/obj/Debug/net8.0/data.dll | Bin 34304 -> 34304 bytes data/obj/Debug/net8.0/data.pdb | Bin 19900 -> 19900 bytes data/obj/Debug/net8.0/ref/data.dll | Bin 14848 -> 14848 bytes data/obj/Debug/net8.0/refint/data.dll | Bin 14848 -> 14848 bytes domain/bin/Debug/net8.0/data.dll | Bin 34304 -> 34304 bytes domain/bin/Debug/net8.0/data.pdb | Bin 19900 -> 19900 bytes domain/bin/Debug/net8.0/domain.dll | Bin 22016 -> 22016 bytes domain/bin/Debug/net8.0/domain.pdb | Bin 18340 -> 18340 bytes .../obj/Debug/net8.0/domain.AssemblyInfo.cs | 2 +- .../net8.0/domain.AssemblyInfoInputs.cache | 2 +- .../domain.csproj.AssemblyReference.cache | Bin 14589 -> 14589 bytes domain/obj/Debug/net8.0/domain.dll | Bin 22016 -> 22016 bytes domain/obj/Debug/net8.0/domain.pdb | Bin 18340 -> 18340 bytes domain/obj/Debug/net8.0/ref/domain.dll | Bin 10240 -> 10240 bytes domain/obj/Debug/net8.0/refint/domain.dll | Bin 10240 -> 10240 bytes presence_api/bin/Debug/net8.0/data.dll | Bin 31232 -> 34304 bytes presence_api/bin/Debug/net8.0/data.pdb | Bin 19080 -> 19900 bytes presence_api/bin/Debug/net8.0/domain.dll | Bin 19968 -> 22016 bytes presence_api/bin/Debug/net8.0/domain.pdb | Bin 17648 -> 18340 bytes .../bin/Debug/net8.0/presence_api.deps.json | 10 +- .../bin/Debug/net8.0/presence_api.dll | Bin 13312 -> 13312 bytes .../bin/Debug/net8.0/presence_api.exe | Bin 138752 -> 142848 bytes .../bin/Debug/net8.0/presence_api.pdb | Bin 23140 -> 23148 bytes presence_api/obj/Debug/net8.0/apphost.exe | Bin 138752 -> 142848 bytes .../Debug/net8.0/presence_api.AssemblyInfo.cs | 2 +- .../presence_api.AssemblyInfoInputs.cache | 2 +- ...resence_api.csproj.AssemblyReference.cache | Bin 15825 -> 15825 bytes ...resence_api.csproj.CoreCompileInputs.cache | 2 +- .../obj/Debug/net8.0/presence_api.dll | Bin 13312 -> 13312 bytes .../presence_api.genruntimeconfig.cache | 2 +- .../obj/Debug/net8.0/presence_api.pdb | Bin 23140 -> 23148 bytes .../obj/Debug/net8.0/ref/presence_api.dll | Bin 7680 -> 7680 bytes .../obj/Debug/net8.0/refint/presence_api.dll | Bin 7680 -> 7680 bytes ui/bin/Debug/net8.0/data.dll | Bin 31232 -> 34304 bytes ui/bin/Debug/net8.0/data.pdb | Bin 19080 -> 19900 bytes ui/bin/Debug/net8.0/domain.dll | Bin 19968 -> 22016 bytes ui/bin/Debug/net8.0/domain.pdb | Bin 17648 -> 18340 bytes ui/bin/Debug/net8.0/ui.deps.json | 10 +- ui/bin/Debug/net8.0/ui.dll | Bin 23040 -> 23040 bytes ui/bin/Debug/net8.0/ui.pdb | Bin 17312 -> 17320 bytes ui/obj/Debug/net8.0/ref/ui.dll | Bin 6656 -> 6656 bytes ui/obj/Debug/net8.0/refint/ui.dll | Bin 6656 -> 6656 bytes ui/obj/Debug/net8.0/ui.AssemblyInfo.cs | 2 +- .../Debug/net8.0/ui.AssemblyInfoInputs.cache | 2 +- .../net8.0/ui.csproj.AssemblyReference.cache | Bin 14173 -> 15398 bytes .../net8.0/ui.csproj.CoreCompileInputs.cache | 2 +- ui/obj/Debug/net8.0/ui.dll | Bin 23040 -> 23040 bytes ui/obj/Debug/net8.0/ui.pdb | Bin 17312 -> 17320 bytes 99 files changed, 106 insertions(+), 184 deletions(-) diff --git a/Presence.Desktop/App.axaml.cs b/Presence.Desktop/App.axaml.cs index 20da721..ada6a44 100644 --- a/Presence.Desktop/App.axaml.cs +++ b/Presence.Desktop/App.axaml.cs @@ -26,7 +26,6 @@ namespace Presence.Desktop var services = serviceCollection.BuildServiceProvider(); - var mainViewModel = services.GetRequiredService(); var groupUseCase = services.GetRequiredService(); diff --git a/Presence.Desktop/DI/ServiceCollectionExtensions.cs b/Presence.Desktop/DI/ServiceCollectionExtensions.cs index 12a21ac..1fd5ad0 100644 --- a/Presence.Desktop/DI/ServiceCollectionExtensions.cs +++ b/Presence.Desktop/DI/ServiceCollectionExtensions.cs @@ -17,8 +17,6 @@ namespace Presence.Desktop.DI .AddSingleton() .AddSingleton() .AddSingleton() - .AddTransient() - .AddTransient(); - } + .AddTransient(); } } } \ No newline at end of file diff --git a/Presence.Desktop/ViewModels/GroupViewModel.cs b/Presence.Desktop/ViewModels/GroupViewModel.cs index e7c746d..3b10b0d 100644 --- a/Presence.Desktop/ViewModels/GroupViewModel.cs +++ b/Presence.Desktop/ViewModels/GroupViewModel.cs @@ -16,6 +16,11 @@ namespace Presence.Desktop.ViewModels { public class GroupViewModel : ViewModelBase, IRoutableViewModel { + + public string? UrlPathSegment { get; } + public IScreen HostScreen { get; } + + private readonly GroupUseCase _groupUseCase; private List groupPresentersDataSource = new List(); private ObservableCollection _groups; @@ -51,10 +56,13 @@ namespace Presence.Desktop.ViewModels public ICommand RemoveAllStudentsCommand { get; } public ICommand AddStudentCommand { get; } - public GroupViewModel(GroupUseCase groupUseCase) + public GroupViewModel(IScreen screen, GroupUseCase groupUseCase) { _groupUseCase = groupUseCase; + HostScreen = screen; + + HostScreen.Router.Navigate.Execute(new PresenceViewModel()); OnDeleteUserClicks = ReactiveCommand.Create(OnDeleteUserClick, this.WhenAnyValue(vm => vm.CanDelete)); EditUserCommand = ReactiveCommand.Create(OnEditUserClick, this.WhenAnyValue(vm => vm.CanEdit)); @@ -231,9 +239,8 @@ namespace Presence.Desktop.ViewModels } _groups = new ObservableCollection(groupPresentersDataSource); } - public string? UrlPathSegment { get; } - public IScreen HostScreen { get; } + } } \ No newline at end of file diff --git a/Presence.Desktop/ViewModels/MainWindowViewModel.cs b/Presence.Desktop/ViewModels/MainWindowViewModel.cs index 8449f0d..0326870 100644 --- a/Presence.Desktop/ViewModels/MainWindowViewModel.cs +++ b/Presence.Desktop/ViewModels/MainWindowViewModel.cs @@ -1,4 +1,5 @@ using System; +using domain.UseCase; using Microsoft.Extensions.DependencyInjection; using ReactiveUI; @@ -10,7 +11,13 @@ public class MainWindowViewModel : ViewModelBase, IScreen public MainWindowViewModel(IServiceProvider serviceProvider) { - var groupViewModel = serviceProvider.GetRequiredService(); - Router.Navigate.Execute(groupViewModel); + var groupUseCase = serviceProvider.GetRequiredService(); + + Router.Navigate.Execute(new GroupViewModel (this, groupUseCase)); + + } + + + } \ No newline at end of file diff --git a/Presence.Desktop/Views/GroupView.axaml b/Presence.Desktop/Views/GroupView.axaml index 854428d..0305dca 100644 --- a/Presence.Desktop/Views/GroupView.axaml +++ b/Presence.Desktop/Views/GroupView.axaml @@ -1,145 +1,82 @@ - + x:Class="Presence.Desktop.Views.GroupView" + x:DataType="vm:GroupViewModel"> - - - - - - - - - - - + + - - + - - - - - - + + + + + + - - + - - - - - - - + + + + + + + - - + -