public FrmLanchedaNoite() { InitializeComponent(); int lastid = LanchedaNoiteViewModel.listar().Count + 1; lanchenoiteR = new LanchedaNoiteView() { Id_lanchedanoite = lastid, Frutafk = 0, Liquidofk = 0, Paofk = 0 }; }
//VALIDAÇÕES protected bool ValidarLanchedanoite(LanchedaNoiteView pobject) { if (App.Current.Actives.R_lanchenoite.Frutafk != 0 && App.Current.Actives.R_lanchenoite.Liquidofk != 0 && App.Current.Actives.R_lanchenoite.Paofk != 0) { App.Current.Actives.bolRefeicoes[5] = true; App.Current.Actives.R_lanchenoite.Id_lanchedanoite = LanchedaNoiteViewModel.listar().Count + 1; return(true); } else { return(false); } }
/// <summary> /// /// </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_lanchenoite.Id_lanchedanoite != 0) { this.imgLANCHEFrutas.Source = new BitmapImage(new Uri(AlimentoViewModel.listarFrutas()[App.Current.Actives.R_lanchenoite.Frutafk - 1].Img_source, UriKind.RelativeOrAbsolute)); this.imgcopo.Source = new BitmapImage(new Uri(AlimentoViewModel.listarCopos()[App.Current.Actives.R_lanchenoite.Liquidofk - 1].Img_source, UriKind.RelativeOrAbsolute)); this.imgLANCHEPaesCereais.Source = new BitmapImage(new Uri(AlimentoViewModel.listarPaes()[App.Current.Actives.R_lanchenoite.Paofk - 1].Img_source, UriKind.RelativeOrAbsolute)); lanchenoiteR = App.Current.Actives.R_lanchenoite; } }