I am developing an UWP app. I used a ProgressRing as below code:
<ListViewItem Template="{ThemeResource SeetingsListItemContentThemeStyle}"
BorderBrush="{ThemeResource SettingsListItemBorderThemeColor}"
BorderThickness="0,0,0,1"
AutomationProperties.SizeOfSet="0"
AutomationProperties.Name="{Binding SettingsAutomationText, Mode=OneWay}">
<ProgressRing VerticalAlignment="Center"
Margin="18, 0, 0, 14"
Height="21"
Width="21"
IsActive="True"
Foreground="Red"
Visibility="Visible"/>
</ListViewItem>
"SeetingsListItemContentThemeStyle" is as below:
For Light Theme:
<ControlTemplate x:Key="SeetingsListItemContentThemeStyle" TargetType="ListViewItem">
<ListViewItemPresenter x:Name="Root"
CheckBrush="{ThemeResource ListViewItemCheckBrush}"
ContentMargin="{TemplateBinding Padding}"
CheckBoxBrush="{ThemeResource ListViewItemCheckBoxBrush}"
CheckMode="{ThemeResource ListViewItemCheckMode}"
FocusBorderBrush="{ThemeResource ListViewItemFocusBorderBrush}"
FocusSecondaryBorderBrush="{ThemeResource ListViewItemFocusSecondaryBorderBrush}"
HorizontalContentAlignment="Left"
Control.IsTemplateFocusTarget="False"
PressedBackground="#12000000"
PlaceholderBackground="{ThemeResource ListViewItemPlaceholderBackground}"
PointerOverBackground="#08000000"
SelectionCheckMarkVisualEnabled="{ThemeResource ListViewItemSelectionCheckMarkVisualEnabled}"
SelectedPressedBackground="#12000000"
SelectedPointerOverBackground="#08000000"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
</ListViewItemPresenter>
</ControlTemplate>
For Dark Theme:
<ControlTemplate x:Key="SeetingsListItemContentThemeStyle" TargetType="ListViewItem">
<ListViewItemPresenter x:Name="Root"
CheckBrush="{ThemeResource ListViewItemCheckBrush}"
ContentMargin="{TemplateBinding Padding}"
CheckBoxBrush="{ThemeResource ListViewItemCheckBoxBrush}"
CheckMode="{ThemeResource ListViewItemCheckMode}"
FocusBorderBrush="{ThemeResource ListViewItemFocusBorderBrush}"
FocusSecondaryBorderBrush="{ThemeResource ListViewItemFocusSecondaryBorderBrush}"
HorizontalContentAlignment="Left"
Control.IsTemplateFocusTarget="False"
PressedBackground="#12ffffff"
PlaceholderBackground="{ThemeResource ListViewItemPlaceholderBackground}"
PointerOverBackground="#08ffffff"
SelectionCheckMarkVisualEnabled="{ThemeResource ListViewItemSelectionCheckMarkVisualEnabled}"
SelectedPressedBackground="#12ffffff"
SelectedPointerOverBackground="#08ffffff"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
</ListViewItemPresenter>
</ControlTemplate>
The progress ring is showing correctly when the parent page loads. But it is not showing when I change theme from System. Once this issue occurs, Progress Ring not shows for Light-Dark both themes. If I go back to some other pages and come back to this page again, this time progress ring shows correctly.
Can anyone please help me to work Progress Ring correctly after theme change in app runtime?