First post, first-time .NET developer trying to slog my way through a project. Hoping someone can help me out!
I have a ListBox that displays a collection of Clip objects called Contents:
<ListBox ItemsSource="{Binding Contents}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Name}" />
<TextBlock Text="{Binding Status}" />
<ProgressBar Value="{Binding DownloadProgress}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
The Status property in the Clip object is an enum with possible values of Remote, Local, or Downloading. These values implement INotifyPropertyChanged and will change during runtime. I need to be able to make changes dynamically to the template
based on the value of Status - for example, making the ProgressBar visible only when Status is "Downloading".
In trying desperately to search for an answer, it seems that DataTriggers used to be a way of doing it - now it sounds like VisualStateManager has taken over that functionality. But neither seems exactly like they were made for this task (i.e. I don't really
need to animate anything... is VSM still applicable?).
Am I at least headed in the right direction?
Thanks so much!!