激活滚动时,停用ScrollViewer中的按钮

时间:2014-12-11 12:46:54

标签: c# wpf xaml scroll touch

我的问题如下。当我滚动时,如果我的手指触摸按钮,则会调用该命令。如果用户滚动和反过来,MVVM架构的最佳方法是如何停止此操作并停用按钮。

<ScrollViewer  PanningMode="Both" PanningDeceleration="0.001" PanningRatio="2">
        <Grid>
            <ItemsControl  ItemsSource="{Binding ListGstDescriptors}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Vertical"/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>

                        <Button  Command="{StaticResource ChangeSavedViewCommand}"
                                CommandParameter="{Binding GstDescriptorAcDescriptor}"/>

                    </DataTemplate>
                </ItemsControl.ItemTemplate>

            </ItemsControl>
        </Grid>
</ScrollViewer>    

1 个答案:

答案 0 :(得分:0)

将滚动移动This Link时,将CanExecute的行为设置为false可以帮助您更好地理解命令

相关问题