//Setting the right icon for each theme private void SetTrayIcon() { var theme = RegistryThemeHelper.GetWindowsTheme(); darkerIcon.IconSource = theme == UITheme.Light ? new BitmapImage(new Uri(@"pack://*****:*****@"pack://application:,,,/Resources/day_w.ico")); }