public FrmJanta() { InitializeComponent(); int lastid = JantaViewModel.listar().Count + 1; jantarR = new JantaView() { Id_janta = lastid, Frutafk = 0, Liquidofk = 0, GraoIntegralfk = 0, Proteinafk = 0, Vegetalfk = 0 }; }
//FIM EVENTOS IMAGENS /// <summary> /// Chamado quando este forme é instanciado; /// </summary> /// <param name="e"></param> protected override void OnNavigatedTo(NavigationEventArgs e) { if (App.Current.Actives.ActiveImagem != null) { thisImagem.Source = new BitmapImage(new Uri(App.Current.Actives.ActiveImagem, UriKind.RelativeOrAbsolute)); App.Current.Actives.ActiveImagem = null; } if (App.Current.Actives.R_jantar.Id_janta != 0) { this.imgJantaFrutas.Source = new BitmapImage(new Uri(AlimentoViewModel.listarFrutas()[App.Current.Actives.R_jantar.Frutafk - 1].Img_source, UriKind.RelativeOrAbsolute)); this.imgcopo.Source = new BitmapImage(new Uri(AlimentoViewModel.listarCopos()[App.Current.Actives.R_jantar.Liquidofk - 1].Img_source, UriKind.RelativeOrAbsolute)); this.imgJantaVegetais.Source = new BitmapImage(new Uri(AlimentoViewModel.listarvegetal()[App.Current.Actives.R_jantar.Vegetalfk - 1].Img_source, UriKind.RelativeOrAbsolute)); this.imgJantaProteinas.Source = new BitmapImage(new Uri(AlimentoViewModel.listarProteinas()[App.Current.Actives.R_jantar.Proteinafk - 1].Img_source, UriKind.RelativeOrAbsolute)); this.imgJantaGraos.Source = new BitmapImage(new Uri(AlimentoViewModel.listarGraoIntegral()[App.Current.Actives.R_jantar.GraoIntegralfk - 1].Img_source, UriKind.RelativeOrAbsolute)); jantarR = App.Current.Actives.R_jantar; } }