Hello,
Welcome to Microsoft Q&A!
Update:
If you are add the ListViewItem manually in the Xaml and you want to set the color for all the ListViewItem, you just need to change the ItemContainerStyle of the ListView. Set a new value to the Foreground property.
<ListView x:Name="MyListView">
<!-- <ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Foreground" Value="Red" />
</Style>
</ListView.ItemContainerStyle> -->
<ListViewItem>Julia</ListViewItem>
<ListViewItem>Anna</ListViewItem>
<ListViewItem>Anna</ListViewItem>
<ListViewItem>Anna</ListViewItem>
</ListView>
------------------------------------------------------------------------------------
I'm trying to get a grasp of XAML but all default color of each attribute I place in the form is white.
I noticed that you are setting the ItemDataplate for the ListView and setting the ListViewItem manually at the same time. This will lead to a conflict. In the end, the ListView shows the ListViewItem that you explicitly set. This is the reason for the behavior that you are getting.
You could remove the ListViewItem objects and give the ListView a source to show the item which uses the DataTemplate that you defined.
I try to change the Foreground of the `ListView' but I need to do set up the color of each item separately I think there must be a easier way
If you set the ListViewItem manually, then you will need to add the Foreground for each of them manually as well.
I'd suggest that you could use Data-binding to show the item content and define different colors for the TextBlock.
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our [documentation][2] to enable e-mail notifications if you want to receive the related email notification for this thread. [2]: https://learn.microsoft.com/en-us/answers/articles/67444/email-notifications.html