init commit

This commit is contained in:
Class_Student 2024-12-19 10:27:17 +03:00
parent a85b2c9da9
commit a3e8920712
50 changed files with 92 additions and 25 deletions

View File

@ -7,5 +7,7 @@
<Application.Styles> <Application.Styles>
<FluentTheme /> <FluentTheme />
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>
</Application.Styles> </Application.Styles>
</Application> </Application>

View File

@ -53,16 +53,19 @@ namespace Presence.Desktop.ViewModels
public ReactiveCommand<Unit, Unit> OnDeleteUserClicks { get; } public ReactiveCommand<Unit, Unit> OnDeleteUserClicks { get; }
public ReactiveCommand<Unit, Unit> EditUserCommand { get; } public ReactiveCommand<Unit, Unit> EditUserCommand { get; }
public ReactiveCommand<Unit, Unit> NextPageCommand { get; }
public ICommand RemoveAllStudentsCommand { get; } public ICommand RemoveAllStudentsCommand { get; }
public ICommand AddStudentCommand { get; } public ICommand AddStudentCommand { get; }
public GroupViewModel(IScreen screen, GroupUseCase groupUseCase) public GroupViewModel(IScreen screen, GroupUseCase groupUseCase)
{ {
_groupUseCase = groupUseCase; _groupUseCase = groupUseCase;
HostScreen = screen; HostScreen = screen;
HostScreen.Router.Navigate.Execute(new PresenceViewModel());
OnDeleteUserClicks = ReactiveCommand.Create(OnDeleteUserClick, this.WhenAnyValue(vm => vm.CanDelete)); OnDeleteUserClicks = ReactiveCommand.Create(OnDeleteUserClick, this.WhenAnyValue(vm => vm.CanDelete));
EditUserCommand = ReactiveCommand.Create(OnEditUserClick, this.WhenAnyValue(vm => vm.CanEdit)); EditUserCommand = ReactiveCommand.Create(OnEditUserClick, this.WhenAnyValue(vm => vm.CanEdit));
@ -85,6 +88,8 @@ namespace Presence.Desktop.ViewModels
this.RaisePropertyChanged(nameof(CanDelete)); this.RaisePropertyChanged(nameof(CanDelete));
this.RaisePropertyChanged(nameof(CanEdit)); this.RaisePropertyChanged(nameof(CanEdit));
}; };
NextPageCommand = ReactiveCommand.Create(NextPageButton);
} }
private void SetUsers() private void SetUsers()
@ -130,8 +135,20 @@ namespace Presence.Desktop.ViewModels
_groupUseCase.RemoveAllStudentsFromGroup(SelectedGroupItem.Id); _groupUseCase.RemoveAllStudentsFromGroup(SelectedGroupItem.Id);
SelectedGroupItem.users = new List<UserPresenter>(); SelectedGroupItem.users = new List<UserPresenter>();
SetUsers(); SetUsers();
} }
private void NextPageButton()
{
HostScreen.Router.Navigate.Execute(new PresenceViewModel());
}
private void AddStudent() private void AddStudent()
{ {
if (SelectedGroupItem == null) return; if (SelectedGroupItem == null) return;

View File

@ -1,4 +1,6 @@
using ReactiveUI; using ReactiveUI;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace Presence.Desktop.ViewModels; namespace Presence.Desktop.ViewModels;
@ -6,4 +8,30 @@ public class PresenceViewModel : ViewModelBase, IRoutableViewModel
{ {
public string? UrlPathSegment { get; } public string? UrlPathSegment { get; }
public IScreen HostScreen { get; } public IScreen HostScreen { get; }
public ObservableCollection<Person> People { get; }
public PresenceViewModel()
{
var people = new List<Person>
{
new Person("Neil", "Armstrong"),
new Person("Buzz", "Lightyear"),
new Person("James", "Kirk")
};
People = new ObservableCollection<Person>(people);
}
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public Person(string firstName, string lastName)
{
FirstName = firstName;
LastName = lastName;
}
}
} }

View File

@ -54,6 +54,10 @@
Command="{Binding AddStudentCommand}" Command="{Binding AddStudentCommand}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Width="250"/> Width="250"/>
<Button Content="Перейти на другую странцу"
Command="{Binding NextPageCommand}"
HorizontalAlignment="Center"
Width="250"/>
</StackPanel> </StackPanel>
<!-- Центральная панель для списка студентов --> <!-- Центральная панель для списка студентов -->

View File

@ -5,6 +5,8 @@ using Avalonia.ReactiveUI;
using Presence.Desktop.ViewModels; using Presence.Desktop.ViewModels;
using ReactiveUI; using ReactiveUI;
namespace Presence.Desktop.Views namespace Presence.Desktop.Views
{ {
public partial class GroupView : ReactiveUserControl<GroupViewModel> public partial class GroupView : ReactiveUserControl<GroupViewModel>
@ -21,6 +23,7 @@ namespace Presence.Desktop.Views
viewModel.OnDeleteUserClick(); viewModel.OnDeleteUserClick();
} }
private void OnEditUserClick(object sender, RoutedEventArgs e) private void OnEditUserClick(object sender, RoutedEventArgs e)
{ {
var viewModel = (GroupViewModel)DataContext; var viewModel = (GroupViewModel)DataContext;

View File

@ -2,7 +2,20 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:Presence.Desktop.ViewModels"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Presence.Desktop.Views.PresenceView"> x:Class="Presence.Desktop.Views.PresenceView"
</UserControl> x:DataType="vm:PresenceViewModel">
<DockPanel Background="White">
<!-- Верхняя панель с DataGrid -->
<DataGrid Margin="10" ItemsSource="{Binding People}"
HorizontalAlignment="Center"
AutoGenerateColumns="True" IsReadOnly="True"
GridLinesVisibility="All"
BorderThickness="1" BorderBrush="Gray">
</DataGrid>
</DockPanel>
</UserControl>

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Presence.Desktop")] [assembly: System.Reflection.AssemblyCompanyAttribute("Presence.Desktop")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+57da9f595adc9e04fc02459f82d5ab33106f3cc1")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a85b2c9da9ea4b346d13e58ae8eada305dc6f561")]
[assembly: System.Reflection.AssemblyProductAttribute("Presence.Desktop")] [assembly: System.Reflection.AssemblyProductAttribute("Presence.Desktop")]
[assembly: System.Reflection.AssemblyTitleAttribute("Presence.Desktop")] [assembly: System.Reflection.AssemblyTitleAttribute("Presence.Desktop")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
6626c11c76827858e921023ed7151541b66049467a7ca21ae7b4bca478e53d06 ca1b7e486f82334174e52b8caa2ad33557c6602a2571452f2e1f2d48678d23e0

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("console_ui")] [assembly: System.Reflection.AssemblyCompanyAttribute("console_ui")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+57da9f595adc9e04fc02459f82d5ab33106f3cc1")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a85b2c9da9ea4b346d13e58ae8eada305dc6f561")]
[assembly: System.Reflection.AssemblyProductAttribute("console_ui")] [assembly: System.Reflection.AssemblyProductAttribute("console_ui")]
[assembly: System.Reflection.AssemblyTitleAttribute("console_ui")] [assembly: System.Reflection.AssemblyTitleAttribute("console_ui")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
3583cd3ceba6f9d9364f72261d4b9b33a7c57a107e030a8e76a1a8f2bafd45a1 4ce6660b6a7021a0e28de37ccf4e56881e9c6d16aafc4b39886b2040c49ae905

Binary file not shown.

Binary file not shown.

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("data")] [assembly: System.Reflection.AssemblyCompanyAttribute("data")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+57da9f595adc9e04fc02459f82d5ab33106f3cc1")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a85b2c9da9ea4b346d13e58ae8eada305dc6f561")]
[assembly: System.Reflection.AssemblyProductAttribute("data")] [assembly: System.Reflection.AssemblyProductAttribute("data")]
[assembly: System.Reflection.AssemblyTitleAttribute("data")] [assembly: System.Reflection.AssemblyTitleAttribute("data")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
8d2d495a0c7f40589babe47a0a3473661f143114f2ab49b4078af1e3b85fe209 adc11d429c3bef1c9b3af949aa504568583ebc1924b1ffaec95a95c7bd34e503

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("domain")] [assembly: System.Reflection.AssemblyCompanyAttribute("domain")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+57da9f595adc9e04fc02459f82d5ab33106f3cc1")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a85b2c9da9ea4b346d13e58ae8eada305dc6f561")]
[assembly: System.Reflection.AssemblyProductAttribute("domain")] [assembly: System.Reflection.AssemblyProductAttribute("domain")]
[assembly: System.Reflection.AssemblyTitleAttribute("domain")] [assembly: System.Reflection.AssemblyTitleAttribute("domain")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
c4036d5bd8264457dad00c3e3b4ab541f1f2b4fc631d766cf78141a8d4368297 e2afd34a01255f96cbabfd4d69b4e764b119ba42cb5dd157aaa2f50827130423

Binary file not shown.

Binary file not shown.

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("presence_api")] [assembly: System.Reflection.AssemblyCompanyAttribute("presence_api")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+57da9f595adc9e04fc02459f82d5ab33106f3cc1")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a85b2c9da9ea4b346d13e58ae8eada305dc6f561")]
[assembly: System.Reflection.AssemblyProductAttribute("presence_api")] [assembly: System.Reflection.AssemblyProductAttribute("presence_api")]
[assembly: System.Reflection.AssemblyTitleAttribute("presence_api")] [assembly: System.Reflection.AssemblyTitleAttribute("presence_api")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
a4b811bfa5a1288299761bdb88f6a762b56ddc16d1d655a39e28d53972a6932f 77afe85cec6bc108d040d94456934b1a51ad19847430c31dd163733abb58c2e9

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("ui")] [assembly: System.Reflection.AssemblyCompanyAttribute("ui")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+57da9f595adc9e04fc02459f82d5ab33106f3cc1")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a85b2c9da9ea4b346d13e58ae8eada305dc6f561")]
[assembly: System.Reflection.AssemblyProductAttribute("ui")] [assembly: System.Reflection.AssemblyProductAttribute("ui")]
[assembly: System.Reflection.AssemblyTitleAttribute("ui")] [assembly: System.Reflection.AssemblyTitleAttribute("ui")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
6690d536df4991d027b0fbf2702ae19245b03d724e4967c9dfdddd2d2b14a968 93f4d6df5681dda0ea4e6f1072f8d2e77cc9c641d501c17bf3ef54452e626a27