Autofit the scrollviewer's height

Ribbon for WPF Forum

Posted 6 years ago by lik
Version: 13.2.0590
Avatar

Hi,

  How to make the scrollviewer autofit the height of the applicationmenu? I cannot find the method in the samples.

code follows:

<ribbon:ApplicationMenu.AdditionalContent> <Border Style="{StaticResource ContentBoxBorderStyle}"> <DockPanel Margin="3,0"> <ribbon:Separator DockPanel.Dock="Top" Label="Recent" Context="BackstageItem"/> <shared:ZeroSizeContentControl HasHeight="False"> <ScrollViewer x:Name="SvDoc" Margin="0,0,0,0" MaxWidth="500" VerticalScrollBarVisibility="Auto" HorizontalAlignment="Left" Style="{DynamicResource {x:Static themes:SharedResourceKeys.ScrollViewerStyleKey}}"> <ribbon:RecentDocumentMenu x:Name="Recent" VariantSize="Large"> <shared:RecentDocumentManager x:Name="recentDocManager"/> </ribbon:RecentDocumentMenu> </ScrollViewer> </shared:ZeroSizeContentControl> </DockPanel> </Border> </ribbon:ApplicationMenu.AdditionalContent>

Lik

Comments (3)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, I think you would want to just keep it simpler like this:

<ribbon:ApplicationMenu.AdditionalContent>
	<ribbon:RecentDocumentMenu x:Name="Recent" VariantSize="Large" MinHeight="300">
		<shared:RecentDocumentManager x:Name="recentDocManager"/>
	</ribbon:RecentDocumentMenu>
</ribbon:ApplicationMenu.AdditionalContent>		


Actipro Software Support

Posted 6 years ago by lik
Avatar

Hello,In your method,the scrollviewer is removed,so the left of the recentdoc is not fit for the applicationmenu's height if it has many docs.This is not what I want.

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

How about something like this instead:

<ribbon:Ribbon.ApplicationMenu>
	<ribbon:ApplicationMenu MaxHeight="500">
		<ribbon:Button Label="New" />
		<ribbon:Button Label="Open" />
		<ribbon:Button Label="Save" />
		<ribbon:ApplicationMenu.AdditionalContent>
			<ScrollViewer Style="{DynamicResource {x:Static themes:SharedResourceKeys.ScrollViewerStyleKey}}">
				<ribbon:RecentDocumentMenu x:Name="Recent" VariantSize="Large" MinHeight="300">
					<shared:RecentDocumentManager x:Name="recentDocManager"/>
				</ribbon:RecentDocumentMenu>
			</ScrollViewer>
		</ribbon:ApplicationMenu.AdditionalContent>
	</ribbon:ApplicationMenu>
</ribbon:Ribbon.ApplicationMenu>


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.