public static ItemDeConsultaDeModeloViewModel From(Modelo modelo, IEnumerable <Modelo> selecteds)
        {
            var selected = selecteds.Any(p => p.Codigo == modelo.Codigo);

            var viewModel = new ItemDeConsultaDeModeloViewModel
            {
                Selected = selected,
                Modelo   = modelo,
            };

            return(viewModel);
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var solicitacao = new SolicitacaoDeConsultaDeModelos
            {
            };

            var modelos = consultaDeModelos.ConsultaModelos(solicitacao);

            var list = modelos.Select(p => ItemDeConsultaDeModeloViewModel.From(p, selecteds)).ToList();

            CollectionViewSource modelosViewSource = ((CollectionViewSource)(this.FindResource("modelosViewSource")));

            modelosViewSource.Source = list;
        }