I want to be able to display hyperlink if the Url is not null, otherwise I do not wish to display the link.
How shall i go about this? Here is my code so far. Example of my list box template:
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Background="#CD85C9E9"
Name="spListItem"
Orientation="Horizontal"
HorizontalAlignment="Stretch">
<Label>
<TextBlock Text="{Binding Name}" />
<!-- How to define if Url Is Null -->
<Hyperlink Name="MyLink" Click="MyLink_Click" />
</Label>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
My Class:
public class MyList
{
public string Name{get;set;}
public string? Url{get;set;}
}