Skip to content
New issue

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

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

Already on GitHub? # to your account

Resizeable SplitViewPane #3793

Merged
merged 9 commits into from
May 12, 2020
Merged

Conversation

timunie
Copy link
Collaborator

@timunie timunie commented May 9, 2020

Describe the changes you have made to improve this project

  • Add a Thumb to Resize the Open Pane
  • Add a Style for the Thumb
  • Add a bool to indicate if Pane is Resizeable
  • Add MinimumOpenPaneLength and MaximumOpenPaneLength

Closed Issues

Closes #3763

@timunie
Copy link
Collaborator Author

timunie commented May 9, 2020

Here is a Preview:

SplitViewResizable

Copy link
Member

@punker76 punker76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please look at the missing properties at HamburgerMenu.

I also got this while I'm dragging

System.Windows.Data Error: 8 : Cannot save value from target back to source. BindingExpression:Path=OpenPaneLength; DataItem='HamburgerMenu' (Name='HamburgerMenuControl'); target element is 'SplitView' (Name='MainSplitView'); target property is 'OpenPaneLength' (type 'Double') ArgumentException:'System.ArgumentException: '-503' is not a valid value for the 'System.Windows.FrameworkElement.Width' property on a Setter.
   at System.Windows.Setter.Seal()
   at System.Windows.SetterBaseCollection.Seal()
   at System.Windows.Style.Seal()
   at MahApps.Metro.Controls.HamburgerMenu.ChangeItemFocusVisualStyle() in d:\projects\git\MahApps.Metro\src\MahApps.Metro\Controls\HamburgerMenu\HamburgerMenu.Properties.cs:line 463
   at MahApps.Metro.Controls.HamburgerMenu.OpenPaneLengthPropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args) in d:\projects\git\MahApps.Metro\src\MahApps.Metro\Controls\HamburgerMenu\HamburgerMenu.Properties.cs:line 26
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at MS.Internal.Data.PropertyPathWorker.SetValue(Object item, Object value)
   at System.Windows.Data.BindingExpression.UpdateSource(Object value)'

src/MahApps.Metro/Themes/HamburgerMenuTemplate.xaml Outdated Show resolved Hide resolved
@timunie
Copy link
Collaborator Author

timunie commented May 9, 2020

Please look at the missing properties at HamburgerMenu.

I also got this while I'm dragging

System.Windows.Data Error: 8 : Cannot save value from target back to source. BindingExpression:Path=OpenPaneLength; DataItem='HamburgerMenu' (Name='HamburgerMenuControl'); target element is 'SplitView' (Name='MainSplitView'); target property is 'OpenPaneLength' (type 'Double') ArgumentException:'System.ArgumentException: '-503' is not a valid value for the 'System.Windows.FrameworkElement.Width' property on a Setter.
   at System.Windows.Setter.Seal()
   at System.Windows.SetterBaseCollection.Seal()
   at System.Windows.Style.Seal()
   at MahApps.Metro.Controls.HamburgerMenu.ChangeItemFocusVisualStyle() in d:\projects\git\MahApps.Metro\src\MahApps.Metro\Controls\HamburgerMenu\HamburgerMenu.Properties.cs:line 463
   at MahApps.Metro.Controls.HamburgerMenu.OpenPaneLengthPropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args) in d:\projects\git\MahApps.Metro\src\MahApps.Metro\Controls\HamburgerMenu\HamburgerMenu.Properties.cs:line 26
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at MS.Internal.Data.PropertyPathWorker.SetValue(Object item, Object value)
   at System.Windows.Data.BindingExpression.UpdateSource(Object value)'

I don't get this error anymore. But you should double check anyway 😄

Have a great weekend
Tim

@timunie timunie changed the title [WIP] Resizeable SplitViewPane Resizeable SplitViewPane May 9, 2020
@punker76 punker76 force-pushed the SplitViewResizeable branch from b29169e to 8fbcbc3 Compare May 9, 2020 20:04
@punker76 punker76 force-pushed the SplitViewResizeable branch from 99d7eff to 9217584 Compare May 11, 2020 19:56
@punker76 punker76 added this to the 2.0.0 milestone May 11, 2020
@punker76 punker76 merged commit 9b2b671 into MahApps:develop May 12, 2020
@punker76
Copy link
Member

@timunie your changes have been merged, thanks for your contribution 👍

@timunie timunie deleted the SplitViewResizeable branch May 12, 2020 07:35
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Development

Successfully merging this pull request may close these issues.

Can SplitView have a GridSplitter or similar so that user can resize the left and right parts?
2 participants