I've got a window that contains a RadSplitButton control in it. Here's a snippet of the code surrounding the RadSplitButton:
When the program runs, everything works fine and the window displays without any errors. But, when I view the window in the Designer panel in Visual Studio 2010, an exception is reported!
Here's the exception that appears instead of the rendering of the window:
Does anyone have any explanation for what's going on? I'm not using the "my" prefix anywhere in my code.
Tony
<
Window
x:Class
=
"CarSystem.AlarmsDialog"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:c
=
"clr-namespace:CarSystem"
xmlns:cc
=
"clr-namespace:CarSystem.CustomControls;assembly=CustomControls"
xmlns:tl
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
Background
=
"Transparent"
BorderBrush
=
"Black"
BorderThickness
=
"5"
Closing
=
"Window_Closing"
Foreground
=
"White"
HorizontalAlignment
=
"Center"
Height
=
"890"
Icon=". . .
Loaded
=
"Window_Loaded"
ResizeMode
=
"CanMinimize"
Title
=
". . ."
VerticalAlignment
=
"Center"
Width
=
"890"
WindowStartupLocation
=
"CenterScreen"
WindowStyle
=
"None"
>
<
StackPanel
Background
=
"#FF3C4B66"
>
. . .
<
StackPanel
FocusManager.IsFocusScope
=
"true"
HorizontalAlignment
=
"Right"
Orientation
=
"Horizontal"
>
<
Button
Background
=
"{DynamicResource ButtonBackground}"
Click
=
"CorrectButton_Click"
Content
=
"CORRECT"
FontSize
=
"20"
FontWeight
=
"Bold"
Foreground
=
"{DynamicResource ButtonForeground}"
Height
=
"60"
HorizontalAlignment
=
"Right"
Margin
=
"10"
Name
=
"CorrectButton"
Width
=
"156"
VerticalAlignment
=
"Center"
/>
<
telerik:RadSplitButton
Background
=
"{DynamicResource ButtonBackground}"
Click
=
"MisreadButton_Click"
CloseOnEscape
=
"False"
Content
=
"INCORRECT"
DropDownIndicatorVisibility
=
"Visible"
DropDownPlacement
=
"Top"
FontSize
=
"20"
FontWeight
=
"Bold"
Foreground
=
"{DynamicResource ButtonForeground}"
Height
=
"60"
HorizontalAlignment
=
"Right"
Margin
=
"10"
Name
=
"IncorrectButton"
Style
=
"{StaticResource RadSplitButtonStyle1}"
VerticalAlignment
=
"Center"
Width
=
"200"
>
<
telerik:RadSplitButton.DropDownContent
>
<
tl:RadContextMenu
>
<
tl:RadMenuItem
Header
=
"DEFER (8 hrs)"
Click
=
"DeferAlarm_Click"
/>
<
tl:RadMenuItem
Header
=
"MISREAD"
Click
=
"MisreadAlarm_Click"
/>
<
tl:RadMenuItem
Header
=
"NO PLATE"
Click
=
"NoPlate_Click"
/>
<
tl:RadMenuItem
Header
=
"HL ENTRY EXPIRED"
Click
=
"ExpiredHLEntry_Click"
/>
<
tl:RadMenuItem
Header
=
"WRONG STATE"
Click
=
"WrongState_Click"
/>
<
tl:RadMenuItem
Header
=
"UNKNOWN"
Click
=
"Unknown_Click"
/>
</
tl:RadContextMenu
>
</
telerik:RadSplitButton.DropDownContent
>
</
telerik:RadSplitButton
>
</
StackPanel
>
</
StackPanel
>
. . .
</
StackPanel
>
</
Window
>
When the program runs, everything works fine and the window displays without any errors. But, when I view the window in the Designer panel in Visual Studio 2010, an exception is reported!
Here's the exception that appears instead of the rendering of the window:
System.Reflection.TargetInvocationException
Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Delegate.DynamicInvokeImpl(Object[] args) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
System.Windows.Markup.XamlParseException
Failed to create a 'Path' from the text '(my:RadSplitButton.ToggleContentRotateAngle)'.
at System.Windows.Markup.XamlReader.RewrapException(Exception e, Uri baseUri) at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter) at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter) at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField) at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren) at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate) at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container) at System.Windows.FrameworkElement.ApplyTemplate() at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.StackPanel.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.StackPanel.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.StackPanel.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Border.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Border.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Border.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Border.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Border.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Designer.ZoomableViewPresenter.DesignerBackground.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at Microsoft.Windows.Design.Interaction.DesignerView.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Designer.Viewport.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Interop.HwndSource.SetLayoutSize() at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value) at MS.Internal.DeferredHwndSource.ProcessQueue(Object sender, EventArgs e)
System.Xaml.XamlParseException
Prefix 'my' does not map to a namespace.
at MS.Internal.Xaml.XamlContext.ResolveXamlType(String qName, Boolean skipVisibilityCheck) at MS.Internal.Xaml.Context.ObjectWriterContext.ServiceProvider_Resolve(String qName) at MS.Internal.Xaml.ServiceProviderContext.System.Windows.Markup.IXamlTypeResolver.Resolve(String qName) at System.Windows.PropertyPath.GetTypeFromName(String name, Object context) at System.Windows.PropertyPath.ResolvePropertyName(String name, Object item, Type ownerType, Object context, Boolean throwOnError) at System.Windows.PropertyPath.ResolvePathParts(ITypeDescriptorContext typeDescriptorContext) at System.Windows.PropertyPath.PrepareSourceValueInfo(ITypeDescriptorContext typeDescriptorContext) at System.Windows.PropertyPath..ctor(String path, ITypeDescriptorContext typeDescriptorContext) at System.Windows.PropertyPathConverter.ConvertFrom(ITypeDescriptorContext typeDescriptorContext, CultureInfo cultureInfo, Object source) at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateObjectWithTypeConverter(ServiceProviderContext serviceContext, XamlValueConverter`1 ts, Object value) at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateFromValue(ServiceProviderContext serviceContext, XamlValueConverter`1 ts, Object value, XamlMember property) at System.Xaml.XamlObjectWriter.Logic_CreateFromValue(ObjectWriterContext ctx, XamlValueConverter`1 typeConverter, Object value, XamlMember property, String targetName, IAddLineInfo lineInfo)
Does anyone have any explanation for what's going on? I'm not using the "my" prefix anywhere in my code.
Tony