corp-app/CORP-MAUI/Pages/UsersPage.xaml

141 lines
6.2 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:models="clr-namespace:CORP_MAUI.Models"
x:Class="CORP_MAUI.Pages.UsersPage"
Title="Сотрудники">
<Grid RowDefinitions="Auto,*">
<!-- Поиск -->
<Border
Grid.Row="0"
Padding="15"
BackgroundColor="{StaticResource Gray100}">
<SearchBar
x:Name="SearchBar"
Placeholder="Поиск сотрудников..."
PlaceholderColor="{StaticResource Gray400}"
TextColor="{StaticResource Gray900}"
BackgroundColor="White"
TextChanged="OnSearchTextChanged"/>
</Border>
<!-- Список пользователей -->
<RefreshView
Grid.Row="1"
x:Name="RefreshView"
IsRefreshing="False"
Refreshing="OnRefreshing">
<CollectionView
x:Name="UsersCollectionView"
SelectionMode="Single"
SelectionChanged="OnUserSelected">
<CollectionView.EmptyView>
<VerticalStackLayout
VerticalOptions="Center"
HorizontalOptions="Center"
Padding="50">
<Label
Text="Нет доступных сотрудников"
FontSize="16"
TextColor="{StaticResource Gray600}"
HorizontalOptions="Center"/>
</VerticalStackLayout>
</CollectionView.EmptyView>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:User">
<Border
Padding="15"
Margin="10,5"
StrokeShape="RoundRectangle 10"
BackgroundColor="White"
Shadow="{Shadow Brush=Black, Opacity=0.2, Offset='0,2', Radius=4}">
<Grid ColumnDefinitions="60,*,Auto">
<!-- Аватар -->
<Border
Grid.Column="0"
WidthRequest="50"
HeightRequest="50"
StrokeShape="RoundRectangle 25"
Padding="0"
BackgroundColor="{StaticResource Gray200}">
<Grid>
<Image
Source="{Binding AvatarUrl}"
Aspect="AspectFill"/>
<!-- Индикатор онлайн статуса -->
<Border
WidthRequest="15"
HeightRequest="15"
StrokeShape="RoundRectangle 7.5"
Padding="0"
BackgroundColor="LimeGreen"
Stroke="White"
StrokeThickness="2"
VerticalOptions="End"
HorizontalOptions="End"
Margin="0,0,2,2"
IsVisible="{Binding IsOnline}"/>
</Grid>
</Border>
<!-- Информация о пользователе -->
<VerticalStackLayout
Grid.Column="1"
VerticalOptions="Center"
Spacing="3"
Margin="10,0">
<Label
Text="{Binding FullName}"
FontSize="16"
FontAttributes="Bold"
TextColor="{StaticResource Gray900}"/>
<Label
Text="{Binding PositionName}"
FontSize="13"
TextColor="{StaticResource Gray600}"/>
<Label
Text="{Binding DepartmentName}"
FontSize="12"
TextColor="{StaticResource Gray500}"/>
</VerticalStackLayout>
<!-- Стрелка -->
<Label
Grid.Column="2"
Text="›"
FontSize="30"
TextColor="{StaticResource Gray400}"
VerticalOptions="Center"/>
</Grid>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</RefreshView>
<!-- Индикатор загрузки -->
<ActivityIndicator
Grid.Row="1"
x:Name="LoadingIndicator"
IsRunning="False"
IsVisible="False"
Color="{StaticResource Primary}"
VerticalOptions="Center"
HorizontalOptions="Center"/>
</Grid>
</ContentPage>