mirror of
https://github.com/BubbaGumpShrump/AutoTrackR2.git
synced 2025-06-28 07:36:39 +00:00
Update HomePage.xaml.cs
Implement fallback for profile image URL when primary URL is empty
This commit is contained in:
parent
a92dbdfef1
commit
32935de85c
1 changed files with 5 additions and 3 deletions
|
@ -231,9 +231,10 @@ namespace AutoTrackR2
|
||||||
killGrid.Children.Add(killTextBlock);
|
killGrid.Children.Add(killTextBlock);
|
||||||
|
|
||||||
// Create the Image for the profile
|
// Create the Image for the profile
|
||||||
|
string urlToUse = string.IsNullOrEmpty(killParts[7]) ? "https://cdn.robertsspaceindustries.com/static/images/account/avatar_default_big.jpg" : killParts[7];
|
||||||
var profileImage = new Image
|
var profileImage = new Image
|
||||||
{
|
{
|
||||||
Source = new BitmapImage(new Uri(killParts[7])), // Assuming the 8th part contains the profile image URL
|
Source = new BitmapImage(new Uri(urlToUse)), // Assuming the 8th part contains the profile image URL
|
||||||
Width = 90,
|
Width = 90,
|
||||||
Height = 90,
|
Height = 90,
|
||||||
Stretch = Stretch.Fill, // Adjust how the image fits
|
Stretch = Stretch.Fill, // Adjust how the image fits
|
||||||
|
@ -357,9 +358,10 @@ namespace AutoTrackR2
|
||||||
killGrid.Children.Add(killTextBlock);
|
killGrid.Children.Add(killTextBlock);
|
||||||
|
|
||||||
// Create the Image for the profile
|
// Create the Image for the profile
|
||||||
|
string urlToUse = string.IsNullOrEmpty(killParts[7]) ? "https://cdn.robertsspaceindustries.com/static/images/account/avatar_default_big.jpg" : killParts[7];
|
||||||
var profileImage = new Image
|
var profileImage = new Image
|
||||||
{
|
{
|
||||||
Source = new BitmapImage(new Uri(killParts[7])), // Assuming the 8th part contains the profile image URL
|
Source = new BitmapImage(new Uri(urlToUse)), // Assuming the 8th part contains the profile image URL
|
||||||
Width = 90,
|
Width = 90,
|
||||||
Height = 90,
|
Height = 90,
|
||||||
Stretch = Stretch.Fill, // Adjust how the image fits
|
Stretch = Stretch.Fill, // Adjust how the image fits
|
||||||
|
@ -556,4 +558,4 @@ namespace AutoTrackR2
|
||||||
textBlock.FontSize = fontSize;
|
textBlock.FontSize = fontSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue