WPF-Caliburn micro 中的 ScrollViewer

ScrollViewer in WPF-Caliburn micro

在使用 Caliburn Micro MVVM 时,我无法在 WPF 中运行 ScrollViewerhttps://github.com/moon1234moon/Factures

这是我的XML代码:

<ScrollViewer VerticalScrollBarVisibility="Visible"
                  HorizontalScrollBarVisibility="Visible">
        <Grid HorizontalAlignment="Left" VerticalAlignment="Top"
              MaxHeight="900"
              MaxWidth="900"
              >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="20" />
                <ColumnDefinition Width="auto" />
                <ColumnDefinition Width="auto" />
                <ColumnDefinition Width="auto" />
                <ColumnDefinition Width="auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="20" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="20" />
                <RowDefinition Height="auto" />
                <RowDefinition Height="auto" />
                <RowDefinition Height="auto" />
                <RowDefinition Height="auto" />
                <RowDefinition Height="auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="20" />
            </Grid.RowDefinitions>

            <!-- Deleted because they are quite a lot -->

            <ContentControl Grid.Column="3" Grid.Row="1" Grid.RowSpan="5" 
                        x:Name="ActiveItem"
                        Margin="30, 150, 30, 30"
                        />
        </Grid>
    </ScrollViewer>

当然,我尝试启用滚动 IsEnabled = true 并添加了 VerticalAlignmentHorizentalAlignment 到它,但没有一个似乎工作!..

请帮忙!! PS:对我来说最重要的部分是能够水平滚动以查看 ContentControl 的内容

结果如下: Image shows scroll to be not enabled

1) 从您的用户控件视图中推迟命令 MaxHeight 和 MaxWidth

2) 推迟同一视图的滚动查看器并在主视图中定义滚动查看器 window(我想是 shellview)。主要window 内容所有用户控件

3)一切都会好的