I have the following situation, where I have a Combobox1 and then I have TextBlock (ImportantText) in XAML. What I'm trying to do, is to trigger TextBlock's EventTrigger, and thus the Storyboard when user changes the Combobox's selection. I would like to do this in the xaml-side only.
Any suggestions?
<ComboBox Name="Combobox1" Grid.Column="1" Grid.Row="0" Margin="0,-5,0,0" ItemsSource="{Binding Stuff}"
SelectedItem="{Binding SelectedStuff}" ></ComboBox>
<TextBlock Name="ImportantText" Grid.Column="1" Grid.Row="1" Text="This text should appear after user changes the combobox's selection!" TextWrapping="Wrap">
<EventTrigger RoutedEvent=" I'm not sure how to reference Combobox1 here! " ></EventTrigger>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="ImportantText" Storyboard.TargetProperty="Opacity" AutoReverse="False" From="0.0" To="1.0" Duration="0:0:5"></DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</TextBlock>
SourceNameproperty to refer to the combobox. learn.microsoft.com/en-us/dotnet/api/…