简体   繁体   English

如何在 UWP 中放大滚动查看器,但保持滚动查看器的宽度和高度拉伸以适合父面板或网格列?

[英]How do you zoom in a scrollviewer in UWP but keep the width and height of the scrollviewer stretched to fit in the parent panel or grid column?

See the images below.请参阅下面的图片。 One is at 78% zoom but the whole content is zoomed out but not stretching to its parent control despite having Horizontal and Vertical Alignment set to "stretch".一个是 78% 的缩放,但整个内容被缩小但没有拉伸到其父控件,尽管水平和垂直 Alignment 设置为“拉伸”。

ScrollViewer is in a GridColumn and GridRow and the Grid is being loaded into a Frame which is a part of the NavigationView on the mainpage. ScrollViewer 位于 GridColumn 和 GridRow 中,并且 Grid 正在加载到 Frame 中,该 Frame 是主页上 NavigationView 的一部分。

在此处输入图像描述

Desired effect is for the content to get smaller but fit to the width and height to show more columns in this case.所需的效果是内容变小但适合宽度和高度以在这种情况下显示更多列。

See the images below.请参阅下面的图片。 One is at 78% zoom but the whole content is zoomed out but not stretching to its parent control despite having Horizontal and Vertical Alignment set to "stretch".一个是 78% 的缩放,但整个内容被缩小但没有拉伸到其父控件,尽管水平和垂直 Alignment 设置为“拉伸”。

This behavior of ScrollViewer is by-deign, derive from the screenshot the DataGrid is a whole place. ScrollViewer的这种行为是设计使然,从屏幕截图中派生出DataGrid是一个完整的地方。 When we zoom in or out, The DataGrid will zoom overall.当我们放大或缩小时, DataGrid将整体放大。 For the requirement, you could edit the DataGrid's MaxColumnWidth property when zoom.对于要求,您可以在缩放时编辑 DataGrid 的MaxColumnWidth属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM