Red Gate forums :: View topic - WPF / ValidationRules / Generics / Enumerations problem (C#)
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

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

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
eric-914



Joined: 30 Nov 2012
Posts: 28

PostPosted: Wed Oct 23, 2013 8:24 pm    Post subject: WPF / ValidationRules / Generics / Enumerations problem (C#) Reply with quote

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:
public class MyBaseRule<T> : ValidationRule
{
  public T Data { get; set; }
  ...
}

And I've got implementation classes off of the generic class, like:
Code:

public class MyRule : MyBaseRule<SomeEnumeration>
{
  public SomeEnumeration Data2 { get; set; }
  ...
}


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


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?
Back to top
View user's profile Send private message
jessica.ramos



Joined: 23 Apr 2012
Posts: 214

PostPosted: Wed Oct 30, 2013 7:29 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group