| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423 |
- <UserControl x:Class="PRSDesktop.Calendar"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:PRSDesktop"
- xmlns:wpf="clr-namespace:InABox.Wpf;assembly=InABox.Wpf"
- xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
- xmlns:dynamicGrid="clr-namespace:InABox.DynamicGrid;assembly=InABox.Wpf"
- xmlns:system="clr-namespace:System;assembly=System.Runtime.InteropServices"
- xmlns:classes="clr-namespace:Comal.Classes;assembly=PRSClasses"
- mc:Ignorable="d"
- d:DesignHeight="600" d:DesignWidth="800"
- x:Name="Main">
-
- <UserControl.Resources>
- <Style TargetType="syncfusion:TimeRulerCell">
- <Setter Property='VerticalContentAlignment' Value="Center" />
- </Style>
-
- <Style TargetType="syncfusion:AppointmentControl">
- <Setter Property="BorderBrush" Value="DimGray" />
- <Setter Property="SelectionBorderBrush" Value="Red"/>
- <Setter Property="BorderThickness" Value="0.75"/>
- <Setter Property="Margin" Value="0,0,-8,0"/>
- </Style>
-
- </UserControl.Resources>
-
- <dynamicGrid:DynamicSplitPanel
- x:Name="_splitPanel"
- Anchor="Detail"
- AnchorWidth="200"
- AllowableViews="Master"
- View="Master"
- DetailCaption="Settings"
- OnChanged="_splitPanel_OnOnChanged">
-
- <dynamicGrid:DynamicSplitPanel.Master>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <Border Grid.Row="0" Margin="0,0,0,2"
- CornerRadius="5,5,0,0"
- BorderThickness="0.75" BorderBrush="Gray"
- Background="WhiteSmoke"
- Padding="5"
- Visibility="{Binding HeaderVisibility}">
- <DockPanel LastChildFill="False">
- <Button DockPanel.Dock="Left"
- MinWidth="25" MinHeight="25"
- Margin="0,0,4,0"
- Click="Left_Click">
- <Polyline Points="6,0 0,6 6,12"
- Stroke="Black"
- StrokeThickness="1"/>
- </Button>
- <Button DockPanel.Dock="Left"
- MinWidth="25" MinHeight="25"
- Margin="0,0,4,0"
- Click="Right_Click">
- <Polyline Points="0,0 6,6 0,12"
- Stroke="Black"
- StrokeThickness="1"/>
- </Button>
- <DatePicker DockPanel.Dock="Left"
- SelectedDate="{Binding SelectedDate, Mode=TwoWay}"
- VerticalContentAlignment="Center"/>
- <Button DockPanel.Dock="Right"
- Content="Today"
- MinHeight="25"
- Margin="4,0,0,0" Padding="5"
- Click="Today_Click"/>
- </DockPanel>
- </Border>
- <Border Grid.Row="1" BorderBrush="LightGray" BorderThickness="1">
- <wpf:CalendarControl Name="CalendarControl"
- RowHeight="0"
- MinimumBlockHeight="10"
- MinimumColumnWidth="75"
- BlockClicked="Calendar_BlockClicked"
- BlockHeld="Calendar_BlockHeld"
- BlockRightClicked="Calendar_BlockRightClicked"
- ColumnWidthMode="ConstantColumns"
- ColumnMapping="{Binding Employee, Mode=TwoWay}"
- DateMapping="{Binding Date, Mode=TwoWay}"
- StartTimeMapping="{Binding StartTime, Mode=TwoWay}"
- EndTimeMapping="{Binding EndTime, Mode=TwoWay}"
- CanAdjustMapping="{Binding CanAdjust}">
- <wpf:CalendarControl.DateTemplate>
- <DataTemplate DataType="system:DateTime">
- <StackPanel Background="WhiteSmoke"
- Margin="0"
- VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
- Orientation="Vertical">
- <Label HorizontalContentAlignment="Center" VerticalContentAlignment="Bottom"
- FontSize="12" FontFamily="Arial" FontWeight="Bold"
- Foreground="Black"
- Margin="0,0,0,-5"
- Content="{Binding Converter={x:Static local:Calendar.DayOfWeekConverter}}"/>
- <Label HorizontalContentAlignment="Center" VerticalContentAlignment="Top"
- FontSize="10"
- ContentStringFormat="{}{0:dd MMM yy}"
- Content="{Binding}"/>
- </StackPanel>
- </DataTemplate>
- </wpf:CalendarControl.DateTemplate>
- <wpf:CalendarControl.HeaderTemplate>
- <DataTemplate DataType="{x:Type classes:Employee}">
- <Border Background="White"
- Height="50">
- <TextBlock VerticalAlignment="Center"
- HorizontalAlignment="Stretch"
- TextAlignment="Center"
- Tag="{Binding}"
- SizeChanged="TextBlock_SizeChanged"/>
- </Border>
- </DataTemplate>
- </wpf:CalendarControl.HeaderTemplate>
- <wpf:CalendarControl.ItemTemplate>
- <DataTemplate DataType="local:ICalendarAppointment">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="*"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <Border BorderBrush="{Binding BorderBrush}"
- Margin="2" CornerRadius="2"
- Grid.RowSpan="3"
- Background="{Binding Background}">
- <Border.Style>
- <Style TargetType="Border">
- <Setter Property="BorderThickness" Value="1"/>
- <Setter Property="Padding" Value="2"/>
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="BorderThickness" Value="2"/>
- <Setter Property="Padding" Value="1"/>
- </Trigger>
- </Style.Triggers>
- </Style>
- </Border.Style>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="20" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <DockPanel Grid.Row="0" Grid.Column="0">
- <Image Source="{Binding Image}"
- DockPanel.Dock="Right"
- VerticalAlignment="Center"/>
-
- <TextBlock Text="{Binding Subject}"
- Foreground="{Binding Foreground}"
- DockPanel.Dock="Left"
- VerticalAlignment="Center"
- FontWeight="DemiBold"/>
- </DockPanel>
- <TextBlock Grid.Row="1"
- Grid.Column="0"
- HorizontalAlignment="Left"
- Text="{Binding Notes}"
- TextWrapping="Wrap"
- Foreground="{Binding Foreground}"/>
- </Grid>
- <Border.ToolTip>
- <ToolTip>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" MaxWidth="200"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="20" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <TextBlock Grid.Row="0" Grid.Column="0"
- Text="{Binding Subject}"
- Foreground="{Binding Foreground}"
- DockPanel.Dock="Left"
- VerticalAlignment="Center"
- FontWeight="DemiBold"/>
- <TextBlock Grid.Row="1"
- Grid.Column="0"
- HorizontalAlignment="Left"
- Text="{Binding Notes}"
- TextWrapping="Wrap"
- Foreground="{Binding Foreground}"/>
- </Grid>
- </ToolTip>
- </Border.ToolTip>
- </Border>
- </Grid>
- </DataTemplate>
- </wpf:CalendarControl.ItemTemplate>
- </wpf:CalendarControl>
- </Border>
- </Grid>
- </dynamicGrid:DynamicSplitPanel.Master>
-
-
- <dynamicGrid:DynamicSplitPanel.Detail>
- <Grid>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
-
- <DockPanel
- Grid.Row="0"
- Grid.Column="0"
- Grid.ColumnSpan="2">
-
- <Button
- x:Name="_settingsButton"
- DockPanel.Dock="Left"
- Click="_settingsButton_OnClick"
- Background="WhiteSmoke"
- BorderBrush="Gray"
- BorderThickness="0.75"
- Height="25"
- Width="25"
- Padding="2">
- <Polygon Points="0,0 8,5, 0,10" Stroke="Gray" Fill="Silver" />
- </Button>
- <ComboBox
- x:Name="CalendarViewSelector"
- DockPanel.Dock="Left"
- SelectedValue="{Binding CalendarView}"
- VerticalContentAlignment="Center"
- SelectedIndex="-1"
- Margin="5,0,0,0"/>
- </DockPanel>
-
-
- <local:EmployeeSelector
- x:Name="EmployeeSelector"
- Grid.Row="1"
- Grid.Column="0"
- Grid.ColumnSpan="2"
- Margin="-5,5,0,0"
- SettingsChanged="EmployeeSelector_OnSettingsChanged"
- SelectionChanged="EmployeeSelector_OnSelectionChanged"/>
-
- <Label
- Grid.Row="2"
- Grid.Column="0"
- VerticalContentAlignment="Center"
- Margin="0,5,0,0"
- Content="Start" />
-
- <DockPanel
- Grid.Row="2"
- Grid.Column="1"
- Margin="5,5,0,0">
- <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
- BorderBrush="Gray" Click="StartTimeSelector_Down_Click">
- <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" Width="20" />
- </Button>
- <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
- BorderBrush="Gray" Click="StartTimeSelector_Up_Click">
- <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" Width="20" />
- </Button>
- <TextBox x:Name="StartTimeSelector" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
- BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
- </DockPanel>
- <Label
- Grid.Row="3"
- Grid.Column="0"
- VerticalContentAlignment="Center"
- Margin="0,5,0,0"
- Content="Finish"/>
-
- <DockPanel
- Grid.Row="3"
- Grid.Column="1"
- Margin="5,5,0,0">
- <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
- BorderBrush="Gray" Click="FinishTimeSelector_Down_Click">
- <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" Width="20" />
- </Button>
- <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
- BorderBrush="Gray" Click="FinishTimeSelector_Up_Click">
- <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" Width="20" />
- </Button>
- <TextBox x:Name="FinishTimeSelector" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
- BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
- </DockPanel>
-
- <Label
- Grid.Row="4"
- Grid.Column="0"
- VerticalContentAlignment="Center"
- Margin="0,5,0,0"
- Content="Assignments" />
-
- <ComboBox
- x:Name="AssignmentTypeSelector"
- Grid.Row="4"
- Grid.Column="1"
- SelectedIndex="1"
- Margin="5,5,0,0"
- SelectionChanged="AssignmentTypeSelector_OnSelectionChanged"
- VerticalContentAlignment="Center">
- <ComboBoxItem Content="Automatic" />
- <ComboBoxItem Content="Booked Time" />
- <ComboBoxItem Content="Actual Time" />
- </ComboBox>
-
- <Label
- Grid.Row="5"
- Grid.Column="0"
- VerticalContentAlignment="Center"
- Margin="0,5,0,0"
- Content="Background" />
-
- <ComboBox
- x:Name="BackgroundTypeSelector"
- Grid.Row="5"
- Grid.Column="1"
- SelectedIndex="1"
- Margin="5,5,0,0"
- SelectionChanged="BackgroundTypeSelector_OnSelectionChanged"
- VerticalContentAlignment="Center">
- <ComboBoxItem Content="Automatic" />
- <ComboBoxItem Content="Rosters" />
- <ComboBoxItem Content="Timesheets" />
- </ComboBox>
-
- <Label
- Grid.Row="6"
- Grid.Column="0"
- VerticalContentAlignment="Center"
- Margin="0,5,0,0"
- Content="Interval"/>
-
- <ComboBox
- x:Name="IntervalSelector"
- Grid.Row="6"
- Grid.Column="1"
- SelectedIndex="3"
- Margin="5,5,0,0"
- SelectionChanged="IntervalSelector_OnSelectionChanged"
- VerticalContentAlignment="Center">
- <ComboBoxItem Content="Five Minutes" />
- <ComboBoxItem Content="Six Minutes" />
- <ComboBoxItem Content="Ten Minutes" />
- <ComboBoxItem Content="Fifteen Minutes" />
- <ComboBoxItem Content="Twenty Minutes" />
- <ComboBoxItem Content="Thirty Minutes" />
- <ComboBoxItem Content="Sixty Minutes" />
- </ComboBox>
-
- <Label
- Grid.Row="7"
- Grid.Column="0"
- VerticalContentAlignment="Center"
- Margin="0,5,0,0"
- Content="Zoom"/>
-
- <DockPanel
- Grid.Row="7"
- Grid.Column="1"
- Margin="5,5,0,0">
- <Button DockPanel.Dock="Left" Padding="2" BorderThickness="0.75,0.75,0,0.75" Background="White"
- BorderBrush="Gray" Click="ZoomSelector_Down_Click">
- <Image Source="pack://application:,,,/Resources/leftarrow.png" Height="20" Width="20" />
- </Button>
- <Button DockPanel.Dock="Right" Padding="2" BorderThickness="0,0.75,0.75,0.75" Background="White"
- BorderBrush="Gray" Click="ZoomSelector_Up_Click">
- <Image Source="pack://application:,,,/Resources/rightarrow.png" Height="20" Width="20" />
- </Button>
- <TextBox x:Name="ZoomSelector" IsReadOnly="True" DockPanel.Dock="Left" BorderThickness="0,0.75,0,0.75"
- Text="100%"
- BorderBrush="Gray" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
- </DockPanel>
- <DockPanel Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2"
- Margin="0,5,0,0">
- <CheckBox DockPanel.Dock="Right"
- x:Name="AlwaysTodayBox"
- Checked="AlwaysTodayBox_Checked"
- Unchecked="AlwaysTodayBox_Checked"
- VerticalAlignment="Center"/>
- <Label Content="Always Start On Today" DockPanel.Dock="Left"
- VerticalContentAlignment="Center"/>
- </DockPanel>
- </Grid>
-
- </dynamicGrid:DynamicSplitPanel.Detail>
- </dynamicGrid:DynamicSplitPanel>
- </UserControl>
|