2012-08-14 2 views
0

ListBoxDragDropTarget을 사용하여 작업하고 있는데 N 항목을 드래그 할 때 ListBox에 바인딩 된 ObservableCollection이 항목 순서를 변경하지 않습니다.SilverLight ListBoxDragDropTarget order 변경되지 않음

<controlsToolkit:ListBoxDragDropTarget AllowDrop="True" 
               Grid.Row="1" 
               HorizontalContentAlignment="Stretch"    
               VerticalAlignment="Top" 
               Margin="0,10,8,10" 
               ItemDragCompleted="ListBoxDragDropTarget_ItemDragCompleted_1" 
               BorderThickness="0"> 
        <ListBox x:Name="servicesListBox" ItemsSource="{Binding ServiceCollection}" 
          ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
          SelectionChanged="servicesListBox_SelectionChanged_1" 
          SelectedItem="{Binding SelectedService, Mode=TwoWay}" 
          Margin="0,102,0,0" Background="#FF040404" 
          SelectionMode="Extended" 
          Foreground="White" Width="800" HorizontalAlignment="Center" BorderBrush="#FF040404" Height="340" VerticalAlignment="Top" > 
         <ListBox.ItemsPanel> 
          <ItemsPanelTemplate> 
          <controlsToolkit:WrapPanel /> 
          </ItemsPanelTemplate> 
         </ListBox.ItemsPanel> 
         <ListBox.ItemTemplate> 
          <DataTemplate> 
          <StackPanel Width="250" Margin="4" Orientation="Horizontal">          
            <TextBlock Text="{Binding Title}" Foreground="{Binding IsDesactivated, Converter={StaticResource OnlineColorConverter}}" 
              HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2,0,0,0" Width="190" /> 
          </StackPanel> 
          </DataTemplate> 
         </ListBox.ItemTemplate> 
        </ListBox> 
      </controlsToolkit:ListBoxDragDropTarget> 

답변

0

ObservableCollection의 항목이 이기종 일 수 있습니다. 이것은 Polymorphism을 사용할 때, 예를 들어 ObservableCollection을 가지고 있지만 실제로 MyClass 유형의 요소를 보유하고있는 경우에 발생합니다. 이것은 ListBoxDragDropTarget의 버그이지만이 컨트롤은 "실험적"품질 밴드입니다.

두 가지 가능한 해결 :

관련 문제