46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
using Plane.Copters;
|
|
using Plane.FormationCreator.Formation;
|
|
using Plane.FormationCreator.ViewModels;
|
|
using Microsoft.Practices.ServiceLocation;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
|
|
namespace Plane.FormationCreator.Views
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for CopterListView.xaml
|
|
/// </summary>
|
|
public partial class CopterListView : UserControl
|
|
{
|
|
public CopterListView()
|
|
{
|
|
InitializeComponent();
|
|
|
|
this.DataContext = ServiceLocator.Current.GetInstance<CopterListViewModel>();
|
|
|
|
_copterManager.SetSelectionDelegates(
|
|
() => lvwDrones.SelectedItems,
|
|
copter => lvwDrones.SelectedItem = copter
|
|
);
|
|
lvwDrones.SelectionChanged += (sender, e) =>
|
|
{
|
|
_copterManager.RaiseSelectedCoptersChanged(e.AddedItems.Cast<ICopter>(), e.RemovedItems.Cast<ICopter>());
|
|
};
|
|
}
|
|
|
|
private CopterManager _copterManager = ServiceLocator.Current.GetInstance<CopterManager>();
|
|
}
|
|
}
|