Hello community!
I want to display a long list of variables in the ApplicaitonMenu2010Item.Content Area. I have inserted there an ItemsControl wich is wrapped inside a ScrollViewer. However, the scrollviewer never gets active although the needed area to display the list of the grews out of the screen. Instead, an "outer" vertical scrollbar gets visible which scrolls the complete ApplicationMenu instead of the active content.
Is there a way to disable the "Outer" scrollbar as I always want to display the other backstage Items.
Hi grubarec,
That outer scrollbar is part of an internal ScrollViewer that makes up the ApplicationMenu so I don't think disabling it will help as the ScrollViewer will still exist making your content extend down off the window. What you need to do is restrict the height of your content to that of the application menu so that the scrollbar won't appear to begin with. You can do this by binding to the ApplicationMenu's Height property. Take a look at the sample I attached.
In the sample I bind your content to the ApplicationMenu's ActualHeight property and I added a converter to reduce it a bit further. If you use the same exact height as the ApplicationMenu then the ScrollViewer scrollbars will still render. So decreasing the height by 1 or 2 pixels will be enough to stop the scrollbar from showing.
I stand corrected. All you need to do is set ScrollViewer.VerticalScrollBarVisibility="Disabled" on the ApplicationMenu2010 object.
<igRibbon:ApplicationMenu2010 Caption="Settings" IsOpen="{Binding ElementName=nameMainWindow, Path=IsOpen}" Visibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Disabled">
Hello Rob!
Although your answer is working in the sample, I still had problems in our solution that uses prism. Explanation: The Applicaiton Menu contains a content Control and is defined as prism region. On opening, I execute a request navigate into the content region and a separate view and viewmodel are loaded into the area which is defined in the application menut item content. The view contains the itemscontrol and the user can define how many values he wants to see in this area.In the view (which is loaded into the application menu), I had to request Application.Current.MainWindow.ActualHeight (- the window header). I took this height as maximum height of the scrollviewer in which the inner items control is encapsulated. I also subscribed to the Size Changed Event of the Application.Current.MainWindow to recalculate the height of the inner scroll viewer.When the ViewLoaded Event happens, I make a subscription to the ItemsSource Changed event. This is needed to calculate the desired height of my loaded itemscontrol when the user add additional controls or disables current controls.
I don't think you need to do any of that. If you set the ScrollViewer.VerticalScrollBarVisibility to Disabled then whatever content you stick inside the application menu should fill all of the available space without an infinite height like it was doing before. So your content's ScrollViewer will think that it has a finite amount of height to work with and it will scroll it's own content appropriately. You don't need to calculate any heights anymore if you use this approach, unless there is something I'm missing with regards to your implementation.