C
C#2y ago
sirruggie

✅ C# Bold Text

I'm trying to make Address: Bold, but I'm having issues with it and it's displaying <b> </b> as text. This is in WinUI 3
private void locInfo_Click(object sender, RoutedEventArgs e)
{
var selectedItem = (Location)MainList.SelectedItem;
if (selectedItem != null)
{
DialogHelper dialogHelper = new DialogHelper();

var Title = "Location Information";
var Address = string.Format("<b>Address:</b> {0}", selectedItem.LocationInformation.AddressInfo.FullAddress);
var Phone = string.Format("Phone: {0}", selectedItem.LocationInformation.PhoneNumber);
var Fax = string.Format("Fax: {0}", selectedItem.LocationInformation.FaxNumber);
var Content = string.Format("{0}\n\n{1}\n{2}", Address, Phone, Fax);

dialogHelper.DisplayDialog(Title, Content, "Ok");
}
}
private void locInfo_Click(object sender, RoutedEventArgs e)
{
var selectedItem = (Location)MainList.SelectedItem;
if (selectedItem != null)
{
DialogHelper dialogHelper = new DialogHelper();

var Title = "Location Information";
var Address = string.Format("<b>Address:</b> {0}", selectedItem.LocationInformation.AddressInfo.FullAddress);
var Phone = string.Format("Phone: {0}", selectedItem.LocationInformation.PhoneNumber);
var Fax = string.Format("Fax: {0}", selectedItem.LocationInformation.FaxNumber);
var Content = string.Format("{0}\n\n{1}\n{2}", Address, Phone, Fax);

dialogHelper.DisplayDialog(Title, Content, "Ok");
}
}
2 Replies
Angius
Angius2y ago
That's because <b> is HTML
sirruggie
sirruggie2y ago
got it ok, will update with a textblock