Skip to main content
Home Forums Silverlight Programming Programming with .NET - General "AG_E_PARSER_BAD_PROPERTY_VALUE" What is it?
6 replies. Latest Post by ivanatilca on June 27, 2008.
(1)
gnogna82
Member
0 points
4 Posts
06-27-2008 3:49 AM |
Hi All,
I am creating my custom control. In file mycustomcontrol.vb:
Partial Public Class MyCustomControlInherits Control...Public ReadOnly TitleProperty As DependencyProperty = DependencyProperty.Register("Title", GetType(String()), GetType(MyCustomControl()), Nothing)
And in my generic.xaml:
...<
But when I try to reference it in my page.xaml like this:
<dr:CustomEntryControl Title="blah"></dr:CustomEntryControl>
I receive this error:
Error 1 AG_E_PARSER_BAD_PROPERTY_VALUE [Line: 22 Position: 37] ...Page.xaml ...
Obviously the help doesn' help at all, and after googling a lot I found nothing. Any ideas?
Best regards,Dario Rossa
Jim Mangaly
Contributor
2610 points
380 Posts
06-27-2008 5:46 AM |
What do you have in line 22 of Page.xaml?
Jim (http://jimmangaly.blogspot.com/)
Please MARK the replies as answers if they answered your question
06-27-2008 6:01 AM |
Hi Jim,
sorry, I didn't tell, line 22 of page.xaml doesn't exist! It has only 16 lines. The one I posted is line 14:
it doesn't matter whatever I set the property, the error keeps showing. I guess it has something to do with my VB code, since Karen Corby's example works smooth (it is C#). But I cannot realize what, since the help doesn't help and the error cannot be found in Google. Quite strange.
Below is a screenshot:
06-27-2008 7:01 AM |
Hi Dario,
I'm not very familiar with VB.Net. But I think the problem is with the way you have defined your DependencyProperty. Try changing it to this:
Public ReadOnly TitleProperty As DependencyProperty = DependencyProperty.Register("Title", GetType(String), GetType(MyCustomControl), Nothing)
Basically just remove the brackets that follow String and MyCustomControl.
hari4u
39 points
78 Posts
06-27-2008 8:43 AM |
hi ,
you might miss events which are declared in xaml but not in xaml.vb ,
or u might have a property which is not defined in your project or as in xaml control properties.
I think the problem is with dr content ..make sure you add correct namespace of dr in your present xaml page..
Hari.
06-27-2008 10:12 AM |
Hi Jim, hi Hari,
thank you very much both for your help. This is the syntax I finally used:
Public ReadOnly TitleProperty As DependencyProperty = DependencyProperty.Register("Title", GetType(String), GetType(CustomEntryControl), Nothing)Public Property Title() As StringGetReturn CType(GetValue(TitleProperty), String)End GetSet(ByVal value As String)SetValue(TitleProperty, value)End SetEnd Property
Unfortunately the problem persisted, so I started randomly delving in the rest of the code in the hunt of the culprit, and surprise! Now it magically disappeared, and I cannot recall what did fix it! I someone encounters the same issue please let me know and I can send the entire code. I wish you a good day!
ivanatilca
113 points
110 Posts
06-27-2008 10:58 AM |
The age parse error cames up when u are not declaring an event in the code behind and it is in the xaml part... as i can see u have no declared event... try to remove de
XMLS:dr="" in your Usercontrol header... and the CustomEntrycontrol to checkout if that's the problem... if it is... then this event is missing in Entrycontrol.xaml...
Age parse error does not tell u that the error is in a clr u are calling but in the line where it is loaded...
Hope it help...
Remember to click on right answer if this helps