I am working on a UWP app that has data bound in a ListView. I have been trying to find a way to collapse (hide) a control when there is no data. For example, i made a simple version of what i am doing:
<ListView Name="lvwMaster" ItemsSource="{x:Bind CollectionOfPeople}">
<ListView.ItemTemplate>
<DataTemplate x:DataType="data:Person">
<StackPanel Name="pnlOnePerson" Margin="10">
<TextBlock Name="lblFirstName" Text="{x:Bind FirstName}" />
<TextBlock Name="lblMiddleName" Text="{x:Bind MiddleName}" Height="Auto" />
<TextBlock Name="lblLastName" Text="{x:Bind LastName}" />
<TextBlock Name="lblBirthDate" Text="{x:Bind BirthDate}" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Since not everyone has a middle name, i want the middle name field to be hidden when it is empty.
Any suggestions on how i might be able to hide the middle name field when the person doesn't have a middle name?