Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InRibbonGallery broken when ItemsSource is empty #485

Closed
dominiks opened this issue Oct 26, 2017 · 1 comment
Closed

InRibbonGallery broken when ItemsSource is empty #485

dominiks opened this issue Oct 26, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@dominiks
Copy link

When the ItemsSource for a InRibbonGallery is an empty collection, the popup closes on click to expand the gallery and prints this stacktrace:

System.Windows.Data Error: 8 : Cannot save value from target back to source. BindingExpression:Path=IsDropDownOpen; DataItem='InRibbonGallery' (Name=''); target element is 'ToggleButton' (Name='PART_ExpandButton'); target property is 'IsChecked' (type 'Nullable`1') ArgumentOutOfRangeException:'System.ArgumentOutOfRangeException: Der Parameterwert muss größer Null sein.
Parametername: pixelWidth
   bei System.Windows.Media.Imaging.RenderTargetBitmap..ctor(Int32 pixelWidth, Int32 pixelHeight, Double dpiX, Double dpiY, PixelFormat pixelFormat)
   bei Fluent.InRibbonGallery.set_IsSnapped(Boolean value) in C:\projects\fluent-ribbon\Fluent.Ribbon\Controls\InRibbonGallery.cs:Zeile 723.
   bei Fluent.InRibbonGallery.OnDropDownOpened(Object sender, EventArgs e) in C:\projects\fluent-ribbon\Fluent.Ribbon\Controls\InRibbonGallery.cs:Zeile 1207.
   bei System.Windows.FrameworkElement.RaiseClrEvent(EventPrivateKey key, EventArgs args)
   bei System.Windows.Controls.Primitives.Popup.CreateWindow(Boolean asyncCall)
   bei System.Windows.Controls.Primitives.Popup.OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   bei System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
   bei System.Windows.StyleHelper.InvalidateDependents(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, FrugalStructList`1& dependents, Boolean invalidateOnlyContainer)
   bei System.Windows.StyleHelper.OnTriggerSourcePropertyInvalidated(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, DependencyPropertyChangedEventArgs changedArgs, Boolean invalidateOnlyContainer, FrugalStructList`1& triggerSourceRecordFromChildIndex, FrugalMap& propertyTriggersWithActions, Int32 sourceChildIndex)
   bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   bei System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   bei MS.Internal.Data.PropertyPathWorker.SetValue(Object item, Object value)
   bei System.Windows.Data.BindingExpression.UpdateSource(Object value)'

If the mouse button is held the popup stays open and the gallery's menu items can be used. To reproduce the issue, change the DataItems in the sample to be empty.


Environment

  • Fluent.Ribbon 5.0.2.46
  • Windows 10
  • .NET Framework 4.5.2
@batzen batzen self-assigned this Oct 26, 2017
@batzen batzen added this to the 6.0.0 milestone Oct 26, 2017
@batzen batzen closed this as completed in f891ef7 Oct 26, 2017
@dominiks
Copy link
Author

Thank you for the quick solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants