Hi @Md. Niaz Mahmud ,
Let me summarize this issue
It is recommended to use Theme Listner to dynamically switch json files, then the UI will change with the theme.
using Microsoft.Toolkit.Uwp.UI.Helpers;
public MainPage()
{
this.InitializeComponent();
var Listener = new ThemeListener();
Listener.ThemeChanged += Listener_ThemeChanged;
}
private void Listener_ThemeChanged(ThemeListener sender)
{
var theme = sender.CurrentTheme;
if (theme == ApplicationTheme.Dark)
{
LottieJsonSource.UriSource = new System.Uri("ms-appx:///Assets/LightBulb.json");
}
else
{
LottieJsonSource.UriSource = new System.Uri("ms-appx:///Assets/LottieLogo1.json");
}
}
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.