or
<
ResourceDictionary
xmlns
=
"http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:telerik
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
xmlns:local
=
"clr-namespace:CustomControl"
>
<
Style
TargetType
=
"{x:Type local:RadCustomBtn}"
>
<
Setter
Property
=
"BorderThickness"
Value
=
"0"
/>
<
Setter
Property
=
"BorderBrush"
Value
=
"#FF848484"
/>
<
Setter
Property
=
"Background"
>
<
Setter.Value
>
<
SolidColorBrush
Color
=
"#408AD2"
/>
</
Setter.Value
>
</
Setter
>
<
Setter
Property
=
"Foreground"
Value
=
"Black"
/>
<
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Center"
/>
<
Setter
Property
=
"VerticalContentAlignment"
Value
=
"Center"
/>
<
Setter
Property
=
"Padding"
Value
=
"3"
/>
<
Setter
Property
=
"CornerRadius"
Value
=
"0"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"{x:Type local:RadCustomBtn}"
>
<
Grid
SnapsToDevicePixels
=
"True"
>
<
VisualStateManager.VisualStateGroups
>
<
VisualStateGroup
x:Name
=
"CommonStates"
>
<
VisualState
x:Name
=
"Normal"
/>
<
VisualState
x:Name
=
"MouseOver"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"BorderBrush"
Storyboard.TargetName
=
"OuterBorder"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
SolidColorBrush
Color
=
"#408AD2"
/>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"Background"
Storyboard.TargetName
=
"InnerBorder"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
SolidColorBrush
Color
=
"#679ED2"
/>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"BorderBrush"
Storyboard.TargetName
=
"InnerBorder"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
SolidColorBrush
Color
=
"White"
/>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"Pressed"
>
<
Storyboard
>
<
DoubleAnimation
Duration
=
"0"
To
=
"0"
Storyboard.TargetProperty
=
"Opacity"
Storyboard.TargetName
=
"CommonStatesWrapper"
/>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"BorderBrush"
Storyboard.TargetName
=
"OuterBorder"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
SolidColorBrush
Color
=
"#408AD2"
/>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"Background"
Storyboard.TargetName
=
"InnerBorder"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
SolidColorBrush
Color
=
"#679ED2"
/>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"BorderBrush"
Storyboard.TargetName
=
"InnerBorder"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
SolidColorBrush
Color
=
"#408AD2"
/>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"Disabled"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Visibility"
Storyboard.TargetName
=
"disabledBorder"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
Visibility
>Visible</
Visibility
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
DoubleAnimation
Duration
=
"0"
To
=
"0.5"
Storyboard.TargetProperty
=
"Opacity"
Storyboard.TargetName
=
"Content"
/>
</
Storyboard
>
</
VisualState
>
</
VisualStateGroup
>
<
VisualStateGroup
x:Name
=
"BackgroundVisibility"
>
<
VisualState
x:Name
=
"BackgroundHidden"
>
<
Storyboard
>
<
DoubleAnimation
Duration
=
"0"
To
=
"0"
Storyboard.TargetProperty
=
"Opacity"
Storyboard.TargetName
=
"OuterBorder"
/>
<
DoubleAnimation
Duration
=
"0"
To
=
"0"
Storyboard.TargetProperty
=
"Opacity"
Storyboard.TargetName
=
"disabledBorder"
/>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"BackgroundVisible"
/>
</
VisualStateGroup
>
<
VisualStateGroup
x:Name
=
"FocusStatesGroup"
>
<
VisualState
x:Name
=
"Unfocused"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"Visibility"
Storyboard.TargetName
=
"FocusVisual"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0:0:0.15"
>
<
DiscreteObjectKeyFrame.Value
>
<
Visibility
>Collapsed</
Visibility
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
DoubleAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"Opacity"
Storyboard.TargetName
=
"FocusVisual"
>
<
LinearDoubleKeyFrame
KeyTime
=
"0:0:0.15"
Value
=
"0"
/>
</
DoubleAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Name
=
"Focused"
>
<
Storyboard
>
<
ObjectAnimationUsingKeyFrames
Duration
=
"0"
Storyboard.TargetProperty
=
"Visibility"
Storyboard.TargetName
=
"FocusVisual"
>
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
Visibility
>Visible</
Visibility
>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
DoubleAnimation
Duration
=
"0"
To
=
"1"
Storyboard.TargetProperty
=
"Opacity"
Storyboard.TargetName
=
"FocusVisual"
/>
</
Storyboard
>
</
VisualState
>
</
VisualStateGroup
>
</
VisualStateManager.VisualStateGroups
>
<
Border
x:Name
=
"OuterBorder"
BorderBrush
=
"{TemplateBinding BorderBrush}"
BorderThickness
=
"{TemplateBinding BorderThickness}"
CornerRadius
=
"{TemplateBinding CornerRadius}"
>
<
Border
x:Name
=
"InnerBorder"
BorderBrush
=
"White"
BorderThickness
=
"{TemplateBinding BorderThickness}"
Background
=
"{TemplateBinding Background}"
CornerRadius
=
"{TemplateBinding InnerCornerRadius}"
/>
</
Border
>
<
Border
x:Name
=
"disabledBorder"
BorderBrush
=
"Transparent"
BorderThickness
=
"{TemplateBinding BorderThickness}"
Background
=
"#FFE0E0E0"
CornerRadius
=
"{TemplateBinding CornerRadius}"
Visibility
=
"Collapsed"
/>
<!--<ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Style="{DynamicResource radButton_style_label}"/>-->
<
StackPanel
Orientation
=
"{TemplateBinding Orientation}"
HorizontalAlignment
=
"Center"
>
<
Viewbox
>
<
StackPanel
Width
=
"{TemplateBinding IconWidth}"
Height
=
"{TemplateBinding IconHeight}"
Visibility
=
"{TemplateBinding IconVisibility}"
>
<
ContentPresenter
x:Name
=
"Content"
ContentTemplate
=
"{TemplateBinding ContentTemplate}"
Content
=
"{TemplateBinding Icon}"
ContentStringFormat
=
"{TemplateBinding ContentStringFormat}"
HorizontalAlignment
=
"{TemplateBinding HorizontalContentAlignment}"
Margin
=
"{TemplateBinding Padding}"
RecognizesAccessKey
=
"True"
VerticalAlignment
=
"{TemplateBinding VerticalContentAlignment}"
Style
=
"{DynamicResource radButton_style_label}"
/>
</
StackPanel
>
</
Viewbox
>
<
StackPanel
Width
=
"auto"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Center"
Orientation
=
"Vertical"
>
<
TextBlock
Text
=
"{TemplateBinding Text}"
Foreground
=
"{TemplateBinding Foreground}"
FontSize
=
"40"
></
TextBlock
>
</
StackPanel
>
</
StackPanel
>
<
Border
x:Name
=
"CommonStatesWrapper"
>
<
Border
x:Name
=
"FocusVisual"
BorderBrush
=
"#FFFFFF"
BorderThickness
=
"1"
Background
=
"Transparent"
CornerRadius
=
"{TemplateBinding CornerRadius}"
Opacity
=
"0"
Visibility
=
"Collapsed"
>
<
Border
x:Name
=
"FocusInnerVisual"
BorderBrush
=
"Transparent"
BorderThickness
=
"1"
CornerRadius
=
"{TemplateBinding InnerCornerRadius}"
/>
</
Border
>
</
Border
>
</
Grid
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
</
ResourceDictionary
>
<telerik:RadScheduleView Grid.Row=
"1"
AppointmentsSource=
"{Binding LstAppointments}"
ResourceTypesSource=
"{Binding LstSchedulerHeaderOperations}"
CategoriesSource=
"{Binding Categories}"
CurrentDate=
"{Binding CurrentDate}"
SelectedSlot=
"{Binding SelectedSlot, Mode=TwoWay}"
Margin=
"10,20,10,10"
>
<telerik:RadScheduleView.ViewDefinitions>
<telerik:TimelineViewDefinition VisibleDays=
"65"
MajorTickLength=
"1day"
MinorTickLength=
"1day"
TimerulerMajorTickStringFormat=
"{}{0:dd}"
>
<telerik:TimelineViewDefinition.GroupTickLength>
<local:MonthlyTickProvider />
</telerik:TimelineViewDefinition.GroupTickLength>
</telerik:TimelineViewDefinition>
</telerik:RadScheduleView.ViewDefinitions>
<scheduleView:RadScheduleView.GroupDescriptionsSource>
<scheduleView:GroupDescriptionCollection>
<scheduleView:ResourceGroupDescription ResourceType=
"OP"
/>
<telerik:ResourceGroupDescription ResourceType=
"DETAIL"
/>
</scheduleView:GroupDescriptionCollection>
</scheduleView:RadScheduleView.GroupDescriptionsSource>
</telerik:RadScheduleView>
public
class
WeeklyTickProvider : DependencyObject, ITickProvider
{
public
static
readonly
DependencyProperty CurrentDateProperty =
DependencyProperty.Register(
"CurrentDate"
,
typeof
(DateTime),
typeof
(WeeklyTickProvider),
null
);
public
DateTime CurrentDate
{
get
{
return
(DateTime)GetValue(CurrentDateProperty); }
set
{ SetValue(CurrentDateProperty, value); }
}
public
static
readonly
DependencyProperty VisibleDaysProperty =
DependencyProperty.Register(
"VisibleDays"
,
typeof
(
int
),
typeof
(WeeklyTickProvider),
null
);
public
int
VisibleDays
{
get
{
return
(
int
)GetValue(VisibleDaysProperty); }
set
{ SetValue(VisibleDaysProperty, value); }
}
public
string
GetFormatString(IFormatProvider formatInfo,
string
formatString, DateTime currentStart)
{
var start = currentStart.Date;
var end =
this
.GetNextStart(TimeSpan.Zero
/*not used, see below*/
, currentStart).AddSeconds(-1);
if
(
this
.CurrentDate > start &&
this
.CurrentDate < end)
start =
this
.CurrentDate;
//var viewEnd = this.CurrentDate.AddDays(this.VisibleDays).AddSeconds(-1);
//if (viewEnd < end)
// end = viewEnd;
return
string
.Format(formatInfo,
"{0:dd/MMMM/yyyy} - {1:dd/MMMM/yyyy}"
, start, end);
}
public
DateTime GetNextStart(TimeSpan pixelLength, DateTime currentStart)
{
var currentDate = currentStart.Date;
var weekStart = CalendarHelper.GetFirstDayOfWeek(currentStart, DayOfWeek.Tuesday);
if
(weekStart == currentDate)
{
return
weekStart.AddDays(7);
}
return
weekStart;
}
}
public
class
MonthlyTickProvider : ITickProvider
{
public
string
GetFormatString(IFormatProvider formatInfo,
string
formatString, DateTime currentStart)
{
return
string
.Format(formatInfo,
"{0:MMMM - yyyy}"
, currentStart);
}
public
DateTime GetNextStart(TimeSpan pixelLength, DateTime currentStart)
{
var currentDate = currentStart.Date;
var monthStart = CalendarHelper.GetStartOfMonth(currentStart.Year, currentStart.Month);
if
(monthStart == currentDate)
{
return
monthStart.AddMonths(1);
}
return
monthStart;
}
}
private
void
OnDrop(
object
sender, Telerik.Windows.DragDrop.DragEventArgs args)
{
((IList)(sender
as
ListBox).ItemsSource).Add(args.Data);
}
<
UserControl
x:Class
=
"Infrastructure.Controls.ClosableTabItemHeader"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"300"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding Screen.DisplayName}"
FontWeight
=
"DemiBold"
/>
<
telerik:RadButton
Width
=
"14"
Height
=
"14"
Margin
=
"5,0,0,0"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Center"
Command
=
"{Binding Screen.CloseCommand}"
Padding
=
"0"
>
<
Image
Source
=
"pack://application:,,,/Resources;component/Glyphs/24/cross.png"
Height
=
"10"
Width
=
"10"
/>
</
telerik:RadButton
>
</
StackPanel
>
</
UserControl
>
<
telerik:RadTabItem.Header
>
<
Controls:ClosableTabItemHeader
DataContext
=
"{Binding}"
/>
</
telerik:RadTabItem.Header
>
MouseOver MouseMove event. The Problem is, it doesn't fire, no matter what I do. Is it a known bug or am I doing any thing wrong?
private
void
CatalogManageCategoriesProductsDataGrid_OnDragInitialize(
object
sender, DragInitializeEventArgs e)
{
ViewModels.DropIndicationDetails details =
new
ViewModels.DropIndicationDetails();
var GridViewItem = e.OriginalSource
as
GridViewRow ?? (e.OriginalSource
as
FrameworkElement).ParentOfType<GridViewRow>();
var data = GridViewItem !=
null
? GridViewItem.Item : (sender
as
RadGridView).SelectedItem;
var payload = DragDropPayloadManager.GeneratePayload(
null
);
details.CurrentDraggedItem = data;
payload.SetData(
"DraggedData"
, data);
payload.SetData(
"DropDetails"
, details);
e.Data = payload;
e.DragVisual =
new
DragVisual()
{
Content = details,
ContentTemplate = CatalogManageCategoriesProductsDataGrid.Resources[
"ProductDragTemplate"
]
as
DataTemplate
};
e.DragVisualOffset = e.RelativeStartPoint;
}