У меня есть DataGrid, показывающий работу, как это:ToggleButton переключен на коллекции обновления
Теперь я получил некоторые BackgroundTasks
периодически обновлять данные.
При обновлении первая строка автоматически переключается.
Я не могу понять, почему ...
Это мой xaml
:
<DataGrid Grid.Row="1"
ItemsSource="{Binding Path=JobCollectionView}"
SelectedItem="{Binding Path=SelectedEntry,
UpdateSourceTrigger=PropertyChanged,
Mode=TwoWay}"
IsReadOnly="True"
x:Name="dataGrid"
AutoGenerateColumns="False"
CanUserAddRows="False"
SelectionUnit="FullRow"
SelectionMode="Single"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
CanUserResizeColumns="True"
VerticalContentAlignment="Center">
[...]>
<DataGridTemplateColumn CellStyle="{StaticResource DataGridNonFocusableCell}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ToggleButton IsChecked="{Binding RelativeSource={RelativeSource AncestorType=DataGridRow},
Path=DetailsVisibility,
Converter={StaticResource BoolToVisConverter},
Mode=TwoWay,
FallbackValue=False}"
Height="20"
Width="20" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
[...]/>