扩展器滚动问题

时间:2016-05-25 11:34:51

标签: wpf scroll material-design expander

ExpanderStackpanel内有一个ScrollViewer。 现在,当我将鼠标移动到扩展的扩展器上时,滚动查看器的滚动不再起作用。 有人能帮助我理解为什么吗?

<ScrollViewer VerticalScrollBarVisibility="Auto" Name="Scroller">
    <StackPanel  Name="Panel1">
            <Expander Header="{Binding Source={x:Static properties:Strings.GeneralSettings}}" IsExpanded="True">
                <StackPanel>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <TextBox Grid.Column="0" Grid.Row="0" Text="{Binding ProjectDataService.CurrentProject.ProjectName,Mode=TwoWay}" material:TextFieldAssist.Hint="Projektname" Margin="10" />
                        <TextBox Grid.Column="1" Grid.Row="0" Text="{Binding ProjectDataService.CurrentProject.ProjectLead,Mode=TwoWay}" material:TextFieldAssist.Hint="Projektleitung" Margin="10" />
                        <TextBox Grid.Column="0" Grid.Row="1" Text="{Binding ProjectDataService.CurrentProject.City,Mode=TwoWay}"  material:TextFieldAssist.Hint="Ort" Margin="10" />
                        <TextBox Grid.Column="1" Grid.Row="1" Text="{Binding ProjectDataService.CurrentProject.ZipCode,Mode=TwoWay}" material:TextFieldAssist.Hint="Postleitzahl" Margin="10" />
                        <TextBox Grid.Column="0" Grid.Row="2" Text="{Binding ProjectDataService.CurrentProject.Street,Mode=TwoWay}" material:TextFieldAssist.Hint="Strasse" Margin="10" />
                        <TextBox Grid.Column="1" Grid.Row="2" Text="{Binding ProjectDataService.CurrentProject.HouseNumber,Mode=TwoWay}" material:TextFieldAssist.Hint="Hausnummer" Margin="10" />
                        <TextBox Grid.Column="0" Grid.Row="3" Text="{Binding ProjectDataService.CurrentProject.ContactName,Mode=TwoWay}" material:TextFieldAssist.Hint="Ansprechpartner vor Ort" Margin="10" />
                        <TextBox Grid.Column="1" Grid.Row="3" Text="{Binding ProjectDataService.CurrentProject.ContactEmail,Mode=TwoWay}" material:TextFieldAssist.Hint="Kontaktemail" Margin="10" />
                        <ComboBox Grid.Column="0" Grid.Row="4" Margin="10" SelectedItem="{Binding ProjectDataService.CurrentProject.ProjectStatus,Mode=TwoWay}" material:TextFieldAssist.Hint="Projektstand">
                            <ComboBoxItem Content="Abgenommen" />
                            <ComboBoxItem Content="Eingebaut" />
                        </ComboBox>
                    </Grid>                        
                </StackPanel>
            </Expander>
    </StackPanel>
</ScrollViewer>

我发现,它是MaterialDesign框架,它打破了滚动。要启用我需要的框架

<ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>

            <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Indigo.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Indigo.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>

进入application.ressources。

第二行打破了滚动

1 个答案:

答案 0 :(得分:0)

我有同样的问题。这是材料设计小技巧中的错误:https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/issues/1395

在materialdesignthemes 3.0的当前预览中已修复。在nuget管理器中选中“包括预发行版本”,以便能够为此nuget软件包选择预览版本。