Ribbon Iusse

Hello,


In the attached sample I put a docking manager into a ribboned window.


There are 2 iusses:


- if user collapse the ribbon, it can't expande it again because the icon disappear.


- if the user click on a ribbon item like menu2/menu3/Setting/help with the ribbon collapsed it get an exception:


System.NullReferenceException: 'Object reference not set to an instance of an object.' syncfusion ribbon


Can be fixed? Any advice?




Attachment: WpfApp2_7fd2cb4f.zip

1 Reply

SM Subashini Mahendran Syncfusion Team February 7, 2022 09:28 AM UTC

Hi Matteo,


Thank you for contacting Syncfusion support.


Query 1: If the user collapses the ribbon, it can't expand it again because the minimize button icon disappears.


It is default behavior of our Ribbon control to hide the minimize button after it clicked as like MS Word document in SfSkinManager themes. To show ribbon again, either click the ribbon tabs manually or set the RibbonState property of Ribbon control as Normal through a button click.


Suppose if your requirement is to switch back and forth between the simplified and the normal layout using the minimize button, then by setting EnableSimplifiedLayoutMode property of Ribbon as true it can be achieved. Please find the UG documentation link regarding it below:


https://help.syncfusion.com/wpf/ribbon/simplifiedlayout#switching-between-simplified-and-normal-layouts


If we misunderstood your requirement, please provide more additional details regarding it. So, it will be helpful to prompt the solution further.


Query 2: Null reference exception thrown while selecting the ribbon tab item at second time after clicking minimize button


We were able to reproduce the NRE crash while selecting the ribbon tab item for the second time after clicking the minimize button. This type of issue occurs due to VS2017/VS2019 debugger.  Since the Visual Tree is refreshed at runtime after the Windows 10 fall creator update. Due to this, we could not get the children of UIElement which causes problems with collection.  


Please refer to the MSDN link below for further reference.

https://developercommunity.visualstudio.com/content/problem/71484/systeminvalidoperationexception-the-visual-tree-ha.html

https://social.msdn.microsoft.com/Forums/vstudio/en-US/1732fe72-30ce-4cdb-b06f-a4becf0f2d72/when-debugging-i-cannot-open-any-forms-in-vs-2017-windows-10-build-16215?forum=wpf


Also in the following link, it denoted as known issue ofVS2019:

https://developercommunity.visualstudio.com/content/problem/583263/systemnullreferenceexception-after-latest-update.html


Therefore, we suggest you to disable the “Enable UI Debugging Tools for Xaml” in the options of Debug tab of VS 2019 or VS2017 in order to resolve the reported crash. This option is only available in Visual Studio's lower version.



These options were moved to "Debugging > Hot Reload" in the upgraded version of Visual Studio 2019. In the Enable XAML Hot reload option, simply uncheck the WPF checkbox. In our VS 2019 16.10.3, we disabled this option and check the issue. We are no longer experiencing the exception, and the application working as expected.



Regards,

Subashini M.


Loader.
Up arrow icon