在DragDrop WPF期间阻止SelectionChanged事件

时间:2016-03-17 11:16:36

标签: c# wpf xaml mvvm telerik

我使用WPF控件使用MVVM模式处理Telerik个应用程序。

功能

我正在使用telerik:RadListBox,在运行时绑定集合。我可以重新命名RadListBox中的项目。

问题:

DragDrop事件发生后RadListBox事件DragLeave内的SelectionChanged<telerik:RadListBox x:Name="lstMarketSeries" ItemsSource="{Binding MarketSeriesCollection, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True, ValidatesOnDataErrors=True}" ItemContainerStyle="{StaticResource DraggableListBoxItem}" DragLeave="lstMarketSeries_DragLeave" SelectionMode="Extended" telerik:StyleManager.Theme="Windows8" SelectionChanged="MarketSeriesCommit_SelectionChanged"> </telerik:RadListBox> 事件被触发时。

XAML:

private void MarketSeriesCommit_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {

 }

private void lstMarketSeries_DragLeave(object sender, DragEventArgs e)
 {        

 }

XAML.cs:

DragLeave

有什么方法可以限制在<script> function test(){ $(".addthis_follow_label").text(function(index, text) { return text.replace("Facebook", ""); }); $(".addthis_follow_label").text(function(index, text) { return text.replace("Twitter", ""); }); $(".addthis_follow_label").text(function(index, text) { return text.replace("Google Follow", ""); }); $('.addthis_toolbox.addthis_vertical_style').css('width', '32px'); addthis.layers.refresh(); }; window.onload=test; </script> 事件后触发的SelectionChanged事件?

1 个答案:

答案 0 :(得分:0)

我不认为这是一个好主意,以防止选择事件hadler开火。但是你可以尝试添加标志IsInDrag(boolean)并在darag / drop操作期间管理它(开始拖动时为true,当你输入最终选择更改的处理程序时为false),此外当你输入SelectionChanged事件处理程序和标志时是的,你设置为false并保留处理程序(此外,你可以将SelectionChangedEventArgs的handle属性设置为true)。

问候。