Remote playback almost working

This commit is contained in:
watsonb8
2019-11-03 23:17:34 -05:00
parent a13e491a7e
commit a537edd657
14 changed files with 296 additions and 136 deletions

View File

@ -12,6 +12,10 @@
HeaderHeight="40"
BorderColor="#CCCCCC"
HeaderBackground="#E0E6F8">
<dg:DataGrid.GestureRecognizers>
<TapGestureRecognizer
NumberOfTapsRequired="2"/>
</dg:DataGrid.GestureRecognizers>
<dg:DataGrid.HeaderFontSize>
<OnIdiom
x:TypeArguments="x:Double">

View File

@ -12,6 +12,10 @@ namespace Aurora.Design.Components.Queue
public Queue()
{
InitializeComponent();
this.QueueDataGrid.ItemSelected += (sender, e) =>
{
this.SelectedItem = e.SelectedItem;
};
}
#region ItemsSource Property
@ -69,8 +73,7 @@ namespace Aurora.Design.Components.Queue
BindableProperty.Create(propertyName: "SelectedItem",
returnType: typeof(object),
declaringType: typeof(Queue),
defaultBindingMode: BindingMode.TwoWay,
propertyChanged: OnSelectedItemChanged);
defaultBindingMode: BindingMode.TwoWay);
/// <summary>
/// Backing property for the SelectedItem property.
@ -88,22 +91,58 @@ namespace Aurora.Design.Components.Queue
}
}
/// <summary>
/// Handles selection change events.
/// Bindable property for the item double clicked command
/// </summary>
/// <param name="bindable">The bindable object.</param>
/// <param name=""SelectedItem""></param>
/// <param name="typeof(BaseMetadata"></param>
/// <returns></returns>
public static readonly BindableProperty ItemDoubleClickedProperty =
BindableProperty.Create(propertyName: "ItemDoubleClicked",
returnType: typeof(Command),
declaringType: typeof(Queue),
propertyChanged: OnDoubleClickPropertyChanged);
/// <summary>
/// Public backing property
/// </summary>
/// <value></value>
public Command ItemDoubleClicked
{
get
{
return (Command)GetValue(ItemDoubleClickedProperty);
}
set
{
SetValue(ItemDoubleClickedProperty, value);
}
}
/// <summary>
/// Event handler for double click property. Adds command execute handler.
/// </summary>
/// <param name="bindable"></param>
/// <param name="newValue"></param>
/// <param name="oldValue"></param>
private static void OnSelectedItemChanged(BindableObject bindable, object newValue, object oldValue)
private static void OnDoubleClickPropertyChanged(BindableObject bindable, object newValue, object oldValue)
{
Queue control = bindable as Queue;
var queueDataGrid = control.FindByName("QueueDataGrid") as DataGrid;
IEnumerable<object> source = (IEnumerable<object>)queueDataGrid.ItemsSource;
if (source.Contains(newValue))
if (queueDataGrid.GestureRecognizers.Count > 0)
{
queueDataGrid.SelectedItem = newValue;
}
var gestureRecognizer = queueDataGrid.GestureRecognizers.First();
if (gestureRecognizer is TapGestureRecognizer)
{
TapGestureRecognizer tap = gestureRecognizer as TapGestureRecognizer;
tap.Tapped += (sender, e) =>
{
control.ItemDoubleClicked.Execute(null);
};
}
}
}
}
}