Пример #1
0
        private async void FabricantesForm_Load(object sender, EventArgs e)
        {
            var fabricantes = await consultaDeFabricantes.ObtemObservavelDeFabricantes();

            var list = fabricantes.Select(p => FabricanteViewModel.From(p)).ToList();

            var bindingList = new FabricantesBindingList(
                cadastroDeFabricantes,
                list
                );

            fabricantesBindingSource.DataSource = bindingList;

            bindingList.StatusChanged += SetStatusBar;

            //

            componentesBindingSource.DataSource = await consultaDeComponentes.ParaDropdown();
        }
Пример #2
0
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var fabricantes = await consultaDeFabricantes.ObtemObservavelDeFabricantes();

            var list = fabricantes.Select(p => FabricanteViewModel.From(p)).ToList();

            var observableCollection = new FabricantesObservableCollection(
                cadastroDeFabricantes,
                list
                );

            //fabricantesBindingSource.DataSource = bindingList;

            //bindingList.StatusChanged += SetStatusBar;

            //

            //componentesBindingSource.DataSource = await consultaDeComponentes.ParaDropdown();

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

            fabricanteViewModelViewSource.Source = observableCollection;
        }
Пример #3
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            var parameters = e.Parameter as FabricantesPageParameter;

            this.cadastroDeFabricantes = parameters.CadastroDeFabricantes;

            this.consultaDeComponentes = parameters.ConsultaDeComponentes;

            this.consultaDeFabricantes = parameters.ConsultaDeFabricantes;

            //

            var fabricantes = await consultaDeFabricantes.ObtemObservavelDeFabricantes();

            var list = fabricantes.Select(p => FabricanteViewModel.From(p)).ToList();

            var observableCollection = new FabricantesObservableCollection(
                cadastroDeFabricantes,
                list
                );

            Fabricantes = observableCollection;

            //fabricantesBindingSource.DataSource = bindingList;

            //bindingList.StatusChanged += SetStatusBar;

            //

            //componentesBindingSource.DataSource = await consultaDeComponentes.ParaDropdown();

            //CollectionViewSource fabricanteViewModelViewSource = ((CollectionViewSource)(this.FindResource("fabricanteViewModelViewSource")));

            //fabricanteViewModelViewSource.Source = observableCollection;
        }