audio when user controls appear / disappear
We've been using the audio hooks on buttons, but we'd like to integrate audio better into our app and aren't sure how to do it.
We'd like trigger audio when a user control / screen appears and when a user control / screen disappears. Is there a best practice / best way to do this?
I saw this thread: viewtopic.php?p=16824 and tried to see if I could do something similar for visibility changing to collapse or to visibile..
Is there an EventTrigger I can wire up to handle this? I noticed on https://www.noesisengine.com/docs/Gui.C ... tml#events that there is an IsVisibleChanged event, but I'm not sure how to test against the new visibility value here for this event.
Suggestions on how to accomplish this? Maybe there is a completely separate way that would be best to do this?
thanks,
sam
We'd like trigger audio when a user control / screen appears and when a user control / screen disappears. Is there a best practice / best way to do this?
I saw this thread: viewtopic.php?p=16824 and tried to see if I could do something similar for visibility changing to collapse or to visibile..
Is there an EventTrigger I can wire up to handle this? I noticed on https://www.noesisengine.com/docs/Gui.C ... tml#events that there is an IsVisibleChanged event, but I'm not sure how to test against the new visibility value here for this event.
Suggestions on how to accomplish this? Maybe there is a completely separate way that would be best to do this?
thanks,
sam
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: audio when user controls appear / disappear
If you need to do different actions when IsVisible is true vs when it is false you should use a DataTrigger instead of an EventTrigger:
Is this what you're looking for?
Code: Select all
<Grid x:Name="LayoutRoot">
<b:Interaction.Triggers>
<b:DataTrigger Binding="{Binding IsVisible, ElementName=LayoutRoot}" Value="True">
<audio:AudioAction .../>
</b:DataTrigger>
<b:DataTrigger Binding="{Binding IsVisible, ElementName=LayoutRoot}" Value="False">
<audio:AudioAction .../>
</b:DataTrigger>
</b:Interaction.Triggers>
...
</Grid>Re: audio when user controls appear / disappear
This looks great! let me give this a shot!
thanks,
sam
thanks,
sam
Who is online
Users browsing this forum: No registered users and 9 guests