preview sound by clicking help button next to dropdown

This commit is contained in:
John Colvin committed 2018-08-16 11:57:40 -04:00
1 parent 0afeca4f38
commit dedccf7098
2 files changed
+7 -1

No files matched your search

@@ -33,6 +33,8 @@
<Button
Grid.Column="1"
Margin="2,0,0,0"
Command="{x:Static c:SoundAnimationView.PreviewSoundCommand}"
CommandParameter="{Binding value}"
Style="{StaticResource HelpButtonBaseStyle}"
>
<Button.CommandBindings>
@@ -8,6 +8,7 @@ using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
namespace mbts.ui.controls {
/// <summary>
@@ -36,6 +37,9 @@ namespace mbts.ui.controls {
set => SetValue(BusProperty, value);
}
public static ICommand PreviewSoundCommand =>
new DelegateCommand<SoundNotification.SystemSound>(s => NAudioPlayer.create(s).play());
#region SoundTypes
public static readonly DependencyProperty SoundTypesProperty =
WPFHelper.create_dp<IEnumerable<SoundNotification.SoundTypeOneofCase>, SoundAnimationView>(
@@ -83,7 +87,7 @@ namespace mbts.ui.controls {
} else sb.Append(la.link);
}
if (append_click_hint) {
string click_hint = "Ctrl + Click to copy to clipboard";
string click_hint = "Click to play, Ctrl+Click to copy to clipboard";
// TODO: fix the OpenUriCommand, for now, the user may copy the link to clipboard and open it that way.
//if (!string.IsNullOrEmpty(la.link)) {
// click_hint += ", Alt + Click to go to link";