Datagrid - Scrolling will crop images horizontally instead of vertically

断了今生、忘了曾经 提交于 2019-12-02 08:59:17

Ok I found how to solve it. The transformation applied into the DataGridCell was creating this scrollviewer problem. To solve that, I removed the layout transform on the DataGridCell (by removing the BaseOn code) and I applied the transformation into the DataGridCell Template.

WRONG

<Style TargetType="DataGridCell" BasedOn="{StaticResource DataGridBase}"/>

RIGHT

<Style TargetType="DataGridCell">
  <Setter Property="Template">
    <Setter.Value>
       <ControlTemplate TargetType="{x:Type DataGridCell}">
           <Grid>
                <Grid.LayoutTransform>
                   <TransformGroup>
                        <RotateTransform Angle="90" />
                        <MatrixTransform Matrix="-1, 0, 0, 1, 0, 0" />
                   </TransformGroup>
               </Grid.LayoutTransform>
               <ContentPresenter/>
           </Grid>
        </ControlTemplate>
      </Setter.Value>
   </Setter>
</Style>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!