| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <UserControl xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:viewModels="clr-namespace:PRS.Avalonia.Modules"
- xmlns:moduleGrid="clr-namespace:InABox.Avalonia.Components.ModuleGrid;assembly=InABox.Avalonia"
- xmlns:converters="clr-namespace:InABox.Avalonia.Converters;assembly=InABox.Avalonia"
- mc:Ignorable="d" d:DesignWidth="450" d:DesignHeight="1000"
- x:Class="PRS.Avalonia.Modules.HomePageView"
- x:DataType="viewModels:HomePageViewModel">
-
- <UserControl.Resources>
- <converters:BooleanToColorConverter x:Key="BooleanToColorConverter" True="{StaticResource PrsButtonBackground}" False="{StaticResource PrsAlertBackground}" />
- <converters:BooleanToStringConverter x:Key="BooleanToStringConverter" True="CLOCK OFF" False="CLOCK ON" />
- <converters:BooleanMatcher x:Key="BooleanMatcher" Comparison="EqualTo" Type="All" />
- </UserControl.Resources>
- <Grid
- RowDefinitions="200 Auto Auto *"
- ColumnDefinitions="* 100">
- <Button Classes="Standard"
- Grid.Row="0"
- Grid.Column="0"
- Grid.ColumnSpan="2"
- Padding="0"
- IsVisible="{Binding ClockOnVisible}"
- Background="{Binding IsClockedOn, Converter={StaticResource BooleanToColorConverter}}"
- Command="{Binding ClockOnCommand}"
- HorizontalContentAlignment="Stretch"
- VerticalContentAlignment="Stretch">
- <Button.IsEnabled>
- <MultiBinding Converter="{x:Static BoolConverters.And}">
- <Binding Path="DataReady" />
- <Binding Path="ClockOnLocation" Converter="{x:Static ObjectConverters.IsNotNull}" />
- </MultiBinding>
- </Button.IsEnabled>
-
- <Grid
- ColumnDefinitions="* Auto"
- RowDefinitions="* Auto"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch">
-
- <StackPanel
- Orientation="Vertical"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Grid.Row="0"
- Grid.Column="0"
- Grid.RowSpan="2"
- Grid.ColumnSpan="2">
-
- <Label
- FontSize="{StaticResource PrsFontSizeExtraLarge}"
- FontWeight="Bold"
- Content="{Binding IsClockedOn, Converter={StaticResource BooleanToStringConverter}}"
- HorizontalAlignment="Center"/>
-
- <Label
- FontSize="{StaticResource PrsFontSizeNormal}"
- FontWeight="DemiBold"
- Content="{Binding ClockOnLocation}"
- HorizontalAlignment="Center">
- <Label.IsVisible>
- <MultiBinding Converter = "{x:Static BoolConverters.And}">
- <Binding Path="IsClockedOn" Converter="{x:Static BoolConverters.Not}" />
- <Binding Path="ClockOnLocation" Converter="{x:Static StringConverters.IsNotNullOrEmpty}" />
- </MultiBinding>
- </Label.IsVisible>
- </Label>
-
- <Label
- FontSize="{StaticResource PrsFontSizeNormal}"
- FontWeight="DemiBold"
- Content="No Job Site Found"
- HorizontalAlignment="Center">
- <Label.IsVisible>
- <MultiBinding Converter="{x:Static BoolConverters.And}">
- <Binding Path="IsClockedOn" Converter="{x:Static BoolConverters.Not}" />
- <Binding Path="ClockOnLocation" Converter="{x:Static ObjectConverters.IsNull}" />
- <Binding Path="CurrentLocation" Converter="{x:Static ObjectConverters.IsNotNull}" />
- </MultiBinding>
- </Label.IsVisible>
- </Label>
-
- <Label
- FontSize="{StaticResource PrsFontSizeNormal}"
- FontWeight="DemiBold"
- Content="Missing/Invalid GPS Signal"
- IsVisible="{Binding CurrentLocation, Converter={x:Static ObjectConverters.IsNull}}"
- HorizontalAlignment="Center"/>
-
- </StackPanel>
-
- <ProgressBar
- Grid.Row="0"
- Grid.Column="1"
- Foreground="Black"
- Background="Transparent"
- Opacity="0.2"
- Maximum="{Binding GpsFrequency}"
- Value="{Binding GpsRemaining}"
- Orientation="Vertical"/>
-
- </Grid>
- </Button>
- <Border Classes="Standard"
- Grid.Row="0"
- Grid.Column="0"
- Grid.ColumnSpan="2"
- Padding="10"
- IsVisible="{Binding SplashVisible}">
- <Image Source="{SvgImage ../Images/badge.svg}" />
- </Border>
-
- <Button Classes="Standard"
- Grid.Row="1"
- Grid.Column="0"
- Content="{Binding Repositories.CurrentAssignment.JobDisplay, FallbackValue='Select Job'}"
- IsVisible="{Binding ClockOnVisible}"
- Background="{Binding IsClockedOn, Converter={StaticResource BooleanToColorConverter}}"
- Command="{Binding SelectJobCommand}">
- <Button.IsEnabled>
- <MultiBinding Converter="{x:Static BoolConverters.And}">
- <Binding Path="DataReady" />
- <Binding Path="IsClockedOn" />
- <Binding Path="CurrentLocation" Converter="{x:Static ObjectConverters.IsNotNull}" />
- </MultiBinding>
- </Button.IsEnabled>
- </Button>
-
- <Button Classes="Standard"
- Grid.Row="2"
- Grid.Column="0"
- Content="{Binding Repositories.CurrentAssignment.TaskDisplay, FallbackValue='Select Task'}"
- IsVisible="{Binding ClockOnVisible}"
- Background="{Binding IsClockedOn, Converter={StaticResource BooleanToColorConverter}}"
- Command="{Binding SelectTaskCommand}">
- <Button.IsEnabled>
- <MultiBinding Converter="{x:Static BoolConverters.And}">
- <Binding Path="DataReady" />
- <Binding Path="IsClockedOn" />
- </MultiBinding>
- </Button.IsEnabled>
- </Button>
-
- <Button Classes="Standard"
- Grid.Row="1"
- Grid.Column="1"
- Grid.RowSpan="2"
- Content="Add Note"
- IsVisible="{Binding ClockOnVisible}"
- Background="{Binding IsClockedOn, Converter={StaticResource BooleanToColorConverter}}"
- Command="{Binding TimeSheetNotesCommand}">
- <Button.IsEnabled>
- <MultiBinding Converter="{x:Static BoolConverters.And}">
- <Binding Path="DataReady" />
- <Binding Path="IsClockedOn" />
- </MultiBinding>
- </Button.IsEnabled>
- </Button>
- <ScrollViewer Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2"
- Margin="0">
- <moduleGrid:AvaloniaModuleGrid
- Margin="{StaticResource PrsControlSpacing}"
- Padding="0"
- BorderThickness="0"
- Modules="{Binding Modules}"/>
- </ScrollViewer>
- </Grid>
- </UserControl>
|