code_junkie

XamlParseException: Attribute in custom control missing, but it's defined!

Nov 11th, 2011
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. {System.Windows.Markup.XamlParseException: Unknown attribute Points on element SectionClickableArea. [Line: 10 Position: 16]
  2. at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
  3. at SomeMainDialog.InitializeComponent()
  4. at SomeMainDialog..ctor()}
  5.  
  6. <l:SectionClickableArea x:Name="SomeButton"
  7. Points="528,350, 508,265, 520,195, 515,190, 517,165, 530,120, 555,75, 570,61, 580,60, 600,66, 615,80, 617,335, 588,395, 550,385, 540,390, 525,393, 520,385"
  8. Click="SomeButton_Click"/>
  9.  
  10. public partial class SectionClickableArea : Button {
  11.  
  12. public static readonly DependencyProperty PointsProperty
  13. = DependencyProperty.Register("Points", typeof(PointCollection), typeof(SectionClickableArea),
  14. new PropertyMetadata((s, e) => {
  15. SectionClickableArea area = (SectionClickableArea) s;
  16. area.areaInfo.Points = (PointCollection) e.NewValue;
  17. area.UpdateLabelPosition();
  18. }));
  19. public PointCollection Points {
  20. get { return (PointCollection) GetValue(PointsProperty); }
  21. set { SetValue(PointsProperty, value); }
  22. }
  23.  
  24. Type: System.InvalidCastException Message: The object of type System.Windows.Controls.ContentControl could not be converted to type [...]SectionClickableArea. at SomeOtherMainDialog.InitializeComponent()
  25. at SomeOtherMainDialog..ctor()
  26.  
  27. Type: System.Exception Message: An HRESULT E_FAIL error was returned when calling COM component at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
  28. at MS.Internal.XcpImports.SetValue(INativeCoreTypeWrapper obj, DependencyProperty property, DependencyObject doh)
  29. at MS.Internal.XcpImports.SetValue(INativeCoreTypeWrapper doh, DependencyProperty property, Object obj)
  30. at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
  31. at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isSetByStyle, Boolean isSetByBuiltInStyle)
  32. at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
  33. at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
  34. at System.Windows.Controls.Control.set_DefaultStyleKey(Object value)
  35. at System.Windows.Controls.ContentControl..ctor()
  36. at System.Windows.CoreTypes.GetCoreWrapper(Int32 typeId)
  37. at MS.Internal.ManagedPeerTable.EnsureManagedPeer(IntPtr unmanagedPointer, Int32 typeIndex, Type type, Boolean preserveManagedObjectReference)
  38. at MS.Internal.ManagedPeerTable.EnsureManagedPeer(IntPtr unmanagedPointer, Int32 typeIndex, Type type)
  39. at MS.Internal.ManagedPeerTable.GetManagedPeer(IntPtr nativeObject)
  40. at MS.Internal.FrameworkCallbacks.SetPropertyAttribute(IntPtr nativeTarget, String attrName, String attrValue, String attachedDPOwnerNamespace, String attachedDPOwnerAssembly)
  41.  
  42. <UserControl.Resources>
  43. <customNamespace:InheritedControl x:Name="dummyInstance"/>
  44. </UserControl.Resources>
Add Comment
Please, Sign In to add comment