public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            CompareAirportMVVM airport1 = (CompareAirportMVVM)values[0];
            CompareAirportMVVM airport2 = (CompareAirportMVVM)values[1];

            double distance = MathHelpers.GetDistance(airport1.Airport, airport2.Airport);

            return(new DistanceToUnitConverter().Convert(distance));
        }
        private void cbAirport_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            CompareAirportMVVM airport = cbAirport.SelectedItem as CompareAirportMVVM;

            this.SelectedAirport = airport;

            var tAirports = new List <CompareAirportMVVM>(this.CompareAirports);

            foreach (CompareAirportMVVM a in tAirports)
            {
                this.CompareAirports.Remove(a);
            }

            foreach (CompareAirportMVVM a in this.Airports.Where(_ => _ != this.SelectedAirport))
            {
                this.CompareAirports.Add(a);
            }
        }
        private void cbAirport_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            CompareAirportMVVM airport = cbAirport.SelectedItem as CompareAirportMVVM;
            this.SelectedAirport = airport;

            var tAirports = new List<CompareAirportMVVM>(this.CompareAirports);

            foreach (CompareAirportMVVM a in tAirports)
                this.CompareAirports.Remove(a);

            foreach (CompareAirportMVVM a in this.Airports.Where(_ => _ != this.SelectedAirport))
                this.CompareAirports.Add(a);
        }