Page view counter
"AG_E_PARSER_BAD_PROPERTY_VALUE" What is it? Subscribe to this thread
Last post 06-27-2008 10:58 AM by ivanatilca. 6 replies.
Sort Posts:
06-27-2008 3:49 AM
"AG_E_PARSER_BAD_PROPERTY_VALUE" What is it?

Hi All,

I am creating my custom control. In file mycustomcontrol.vb:

Partial Public Class MyCustomControl
Inherits Control
...
Public ReadOnly TitleProperty As DependencyProperty = DependencyProperty.Register("Title", GetType(String()), GetType(MyCustomControl()), Nothing)

Public Property Title() As String
Get
Return CType(GetValue(TitleProperty), String)
End Get
Set(ByVal value As String)
SetValue(TitleProperty, value)
End Set
End Property

And in my generic.xaml:

...<TextBlock x:Name="TitleBlock" Grid.Row="1" Grid.Column="1" Margin="3" FontFamily="Verdana" FontSize="16"
Foreground="#FFFFFFFF" Text="{TemplateBinding Title}" HorizontalAlignment="Center" VerticalAlignment="Center"/>...

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

gnogna82

Loading...
Joined on 04-14-2008
Italy
Posts 4
06-27-2008 5:46 AM
Re: &quot;AG_E_PARSER_BAD_PROPERTY_VALUE&quot; What is it?

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

http://www.identitymine.com/

Jim Mangaly

Loading...
Joined on 04-21-2008
Kochi, India
Posts 378
06-27-2008 6:01 AM
Re: &quot;AG_E_PARSER_BAD_PROPERTY_VALUE&quot; What is it?

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:

 <dr:CustomEntryControl Title="blah"></dr:CustomEntryControl> 

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:

Best regards,
Dario Rossa

gnogna82

Loading...
Joined on 04-14-2008
Italy
Posts 4
06-27-2008 7:01 AM
Re: &quot;AG_E_PARSER_BAD_PROPERTY_VALUE&quot; What is it?

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

Jim (http://jimmangaly.blogspot.com/)

Please MARK the replies as answers if they answered your question

http://www.identitymine.com/

Jim Mangaly

Loading...
Joined on 04-21-2008
Kochi, India
Posts 378
06-27-2008 8:43 AM
Re: Re: &amp;quot;AG_E_PARSER_BAD_PROPERTY_VALUE&amp;quot; What is it?

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. 

hari4u

Loading...
Joined on 06-13-2008
Posts 78
06-27-2008 10:12 AM
Re: Re: &amp;quot;AG_E_PARSER_BAD_PROPERTY_VALUE&amp;quot; What is it?

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 String
Get
Return CType(GetValue(TitleProperty), String)
End Get
Set(ByVal value As String)
SetValue(TitleProperty, value)
End Set
End 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!

Best regards,
Dario Rossa

gnogna82

Loading...
Joined on 04-14-2008
Italy
Posts 4
06-27-2008 10:58 AM
Marked as Answer
Re: Re: &amp;quot;AG_E_PARSER_BAD_PROPERTY_VALUE&amp;quot; What is it?

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

Ivana A. Tilca | Microsoft Student Partner | Channel 8 editor | Microsoft

http://ivanatilca.com.ar

ivanatilca

Loading...
Joined on 03-24-2008
Argentina
Posts 110
Microsoft Communities