зеркало из https://github.com/telerik/xaml-sdk.git
202 строки
20 KiB
XML
202 строки
20 KiB
XML
<UserControl x:Class="AppointmentsReminders.Example"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
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"
|
|
mc:Ignorable="d"
|
|
xmlns:local="clr-namespace:AppointmentsReminders"
|
|
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
|
d:DesignHeight="300" d:DesignWidth="400">
|
|
|
|
<UserControl.Resources>
|
|
<telerik:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
|
<local:TimeSpanToStringConverter x:Key="TimeSpanToStringConverter"/>
|
|
|
|
<DataTemplate x:Key="AppointmentTemplate">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Path Data="M8.500001,1.7040509 C10.271389,1.8932999 11.66478,2.9541364 12.016057,4.4675074 C12.016057,4.4675074 13.081997,10.971431 14.244841,11.410886 C15.310781,11.674558 15.504589,12.289794 15.504589,12.289794 C15.504589,12.289794 16.08601,13.608157 15.989107,14.487065 C15.907345,15.006171 13.480021,15.525269 9.8712931,15.674813 L9.8477507,15.675737 L9.8205376,15.732287 C9.5401392,16.270744 9.4414282,17.710358 7.9418974,17.710358 C6.4492698,17.710358 6.3436561,16.270744 6.0632572,15.732287 L6.042625,15.689414 L5.8560977,15.682738 C2.2185407,15.544495 -5.6243032E-08,15.015784 0,14.487065 C-5.6243032E-08,13.608157 0.48451835,12.289794 0.48451823,12.289794 C0.48451835,12.289794 0.67832565,11.674558 1.6473625,11.410886 C2.6163993,11.059321 3.7792435,4.4675074 3.7792435,4.4675074 C3.8670626,3.5913453 4.8303266,1.9933451 7.1739092,1.7014208 z"
|
|
Fill="{telerik:Windows8Resource ResourceKey=MainBrush}"
|
|
Opacity="1" Margin="5 2 5 0"
|
|
Stretch="Fill" HorizontalAlignment="Left" Width="16" Height="16" VerticalAlignment="Center"
|
|
Visibility="{Binding Appointment.SelectedReminder, Converter={StaticResource NullToVisibilityConverter}}" />
|
|
<TextBlock Grid.Column="1" Text="{Binding Subject}" HorizontalAlignment="Left" VerticalAlignment="Center"
|
|
Foreground="{telerik:Windows8Resource ResourceKey=MainBrush}" FontFamily="Segoe UI" FontSize="12" TextWrapping="Wrap" Margin="3 0 10 0"/>
|
|
</Grid>
|
|
</DataTemplate>
|
|
|
|
<Style x:Key="SchedulerDialogStyle" TargetType="telerik:SchedulerDialog">
|
|
<Setter Property="Foreground" Value="{telerik:Windows8Resource ResourceKey=StrongBrush}" />
|
|
<Setter Property="Width" Value="560" />
|
|
<Setter Property="IsTabStop" Value="False" />
|
|
<Setter Property="Template" Value="{StaticResource EditAppointmentTemplate}" />
|
|
<Setter Property="HeaderTemplate">
|
|
<Setter.Value>
|
|
<DataTemplate>
|
|
<StackPanel Orientation="Horizontal" MaxWidth="400" HorizontalAlignment="Left">
|
|
<TextBlock telerik:LocalizationManager.ResourceKey="Event" Visibility="{Binding Occurrence.Appointment.IsAllDayEvent, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
|
<TextBlock telerik:LocalizationManager.ResourceKey="Appointment" Visibility="{Binding Occurrence.Appointment.IsAllDayEvent, Converter={StaticResource InvertedBooleanToVisibilityConverter}}" />
|
|
<TextBlock Text=" - " />
|
|
<TextBlock x:Name="SubjectTextBlock" Text="{Binding Occurrence.Appointment.Subject}" Visibility="{Binding Occurrence.Appointment.Subject, Converter={StaticResource NullToVisibilityConverter}}" />
|
|
<TextBlock telerik:LocalizationManager.ResourceKey="Untitled" Visibility="{Binding Occurrence.Appointment.Subject, Converter={StaticResource InvertedNullToVisibilityConverter}}" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="IconTemplate">
|
|
<Setter.Value>
|
|
<DataTemplate>
|
|
<Path Data="M8.500001,1.7040509 C10.271389,1.8932999 11.66478,2.9541364 12.016057,4.4675074 C12.016057,4.4675074 13.081997,10.971431 14.244841,11.410886 C15.310781,11.674558 15.504589,12.289794 15.504589,12.289794 C15.504589,12.289794 16.08601,13.608157 15.989107,14.487065 C15.907345,15.006171 13.480021,15.525269 9.8712931,15.674813 L9.8477507,15.675737 L9.8205376,15.732287 C9.5401392,16.270744 9.4414282,17.710358 7.9418974,17.710358 C6.4492698,17.710358 6.3436561,16.270744 6.0632572,15.732287 L6.042625,15.689414 L5.8560977,15.682738 C2.2185407,15.544495 -5.6243032E-08,15.015784 0,14.487065 C-5.6243032E-08,13.608157 0.48451835,12.289794 0.48451823,12.289794 C0.48451835,12.289794 0.67832565,11.674558 1.6473625,11.410886 C2.6163993,11.059321 3.7792435,4.4675074 3.7792435,4.4675074 C3.8670626,3.5913453 4.8303266,1.9933451 7.1739092,1.7014208 z"
|
|
Fill="{telerik:Windows8Resource ResourceKey=MainBrush}" Margin="6 2 6 0" Stretch="Fill"
|
|
HorizontalAlignment="Left" Width="16" Height="16" VerticalAlignment="Top" />
|
|
</DataTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="telerik:SchedulerDialog">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<telerik:RadToolBar x:Name="AppointmentToolbar" BorderThickness="0 0 0 1"
|
|
GripVisibility="Collapsed" Grid.Row="0" Margin="-1 0 -1 3">
|
|
<telerik:RadButton x:Name="EditRecurrenceButton" Command="telerik:RadScheduleViewCommands.EditRecurrenceRule"
|
|
Visibility="{Binding CanEditParentAppointment, Converter={StaticResource InvertedBooleanToVisibilityConverter}}">
|
|
<ToolTipService.ToolTip>
|
|
<ToolTip telerik:LocalizationManager.ResourceKey="EditRecurrence" />
|
|
</ToolTipService.ToolTip>
|
|
<TextBlock Margin="6 0" telerik:LocalizationManager.ResourceKey="EditRecurrence"
|
|
Foreground="{telerik:Windows8Resource ResourceKey=StrongBrush}" />
|
|
</telerik:RadButton>
|
|
<telerik:RadButton x:Name="EditParentAppointmentButton"
|
|
IsEnabled="{Binding IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}"
|
|
Command="telerik:RadScheduleViewCommands.EditParentAppointment"
|
|
Visibility="{Binding CanEditParentAppointment, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<ToolTipService.ToolTip>
|
|
<TextBlock telerik:LocalizationManager.ResourceKey="EditParentAppointment" />
|
|
</ToolTipService.ToolTip>
|
|
<TextBlock Margin="4 0" telerik:LocalizationManager.ResourceKey="EditParentAppointment"
|
|
Foreground="{telerik:Windows8Resource ResourceKey=StrongBrush}" />
|
|
</telerik:RadButton>
|
|
<telerik:RadToolBarSeparator />
|
|
<TextBlock x:Name="ShowAs" telerik:LocalizationManager.ResourceKey="ShowAs" Margin="6 0" VerticalAlignment="Center" Foreground="{telerik:Windows8Resource ResourceKey=StrongBrush}" />
|
|
<telerik:RadComboBox x:Name="PART_TimeMarkers" Margin="2 1" Width="110" IsEnabled="{Binding IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}" EmptyText="{Binding TimeMarkersEmptyText}" ItemsSource="{Binding TimeMarkers}" SelectedItem="{Binding Occurrence.Appointment.TimeMarker, Mode=TwoWay}" ClearSelectionButtonVisibility="Visible" ClearSelectionButtonContent="{Binding ClearSelectionButtonContent}" ItemTemplate="{StaticResource TimeMarkerComboBoxItemContentTemplate}" SelectionBoxTemplate="{StaticResource TimeMarkerComboBoxItemContentTemplate}" />
|
|
<telerik:RadComboBox x:Name="PART_Categories" Margin="2 1" Width="130" IsEnabled="{Binding IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}" EmptyText="{Binding CategoriesEmptyText}" ItemsSource="{Binding Categories}" SelectedItem="{Binding Occurrence.Appointment.Category, Mode=TwoWay}" ClearSelectionButtonVisibility="Visible" ClearSelectionButtonContent="{Binding ClearSelectionButtonContent}" ItemTemplate="{StaticResource CategoryComboBoxItemContentTemplate}" SelectionBoxTemplate="{StaticResource CategoryComboBoxItemContentTemplate}" />
|
|
<telerik:RadToggleButton x:Name="HighImportaceButton" Width="22" Height="22" IsEnabled="{Binding IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}" IsChecked="{Binding IsHighImportance, Mode=TwoWay}">
|
|
<ToolTipService.ToolTip>
|
|
<ToolTip telerik:LocalizationManager.ResourceKey="HighImportance" />
|
|
</ToolTipService.ToolTip>
|
|
<ContentControl x:Name="HighImportanceMark" Template="{StaticResource HighImportanceMarkTemplate}" Margin="2 1 1 0" Style="{StaticResource ImportanceMarkContentControlStyle}" />
|
|
</telerik:RadToggleButton>
|
|
<telerik:RadToggleButton x:Name="LowImportaceButton" Width="22" Height="22" IsEnabled="{Binding IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}" IsChecked="{Binding IsLowImportance, Mode=TwoWay}">
|
|
<ToolTipService.ToolTip>
|
|
<ToolTip telerik:LocalizationManager.ResourceKey="LowImportance" />
|
|
</ToolTipService.ToolTip>
|
|
<ContentControl x:Name="LowImportanceMark" Template="{StaticResource LowImportanceMarkTemplate}" Margin="2 1 1 0" Style="{StaticResource ImportanceMarkContentControlStyle}" />
|
|
</telerik:RadToggleButton>
|
|
|
|
<Path Data="M8.4179668,1.6766746 L8.5074997,1.6846194 C10.278888,1.8738685 11.66478,2.9541364 12.016057,4.4675074 C12.016057,4.4675074 13.081997,10.971431 14.244841,11.410886 C15.310781,11.674558 15.504589,12.289794 15.504589,12.289794 C15.504589,12.289794 16.08601,13.608157 15.989107,14.487065 C15.907345,15.006171 13.480021,15.525269 9.8712931,15.674813 L9.8477507,15.675737 L9.8205376,15.732287 C9.5401392,16.270744 9.4414282,17.710358 7.9418974,17.710358 C6.4492698,17.710358 6.3436561,16.270744 6.0632572,15.732287 L6.042625,15.689414 L5.8560977,15.682738 C2.2185407,15.544495 -5.6243032E-08,15.015784 0,14.487065 C-5.6243032E-08,13.608157 0.48451835,12.289794 0.48451823,12.289794 C0.48451835,12.289794 0.67832565,11.674558 1.6473625,11.410886 C2.6163993,11.059321 3.7792435,4.4675074 3.7792435,4.4675074 C3.8670626,3.5913453 4.8303266,1.9933451 7.1739092,1.7014208 L7.4179668,1.6763061 z"
|
|
Fill="{telerik:Windows8Resource ResourceKey=BasicBrush}" VerticalAlignment="Center" HorizontalAlignment="Right"
|
|
Stretch="Fill" Height="16" Width="16"
|
|
Visibility="{Binding ElementName=ReminderComboBox, Path=SelectedItem, Converter={StaticResource NullToVisibilityConverter}}" />
|
|
</telerik:RadToolBar>
|
|
<Border x:Name="AppointmentCategory" Grid.Row="1" Height="20" Margin="6 6" Background="{Binding SelectedItem.CategoryBrush, ElementName=PART_Categories}" Visibility="{Binding SelectedItem, ElementName=PART_Categories,Converter={StaticResource NullToVisibilityConverter}}">
|
|
<TextBlock Margin="6 0" Text="{Binding SelectedItem.DisplayName, ElementName=PART_Categories}" Foreground="{telerik:Windows8Resource ResourceKey=MainBrush}" VerticalAlignment="Center" />
|
|
</Border>
|
|
|
|
<Grid x:Name="Details" Grid.Row="2" Margin="6">
|
|
<Grid.Resources>
|
|
<telerik:InputMode x:Key="RadDateTimePickerInputModeDatePicker">DatePicker</telerik:InputMode>
|
|
</Grid.Resources>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition MinWidth="100" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Grid.Row="0" Grid.Column="0" Margin="6" telerik:LocalizationManager.ResourceKey="Subject" />
|
|
<TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Margin="3" IsReadOnly="{Binding IsReadOnly}" Text="{Binding Occurrence.Appointment.Subject, Mode=TwoWay}" />
|
|
|
|
<TextBlock Grid.Row="1" Grid.Column="0" Margin="6" telerik:LocalizationManager.ResourceKey="Body" />
|
|
<TextBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="3" Height="70" IsReadOnly="{Binding IsReadOnly}" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" VerticalScrollBarVisibility="Visible" Text="{Binding Occurrence.Appointment.Body, Mode=TwoWay}" TextWrapping="Wrap" />
|
|
|
|
<TextBlock Grid.Row="2" Grid.Column="0" Margin="6" telerik:LocalizationManager.ResourceKey="StartTime" />
|
|
|
|
<telerik:RadDateTimePicker Grid.Row="2" Grid.Column="1" Margin="3" IsReadOnly="{Binding IsReadOnly}" Culture="{Binding DefaultCulture,Source={StaticResource LocalizationManager}}" SelectedValue="{Binding ActualStart, Mode=TwoWay}" IsEnabled="{Binding IsNotRecurrent}" InputMode="{Binding IsAllDayEvent, Converter={StaticResource BoolToInputModeConverter}, ConverterParameter=telerik:InputMode.DatePicker}" />
|
|
<TextBlock Grid.Row="3" Grid.Column="0" Margin="6" VerticalAlignment="Center" telerik:LocalizationManager.ResourceKey="EndTime" />
|
|
|
|
<telerik:RadDateTimePicker Grid.Row="3" SelectedValue="{Binding ActualEnd, Mode=TwoWay}" Grid.Column="1" Margin="3" IsReadOnly="{Binding IsReadOnly}" Culture="{Binding DefaultCulture,Source={StaticResource LocalizationManager}}" IsEnabled="{Binding IsNotRecurrent}" InputMode="{Binding IsAllDayEvent, Converter={StaticResource BoolToInputModeConverter}, ConverterParameter=telerik:InputMode.DatePicker}" />
|
|
|
|
<CheckBox x:Name="AllDayEventCheckbox" Grid.Row="4" Grid.Column="1" Margin="3" VerticalAlignment="Center"
|
|
IsChecked="{Binding Path=IsAllDayEvent, Mode=TwoWay}" IsEnabled="{Binding IsNotRecurrent}"
|
|
telerik:LocalizationManager.ResourceKey="AllDayEvent" />
|
|
<TextBlock Text="Reminder" Grid.Row="5" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10"/>
|
|
<telerik:RadComboBox x:Name="ReminderComboBox" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center" ClearSelectionButtonContent="None"
|
|
ClearSelectionButtonVisibility="Visible" Margin="3" ItemsSource="{Binding AdditionalData.ReminderSource}"
|
|
SelectedItem="{Binding Occurrence.Appointment.SelectedReminder, Mode=TwoWay}">
|
|
<telerik:RadComboBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding ., Converter={StaticResource TimeSpanToStringConverter}}"/>
|
|
</DataTemplate>
|
|
</telerik:RadComboBox.ItemTemplate>
|
|
</telerik:RadComboBox>
|
|
</Grid>
|
|
|
|
<!-- Resource Editor -->
|
|
<Grid Grid.Row="3" Margin="3" Visibility="{Binding ResourceTypesVisibility}">
|
|
<ItemsControl x:Name="PART_Resources" Margin="3" IsTabStop="false" BorderBrush="{x:Null}" BorderThickness="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" IsEnabled="{Binding IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}" ItemsSource="{Binding ResourceTypes}" Visibility="{Binding ResourceTypesVisibility}" />
|
|
<TextBlock HorizontalAlignment="Center" Text="You can only change the resources by opening the series" Margin="3" Visibility="{Binding ResourceTypesVisibility, Converter={StaticResource InvertedVisibilityConverter}}" />
|
|
</Grid>
|
|
|
|
<StackPanel Grid.Row="4" Margin="13 6" HorizontalAlignment="Right" Orientation="Horizontal">
|
|
<telerik:RadButton Margin="2" MinWidth="84"
|
|
Command="telerik:WindowCommands.Confirm"
|
|
telerik:LocalizationManager.ResourceKey="Ok" telerik:RadWindow.ResponseButton="Accept" >
|
|
<ToolTipService.ToolTip>
|
|
<TextBlock telerik:LocalizationManager.ResourceKey="SaveAndClose" />
|
|
</ToolTipService.ToolTip>
|
|
</telerik:RadButton>
|
|
<telerik:RadButton Margin="2" MinWidth="84" Command="telerik:WindowCommands.Cancel"
|
|
telerik:LocalizationManager.ResourceKey="Cancel" telerik:RadWindow.ResponseButton="Cancel" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</UserControl.Resources>
|
|
<Grid x:Name="LayoutRoot" Background="White">
|
|
<telerik:RadScheduleView AppointmentsSource="{Binding Appointments}" x:Name="scheduleView"
|
|
SelectedAppointment="{Binding SelectedAppointment, Mode=TwoWay}"
|
|
DialogClosing="RadScheduleView_DialogClosing"
|
|
ShowDialog="RadScheduleView_ShowDialog"
|
|
AppointmentItemContentTemplate="{StaticResource AppointmentTemplate}"
|
|
EditAppointmentDialogStyle="{StaticResource SchedulerDialogStyle}">
|
|
<telerik:RadScheduleView.ViewDefinitions>
|
|
<telerik:DayViewDefinition/>
|
|
<telerik:MonthViewDefinition/>
|
|
<telerik:WeekViewDefinition/>
|
|
</telerik:RadScheduleView.ViewDefinitions>
|
|
</telerik:RadScheduleView>
|
|
</Grid>
|
|
</UserControl>
|