Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello experts,

In an existing application, with target framework 3.5 and IDE VS2008, we are using WPF toolkit datepickers. These datepickers, have an issue as, when they are enabled programatically, their appearance remains like a disabled control but they are clickable.
Refer this link for further info:
https://wpf.codeplex.com/workitem/14273[^]

To handle this, we wrote the following event :
C#
private void dt_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
{
   System.Windows.Controls.DatePicker datePicker = sender as System.Windows.Controls.DatePicker;
   if (datePicker.IsEnabled)
     System.Windows.VisualStateManager.GoToState(datePicker, "Normal", true);
   else
     System.Windows.VisualStateManager.GoToState(datePicker, "Disabled", true);
}


Now, this worked fine with VS2008. But now when we upgraded our solution, in VS2012, the VisualStateManager is throwing compiletime error.:

The type 'System.Windows.VisualStateManager' exists in both 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\PresentationFramework.dll' and 'WPFToolkit.dll'

I googled a lot, but did not get any good solution.

Please can anyone help me here, how should I remove this ambiguity.

Regards,
Praneet
Posted

1 solution

I am not sure, but can you try with removing reference of "WPFToolKit.dll".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900