I have three Items Control, detailed bellow, currently I have three accompanying Observable collections, one for each control. I want to be able to move one of the objects from one of the group boxes and for it to appear in another. Currently, I am removing it from the original observable collection and then adding it to the new one. This however has lead to threading issues, where the UI doesn't always update the move. Is there any better way of moving around the objects between observable collections. Such as having only one, but changing which are rendered in which control? Any help is appreciated.
XAML:
<GroupBox x:Name="OnTimeGroup">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel>
<ItemsControl x:Name="OnTimeCards">
<ItemsControl.ItemTemplate>
<DataTemplate>
<UserControl:OnTimeCard Visibility="Visible" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
</GroupBox>
<GroupBox x:Name="LateGroup">
<StackPanel>
<ItemsControl x:Name="LateCards">
<ItemsControl.ItemTemplate>
<DataTemplate>
<UserControl:LateActionNeededCard Ignore="LateCardIgnoreClicked" Publish="LateCardPublishClicked" Visibility="Visible" />
</materialDesign:TransitioningContent>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
</GroupBox>
<GroupBox x:Name="PublishedGroup">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel>
<ItemsControl x:Name="PublishedCards">
<ItemsControl.ItemTemplate>
<DataTemplate>
<UserControl:PublishedCard Update="PublishedCardUpdateClicked" Visibility="{Binding IsVisible}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
</GroupBox>
C#
private ObservableCollection<LiveTime> OnTimeCardsCollection = new ObservableCollection<LiveTime>();
private ObservableCollection<LiveTime> LateCardsCollection = new ObservableCollection<LiveTime>();
private ObservableCollection<LiveTime> PublishedCardsCollection = new ObservableCollection<LiveTime>();
Pseudo Code of Current Code
When the user clicks a button on the object, remove it from the current observable collection. Then create a brand new object in the adjoining observable collection.