123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <?xml version="1.0" encoding="UTF-8"?>
- <ContentPage
- xmlns="http://xamarin.com/schemas/2014/forms"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- xmlns:material="clr-namespace:XF.Material.Forms.UI;assembly=XF.Material"
- x:Class="comal.timesheets.AssignmentList"
- xmlns:local="clr-namespace:comal.timesheets"
- xmlns:schedule="clr-namespace:Syncfusion.SfSchedule.XForms;assembly=Syncfusion.SfSchedule.XForms"
- >
- <ContentPage.Resources>
- <ResourceDictionary>
- <DataTemplate x:Key="DayViewAppointments">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <Frame Grid.ColumnSpan="2" Grid.RowSpan="2" BorderColor="Gray" Margin="1" CornerRadius="5" HasShadow="False" Background="{Binding Color}" />
- <Label Grid.Row="0" Grid.Column="0" Margin="5,2,0,0" FontAttributes="Bold" FontSize="Small" Text="{Binding Subject}" />
- <Image Grid.Row="0" Grid.Column="1" Margin="0,2,5,0" Source="gear" HeightRequest="32" WidthRequest="32" IsVisible="{Binding Completed}"/>
- <Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="5,0,2,5" FontSize="Small" Text="{Binding Notes}" />
- </Grid>
- </DataTemplate>
-
- <schedule:ScheduleAppointmentMapping x:Key="AppointmentMapping"
- IdMapping="Id"
- SubjectMapping="Subject"
- ColorMapping="Color"
- StartTimeMapping="StartTime"
- EndTimeMapping="EndTime"
- NotesMapping="Notes"
- TextColorMapping="TextColor"
- ResourceIdsMapping="ResourceIds"
- >
- </schedule:ScheduleAppointmentMapping>
-
- </ResourceDictionary>
- </ContentPage.Resources>
-
- <ContentPage.BindingContext>
- <local:AssignmentListDataModel x:Name="DataModel"/>
- </ContentPage.BindingContext>
-
- <NavigationPage.TitleView>
- <Grid Margin="0" Padding="0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
- <Label
- Grid.Column="0"
- x:Name="Title"
- Text="Assignments"
- VerticalOptions="Center"
- HorizontalOptions="Center"
- HorizontalTextAlignment="Center"
- TextColor="White"
- FontSize="Medium"
- FontAttributes="Bold"
- BackgroundColor="Transparent"/>
- <StackLayout
- Grid.Column="1"
- Orientation="Horizontal"
- x:Name="Buttons">
- <Image
- x:Name="SelectDate"
- Aspect="AspectFit"
- WidthRequest="30"
- HorizontalOptions="End"
- Margin="5,5,0,5">
-
- <Image.Source>
- <OnPlatform x:TypeArguments="ImageSource">
- <OnPlatform.Platforms>
- <On Platform="iOS" Value="calendar"/>
- <On Platform="Android" Value="calendar"/>
- </OnPlatform.Platforms>
- </OnPlatform>
- </Image.Source>
- <Image.GestureRecognizers>
- <TapGestureRecognizer Tapped="SelectedDate_Tapped"/>
- </Image.GestureRecognizers>
- </Image>
-
- <DatePicker x:Name="DatePicker" IsVisible="False" DateSelected="DatePicker_OnDateSelected" />
-
- <Image
- x:Name="SelectEmployees"
- Aspect="AspectFit"
- WidthRequest="30"
- HorizontalOptions="End"
- Margin="5">
-
- <Image.Source>
- <OnPlatform x:TypeArguments="ImageSource">
- <OnPlatform.Platforms>
- <On Platform="iOS" Value="user"/>
- <On Platform="Android" Value="user"/>
- </OnPlatform.Platforms>
- </OnPlatform>
- </Image.Source>
- <Image.GestureRecognizers>
- <TapGestureRecognizer Tapped="SelectEmployees_Tapped"/>
- </Image.GestureRecognizers>
- </Image>
-
- </StackLayout>
- </Grid>
- </NavigationPage.TitleView>
-
- <ContentPage.Content>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" x:Name="DayViewColumn"/>
- <ColumnDefinition Width="0" x:Name="TimeLineViewColumn"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <schedule:SfSchedule x:Name="DayView"
- Grid.Column="0"
- ScheduleView="DayView"
- HeaderHeight="0"
- ViewHeaderHeight="0"
- TimeInterval="60"
- Background="White"
- EnableNavigation="False"
- VerticalOptions="Fill"
- ShowResourceView="False"
- ResourceViewMode="Absolute"
- TimeIntervalHeight="150"
- AppointmentMapping="{StaticResource AppointmentMapping}"
- AppointmentTemplate="{StaticResource DayViewAppointments}"
- CellTapped="Schedule_OnCellTapped"
- CellLongPressed="Schedule_OnCellLongPressed"
- >
-
- <schedule:SfSchedule.DayViewSettings>
- <schedule:DayViewSettings TimeRulerSize="50"/>
- </schedule:SfSchedule.DayViewSettings>
-
- </schedule:SfSchedule>
-
- <schedule:SfSchedule x:Name="TimeLineView"
- Grid.Column="1"
- ScheduleView="TimelineView"
- HeaderHeight="0"
- ViewHeaderHeight="0"
- TimeInterval="60"
- Background="White"
- ShowResourceView="False"
- EnableNavigation="False"
- ResourceViewHeight="50"
- ResourceViewMode="Absolute"
- TimeIntervalHeight="150"
- AppointmentMapping="{StaticResource AppointmentMapping}"
- AppointmentTemplate="{StaticResource DayViewAppointments}"
- CellTapped="Schedule_OnCellTapped"
- CellLongPressed="Schedule_OnCellLongPressed"
- >
-
- <schedule:SfSchedule.TimelineViewSettings>
- <schedule:TimelineViewSettings AppointmentHeight="200"/>
- </schedule:SfSchedule.TimelineViewSettings>
-
- <schedule:SfSchedule.ResourceItemTemplate>
- <DataTemplate>
- <Grid >
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <Label Text="{Binding Name}" Margin="-100,-0,-100,0" FontSize="Micro" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Rotation="-90"/>
- </Grid>
- </DataTemplate>
- </schedule:SfSchedule.ResourceItemTemplate>
-
- </schedule:SfSchedule>
- </Grid>
- </ContentPage.Content>
- </ContentPage>
|