I'm working on a WPF app with a colleague at work. This app has a launch panel with 7 buttons. Clicking on any of the 7 buttons causes a new window to popup. These new windows all start with a datagrid, listing the contents of 1 of 7 tables, corresponding to the 7 buttons, etc.
The datagrid is actually a customized user control, that a third colleague wrote and which is being used in several other WPF applications. We have not modified it in this application. This customized user control is on the first tab of a tab control.
I'm responsible for one of those sub-windows that pops up when a user clicks on one of those buttons. The weird thing is that when a user clicks on one of the rows in the datagrid, the window flashes. And that's the thing that's really bugging me. I cannot figure out why it's flashing. And only this one window flashes, the other 6 don't. WHY??
Here's the XAML in my window, using the custom datagrid control:
<uc:CoreSummaryControl
x:Name="TheCoreSummaryControl"
Grid.Row="1"
CenterAlignedColumns="{StaticResource CenterAlignedFields}"
CenterAlignedHeaders="{StaticResource CenterAlignedHeaders}"
ExtraFields="{StaticResource ExtraFields}"
Fields="{Binding TableFields}"
LeftAlignedColumns="{StaticResource LeftAlignedFields}"
LeftAlignedHeaders="{StaticResource LeftAlignedHeaders}"
OmittedFields="{StaticResource OmittedFields}"
RightAlignedColumns="{StaticResource RightAlignedFields}"
RightAlignedHeaders="{StaticResource RightAlignedHeaders}"
ShowDateTimesHasDates="True" />
That XAML is identical to the other 6 windows' XAML.
Like I said, my colleague and I haven't changed the code of the CoreSummaryControl at all. I could, if you want, produce it here, but I don't see how it pertains, especially since the other 6 windows use the same control and even the same XAML to use that control. But it's that control that, when clicked on, causes my window to flash.
I believe that whatever the issue is, its related somehow to that CoreSummaryControl. But I will mention one other thing, which seems like it affects the flashing, but isn't related to CoreSummaryControl. The declaration of the tab control, on all 6 windows, includes this XAML:
<TabControl x:Name="ViewPort" Grid.Row="1"
Margin="0,0,0,0"
Background="Transparent"
BorderThickness="0"
SelectedIndex="{Binding ViewIndex, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, IsAsync=True}"
SelectionChanged="ViewPort_SelectionChanged">
I want to draw your attention to the IsAsync=True attribute that's a part of the SelectedIndex. Out of curiosity, I removed that from my window. Once I did that, it appeared to have stopped the flashing. But WHY would it do that? And why only to my window?