<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;
}
Hi,
I followed the instructions on the Telerik web page 'http://www.telerik.com/help/wpf/coded-ui-support.html' and copied the assembly Telerik.VisualStudio.TestTools.UITest.Extension.ExtensionsCore into the folder C:\Program Files (x86)\Common Files\Microsoft Shared\VSTT\11.0\UITestExtensionPackages. Then installed the assembley into GAC.
I am using VS 2012. When I try to use Coded UI Test Builder, it terminates with the following exception.
Application: CodedUITestBuilder.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.VisualStudio.TestTools.UITest.Extension.InvalidUITestExtensionPackageException
Stack:
at Microsoft.VisualStudio.TestTools.UITest.Framework.UITestExtensionPackageManager.LoadAssemblies(System.String[])
at Microsoft.VisualStudio.TestTools.UITest.Framework.UITestExtensionPackageManager..ctor()
at Microsoft.VisualStudio.TestTools.UITest.Framework.UITestService.Initialize()
at Microsoft.VisualStudio.TestTools.CodedUITest.Controls.CodedUITestBuilder.UITestBuilder.InitializeExtensions()
at Microsoft.VisualStudio.TestTools.CodedUITest.Controls.CodedUITestBuilder.UITestBuilder.WindowActivated(System.Object, System.EventArgs)
at System.Windows.Window.OnActivated(System.EventArgs)
at System.Windows.Window.HandleActivate(Boolean)
at System.Windows.Window.WmActivate(IntPtr)
at System.Windows.Window.WindowFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.ShowWindow(System.Runtime.InteropServices.HandleRef, Int32)
at System.Windows.Window.ShowHelper(System.Object)
at System.Windows.Window.Show()
at System.Windows.Application.<RunInternal>b__f(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at Microsoft.VisualStudio.TestTools.UITest.CodedUITest.CodedUITestBuilder.Program.Main(System.String[])
If I remove the assembly from the folder, Coded UI Test Builder lauches without error but it does not record actions on Telerik controls as expected.
Is there anything I can do to avoid this error?
Thank you,
Gajan