90 lines
4.4 KiB
XML
90 lines
4.4 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:vm="using:Asistencia.ViewModels"
|
|
xmlns:models="using:Asistencia.Models"
|
|
x:Class="Asistencia.Views.DashboardView"
|
|
x:DataType="vm:DashboardViewModel">
|
|
|
|
<Design.DataContext>
|
|
<vm:DashboardViewModel />
|
|
</Design.DataContext>
|
|
|
|
<ScrollViewer>
|
|
<StackPanel Spacing="0" Margin="32,24">
|
|
|
|
<TextBlock Text="Panel Principal" Classes="page-header" />
|
|
|
|
<Border Classes="card" Margin="0,0,0,24">
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<StackPanel Grid.Column="0" Spacing="4">
|
|
<TextBlock Text="Bienvenido"
|
|
FontSize="14" Foreground="{DynamicResource TextSecondary}" />
|
|
<TextBlock Text="{Binding NombreProfesor}"
|
|
FontSize="24" FontWeight="Bold"
|
|
Foreground="{DynamicResource TextPrimary}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
|
|
<Button Content="Mi Perfil"
|
|
Command="{Binding AbrirPerfilCommand}"
|
|
Classes="secondary" />
|
|
<Button Content="Cerrar Sesion"
|
|
Command="{Binding CerrarSesionCommand}"
|
|
Classes="danger" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<TextBlock Text="Mis Cursos" Classes="section-title" Margin="0,0,0,12" />
|
|
|
|
<ItemsControl ItemsSource="{Binding Cursos}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate x:DataType="models:CursoAbierto">
|
|
<Border Classes="card" Margin="0,0,0,12">
|
|
<Grid ColumnDefinitions="*,Auto" RowDefinitions="Auto,Auto,Auto">
|
|
|
|
<TextBlock Grid.Row="0" Grid.Column="0"
|
|
Text="{Binding Curso.NombreCurso}"
|
|
FontSize="18" FontWeight="Bold"
|
|
Foreground="{DynamicResource TextPrimary}" />
|
|
|
|
<TextBlock Grid.Row="0" Grid.Column="1"
|
|
Text="{Binding Sala}"
|
|
FontSize="13"
|
|
Foreground="{DynamicResource TextSecondary}" />
|
|
|
|
<TextBlock Grid.Row="1" Grid.Column="0"
|
|
FontSize="13"
|
|
Foreground="{DynamicResource TextSecondary}"
|
|
Margin="0,4,0,0">
|
|
<TextBlock.Text>
|
|
<MultiBinding StringFormat="{}{0} | {1}">
|
|
<Binding Path="Sede" />
|
|
<Binding Path="HoraInicio" />
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
|
|
<Button Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
|
|
Content="Tomar Asistencia"
|
|
Classes="primary"
|
|
HorizontalAlignment="Left"
|
|
Margin="0,12,0,0"
|
|
Command="{Binding $parent[ItemsControl].((vm:DashboardViewModel)DataContext).AbrirAsistenciaCommand}"
|
|
CommandParameter="{Binding}" />
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
|
|
<Border Classes="card" Margin="0,24,0,0"
|
|
IsVisible="{Binding !Cursos.Count}"
|
|
Background="#FFF3CD">
|
|
<TextBlock Text="No tiene cursos asignados actualmente."
|
|
FontSize="14" Foreground="#856404" />
|
|
</Border>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</UserControl>
|