Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 :
C#
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
Posted

1 solution

VisualStateManager class is conflicting, because it is present in specified both the dll's http://msdn.microsoft.com/en-us/library/system.windows.visualstatemanager(v=vs.110).aspx[^]
 
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