223 lines
11 KiB
XML
223 lines
11 KiB
XML
<?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:viewModels="clr-namespace:CORP_MAUI.ViewModels"
|
||
xmlns:models="clr-namespace:CORP_MAUI.Models"
|
||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||
x:Class="CORP_MAUI.Pages.ProfilePage"
|
||
x:DataType="viewModels:ProfileViewModel"
|
||
Title="Профиль"
|
||
BackgroundColor="White">
|
||
|
||
<Grid RowDefinitions="Auto,*">
|
||
|
||
<!-- Шапка -->
|
||
<Grid
|
||
Grid.Row="0"
|
||
ColumnDefinitions="50,*,50"
|
||
Padding="15,10"
|
||
BackgroundColor="White">
|
||
|
||
<!-- Пустое место слева -->
|
||
<BoxView Grid.Column="0" Color="Transparent"/>
|
||
|
||
<!-- Заголовок -->
|
||
<Label
|
||
Grid.Column="1"
|
||
Text="Мой профиль"
|
||
FontSize="18"
|
||
FontAttributes="Bold"
|
||
TextColor="{StaticResource Gray900}"
|
||
HorizontalOptions="Center"
|
||
VerticalOptions="Center"/>
|
||
|
||
<!-- Иконка настроек -->
|
||
<Border
|
||
Grid.Column="2"
|
||
WidthRequest="40"
|
||
HeightRequest="40"
|
||
StrokeShape="RoundRectangle 20"
|
||
BackgroundColor="Transparent"
|
||
Stroke="Transparent"
|
||
HorizontalOptions="End">
|
||
<Image
|
||
Source="settings.png"
|
||
WidthRequest="24"
|
||
HeightRequest="24"
|
||
HorizontalOptions="Center"
|
||
VerticalOptions="Center">
|
||
<Image.Behaviors>
|
||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||
</Image.Behaviors>
|
||
</Image>
|
||
</Border>
|
||
</Grid>
|
||
|
||
<!-- Контент -->
|
||
<ScrollView Grid.Row="1">
|
||
<VerticalStackLayout Padding="15" Spacing="15">
|
||
|
||
<ActivityIndicator
|
||
IsRunning="{Binding IsLoading}"
|
||
IsVisible="{Binding IsLoading}"
|
||
Color="{StaticResource Primary}"
|
||
HorizontalOptions="Center" />
|
||
|
||
<!-- Аватар и имя -->
|
||
<Border Style="{StaticResource CardBorderLarge}">
|
||
<VerticalStackLayout Spacing="15" HorizontalOptions="Center">
|
||
|
||
<!-- Аватар -->
|
||
<Border Style="{StaticResource AvatarXLarge}">
|
||
<Image
|
||
x:Name="ProfileAvatarImage"
|
||
Source="{Binding DisplayImageSource}"
|
||
Aspect="AspectFill"/>
|
||
</Border>
|
||
|
||
<!-- Имя -->
|
||
<Label
|
||
Text="{Binding FullName}"
|
||
Style="{StaticResource PageTitle}"/>
|
||
|
||
<!-- Должность -->
|
||
<Label
|
||
Text="{Binding Position}"
|
||
Style="{StaticResource CardText}"
|
||
FontSize="16"
|
||
HorizontalOptions="Center"/>
|
||
|
||
</VerticalStackLayout>
|
||
</Border>
|
||
|
||
<!-- Информация о пользователе -->
|
||
<Border Style="{StaticResource CardBorderLarge}">
|
||
<VerticalStackLayout Spacing="15">
|
||
|
||
<Label
|
||
Text="Информация"
|
||
Style="{StaticResource SectionTitle}"/>
|
||
|
||
<!-- Email -->
|
||
<Grid ColumnDefinitions="Auto,*" RowSpacing="12">
|
||
<HorizontalStackLayout Grid.Row="0" Grid.Column="0" Spacing="8">
|
||
<Image Source="email.png" WidthRequest="20" HeightRequest="20" VerticalOptions="Center">
|
||
<Image.Behaviors>
|
||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||
</Image.Behaviors>
|
||
</Image>
|
||
<Label Text="Email" Style="{StaticResource CardText}" FontAttributes="Bold" VerticalOptions="Center"/>
|
||
</HorizontalStackLayout>
|
||
<Label Grid.Row="0" Grid.Column="1" Text="{Binding Email}" Style="{StaticResource CardText}" HorizontalOptions="End" VerticalOptions="Center"/>
|
||
</Grid>
|
||
|
||
<BoxView HeightRequest="1" Color="{StaticResource Gray200}"/>
|
||
|
||
<!-- Телефон -->
|
||
<Grid ColumnDefinitions="Auto,*" IsVisible="{Binding HasPhone}">
|
||
<HorizontalStackLayout Grid.Column="0" Spacing="8">
|
||
<Image Source="phone.png" WidthRequest="20" HeightRequest="20" VerticalOptions="Center">
|
||
<Image.Behaviors>
|
||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||
</Image.Behaviors>
|
||
</Image>
|
||
<Label Text="Телефон" Style="{StaticResource CardText}" FontAttributes="Bold" VerticalOptions="Center"/>
|
||
</HorizontalStackLayout>
|
||
<Label Grid.Column="1" Text="{Binding Phone}" Style="{StaticResource CardText}" HorizontalOptions="End" VerticalOptions="Center"/>
|
||
</Grid>
|
||
|
||
<BoxView HeightRequest="1" Color="{StaticResource Gray200}" IsVisible="{Binding HasPhone}"/>
|
||
|
||
<!-- Отдел -->
|
||
<Grid ColumnDefinitions="Auto,*">
|
||
<HorizontalStackLayout Grid.Column="0" Spacing="8">
|
||
<Image Source="departments.png" WidthRequest="20" HeightRequest="20" VerticalOptions="Center">
|
||
<Image.Behaviors>
|
||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||
</Image.Behaviors>
|
||
</Image>
|
||
<Label Text="Отдел" Style="{StaticResource CardText}" FontAttributes="Bold" VerticalOptions="Center"/>
|
||
</HorizontalStackLayout>
|
||
<Label Grid.Column="1" Text="{Binding Department}" Style="{StaticResource CardText}" HorizontalOptions="End" VerticalOptions="Center"/>
|
||
</Grid>
|
||
|
||
</VerticalStackLayout>
|
||
</Border>
|
||
|
||
<!-- Все отделы (если несколько) -->
|
||
<Border Style="{StaticResource CardBorderLarge}" IsVisible="{Binding HasDepartments}">
|
||
<VerticalStackLayout Spacing="12">
|
||
|
||
<Label Text="Все отделы" Style="{StaticResource SectionTitle}"/>
|
||
|
||
<VerticalStackLayout BindableLayout.ItemsSource="{Binding Departments}" Spacing="8">
|
||
<BindableLayout.ItemTemplate>
|
||
<DataTemplate x:DataType="models:Department">
|
||
<HorizontalStackLayout Spacing="8">
|
||
<Image Source="departments.png" WidthRequest="16" HeightRequest="16" VerticalOptions="Center">
|
||
<Image.Behaviors>
|
||
<toolkit:IconTintColorBehavior TintColor="{StaticResource Primary}"/>
|
||
</Image.Behaviors>
|
||
</Image>
|
||
<Label Text="{Binding Name}" Style="{StaticResource CardText}" VerticalOptions="Center"/>
|
||
</HorizontalStackLayout>
|
||
</DataTemplate>
|
||
</BindableLayout.ItemTemplate>
|
||
</VerticalStackLayout>
|
||
|
||
</VerticalStackLayout>
|
||
</Border>
|
||
|
||
<!-- Навыки -->
|
||
<Border Style="{StaticResource CardBorderLarge}" IsVisible="{Binding HasSkills}">
|
||
<VerticalStackLayout Spacing="12">
|
||
|
||
<Label Text="Навыки" Style="{StaticResource SectionTitle}"/>
|
||
|
||
<FlexLayout BindableLayout.ItemsSource="{Binding Skills}" Wrap="Wrap" AlignItems="Center" AlignContent="Start">
|
||
<BindableLayout.ItemTemplate>
|
||
<DataTemplate x:DataType="models:Skill">
|
||
<Border
|
||
Padding="12,6"
|
||
Margin="0,0,8,8"
|
||
StrokeShape="RoundRectangle 15"
|
||
BackgroundColor="{StaticResource Gray200}"
|
||
Stroke="Transparent">
|
||
<Label Text="{Binding Name}" TextColor="{StaticResource Gray700}" FontSize="14"/>
|
||
</Border>
|
||
</DataTemplate>
|
||
</BindableLayout.ItemTemplate>
|
||
</FlexLayout>
|
||
|
||
</VerticalStackLayout>
|
||
</Border>
|
||
|
||
<!-- Действия -->
|
||
<Border Style="{StaticResource CardBorderLarge}">
|
||
<VerticalStackLayout Spacing="12">
|
||
|
||
<Label Text="Настройки" Style="{StaticResource SectionTitle}"/>
|
||
|
||
<Button
|
||
Text="Обновить профиль"
|
||
Style="{StaticResource PrimaryButton}"
|
||
Command="{Binding LoadProfileCommand}"/>
|
||
|
||
<Button
|
||
Text="Выйти"
|
||
BackgroundColor="{StaticResource Error}"
|
||
TextColor="White"
|
||
FontSize="16"
|
||
FontAttributes="Bold"
|
||
CornerRadius="10"
|
||
HeightRequest="50"
|
||
Command="{Binding LogoutCommand}"/>
|
||
|
||
</VerticalStackLayout>
|
||
</Border>
|
||
|
||
</VerticalStackLayout>
|
||
</ScrollView>
|
||
</Grid>
|
||
</ContentPage>
|