Hi All,
I am using a WPF Toolkit's DatePicker which gets enabled conditionally.
The toolkit version is for .Net Framework 3.5
Now, when DatePicker IsEnabled is set to true, it does not change the disable appearance of the control.
https://wpf.codeplex.com/workitem/14273[
^]
Hence, to resolve this, I used the following code :
private void DatePicker_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
{
var dp = sender as Microsoft.Windows.Controls.DatePicker;
if ( dp.IsEnabled )
VisualStateManager.GoToState(dp, "Normal", true);
else
VisualStateManager.GoToState(dp, "Disabled", true);
}
When I upgraded the .Net Framework to version 4.0, we get the following error :
Error 1059 The type 'System.Windows.VisualStateManager' exists in both 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\PresentationFramework.dll' and 'D:\Lib\WPFLib\WPFToolkit.dll'
I am not getting how should I resolve this.
Also, is there any way I can achieve this by using the VisualStateManager in xaml
Please suggest a possible solution.
Regards,
Praneet