/// </summary>
public BindableCollectionView()
{
- this.SelectionChanged += BindableCollectionView_SelectionChanged;
}
/// <summary>
collectionView.ItemsSource = itemsSource;
}
}
-
- private void BindableCollectionView_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- List<object> oldSel = new List<object>(e.PreviousSelection);
- List<object> newSel = new List<object>(e.CurrentSelection);
-
- if (oldSel.Count == 1 && newSel.Count == 0 && oldSel[0] != null)
- {
- SelectedItem = oldSel[0];
- }
- }
}
}
<ImageView PositionUsesPivotPoint="true" PivotPoint="1.0,0.0" ParentOrigin="1.0, 0.0" Size="30,30" BindingContext="{Binding Source={x:Reference context}, Path=SelectedWorkout}" ResourceUrl="{Binding Favourite, Converter={Static converters:FavouriteToIconConverter.Converter}}"/>
</View>
</View>
- <ctrl:BindableCollectionView Size="{views:SizeInUnits Height=44}" Margin="{views:ExtentsInUnits Top=10, Bottom=10, Start=16, End=16}" WidthResizePolicy="FillToParent" ItemsSource="{Binding Workouts}" x:Name="scroller" SelectedItem="{Binding Path=SelectedWorkout, Mode=TwoWay}" SelectionMode="SingleSelection">
+ <ctrl:BindableCollectionView Size="{views:SizeInUnits Height=44}" Margin="{views:ExtentsInUnits Top=10, Bottom=10, Start=16, End=16}" WidthResizePolicy="FillToParent" ItemsSource="{Binding Workouts}" x:Name="scroller" SelectedItem="{Binding Path=SelectedWorkout, Mode=TwoWay}" SelectionMode="SingleAlways">
<ctrl:BindableCollectionView.ItemTemplate>
<DataTemplate>
<views:FitnessItemView />