I've added a fairly simple control to an existing WPF application. The control launches in its own window and uses a combo box to allow the user to build up an editable list. As selections are added to the list, they appear in the list accompanied by a delete button. The XAML for the list is:
<StackPanel Grid.Row="2">
<ItemsControl Name="icSelected" ItemsSource="{Binding Path=SelectedUsers, RelativeSource={RelativeSource FindAncestor, AncestorType=my:Recipients, AncestorLevel=1}}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Label Name="lblRecipient" Content="{Binding Path=DisplayName}" Width="150"/>
<Button Name="btnRemove" HorizontalAlignment="Right" Click="btnRemove_Click">
<Image Source="Resources/delete.png"/>
</Button>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
This was all running perfectly well until I deployed it. Running the deployed version from a VDI session, it takes the best part of a minute for an item to be added to the list. Task Manager shows the window as being unresponsive but doesn't indicate any unusual activity - System Idle remains at around 99%. SQL Profiler confirms that there is no database activity occurring during the delay and Snoop doesn't indicate any unexpected events.
If I run the same binary from my local machine, however, everything is fine.
The application (a monumental pile of junk) otherwise runs equally happily on VDI or a physical machine.
On further investigation, the bottleneck only seems to occur if the button is being used - i.e. if I remove the button altogether, everything runs at a reasonable speed.
What I have tried:
I've tried removing the image from the button and I've tried removing the click event handler but neither has had any effect.
I've tried nullifying style settings, also to no avail.