WPF / ValidationRules / Generics / Enumerations problem (C#)

.NET obfuscator and automated error reporting

WPF / ValidationRules / Generics / Enumerations problem (C#)

Postby eric-914 » Wed Oct 23, 2013 7:24 pm

Hello, this is occurring w/in WPF and a control's validation rules definition, but I suspect it's more a problem regarding generics.

I've got the following generic class that derives from ValidationRule (WPF):

Code: Select all
public class MyBaseRule<T> : ValidationRule
  public T Data { get; set; }

And I've got implementation classes off of the generic class, like:
Code: Select all
public class MyRule : MyBaseRule<SomeEnumeration>
  public SomeEnumeration Data2 { get; set; }

Now in WPF, w/in the ValidationRules definition:
Code: Select all
  <Validation:MyRule Data="SomeEnumerationValue" />

This will FAIL, w/ a NotImplementedException.

However, if I use Data2 in place of Data, things will work.

I have turned OFF all pruning, obfuscation, and so on, to try and narrow this down. This is only happening after being run through SA.

Can anyone tell me why WPF can't see the Data property of the generic parent class, but is ok w/ seeing the Data2 property, which should be the same thing?
Posts: 30
Joined: Fri Nov 30, 2012 4:51 pm

Postby jessica.ramos » Wed Oct 30, 2013 6:29 pm

Hi Eric!

I sent you a message a few days ago regarding your post, but in case you haven't received it..

I'm afraid I'm not immediately sure why this error is happening. Do you think you would you be able to provide us with your unprocessed application to do some testing on this?
Jessica Ramos
Technical Support
Red Gate Software Ltd.
Posts: 542
Joined: Mon Apr 23, 2012 12:13 pm

Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 0 guests