DatePicker Issue - Inside Custom Expander - 'PART_DisabledVisual' Title is required

Feb 2, 2009 at 8:38 PM
Error: 'PART_DisabledVisual' name cannot be found in the name scope of 'System.Windows.Controls.Grid'.

I'm getting the above error while using DatePicker inside Outlook Bar Expander from http://www.codeplex.com/Oddasy

If I remove the datepicker, all works. Can anyone guide or point to some reference to solve this?

-------------Some lines from StackTrace--------------------------------
at System.Windows.Media.Animation.Storyboard.ResolveTargetName(String targetName, INameScope nameScope, DependencyObject element)
at System.Windows.Media.Animation.Storyboard.ClockTreeWalkRecursive(Clock currentClock, DependencyObject containingObject, INameScope nameScope, DependencyObject parentObject, String parentObjectName, PropertyPath parentPropertyPath, HandoffBehavior handoffBehavior, HybridDictionary clockMappings, Int64 layer)
at System.Windows.Media.Animation.Storyboard.ClockTreeWalkRecursive(Clock currentClock, DependencyObject containingObject, INameScope nameScope, DependencyObject parentObject, String parentObjectName, PropertyPath parentPropertyPath, HandoffBehavior handoffBehavior, HybridDictionary clockMappings, Int64 layer)
at System.Windows.Media.Animation.Storyboard.BeginCommon(DependencyObject containingObject, INameScope nameScope, HandoffBehavior handoffBehavior, Boolean isControllable, Int64 layer)
at System.Windows.Media.Animation.Storyboard.Begin(FrameworkElement containingObject, HandoffBehavior handoffBehavior, Boolean isControllable)
at System.Windows.VisualStateGroup.StartNewThenStopOld(FrameworkElement element, Storyboard[] newStoryboards)
at System.Windows.VisualStateManager.GoToStateInternal(Control control, FrameworkElement element, VisualStateGroup group, VisualState state, Boolean useTransitions)
at System.Windows.VisualStateManager.GoToState(Control control, String stateName, Boolean useTransitions)
at Microsoft.Windows.Controls.ButtonBaseBehavior.UpdateState(Control control, Boolean useTransitions)
at Microsoft.Windows.Controls.ControlBehavior.UpdateStateHandler(Object o, EventArgs e)
at MS.Internal.ComponentModel.PropertyChangeTracker.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
at System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
at System.Windows.DependencyObject.CoerceValue(DependencyProperty dp)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(Visual v, DependencyProperty property)
at System.Windows.UIElement.OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
---------------------------------------------
Coordinator
Feb 2, 2009 at 11:03 PM
This is a known issue. Please check: http://www.codeplex.com/wpf/WorkItem/View.aspx?WorkItemId=7904 for some tips & fixes.

-Eric Fabricant, MSFT
Feb 4, 2009 at 11:17 AM
Eric,

Thank you. I used the following approach and worked.

- I had to change the name on line 103 from "Disabled" to "PART_Disabled" in the source
- Assigned a Signature to the source code solution and used that custom built release code in my project.

It works nice now...

Thanks.
Coordinator
Feb 5, 2009 at 3:22 AM
Edited Feb 5, 2009 at 3:22 AM

I do not recommend that solution. Please my previously posted link for (new) details.

-Eric Fabricant, MSFT

Feb 7, 2009 at 5:59 PM
----------------------------------

ericf wrote Nov 13 2008 at 1:53 PM
In The DatePicker's Style, in Generic.XAML, there is an animation that targets PART_DisabledVisual. This Animation gets fired when the state (of the VSM's parent, the Grid) changes to Disabled. The problem here is that PART_DisabledVisual is not in scope from here. PART_Disabled is outside of that Grid and also outside of it's parent (DropDownButtonTemplate). Commenting out this Animation (and its Storyboard) fixes the issue because a different animation targets PART_Disabled from higher in the tree within the DatePicker's ControlTemplate where PART_Disabled is in scope. So, to solve your issue, you can comment out the contents of the VisualState element for the Disabled State inside the Grid mentioned before. Thanks for finding this :-)

-Eric Fabricant, MSFT

---------------------------------

I assume you are pointing to this. I'm trying now.

Thank you for puting me to write solution.
Jun 3, 2009 at 2:14 PM

This issue still exists in the latest version of WPFToolkit when setting the IsEnabled property from binding in a ViewModel using PRISM.