public FrmCafedaManha() { InitializeComponent(); int lastid = CafedaManhaViewModel.listar().Count + 1; cafedamanhaR = new CafedaManhaView() { Id_cafedamanha = lastid, Frutafk = 0, Liquidofk = 0, Paofk = 0 }; }
//VALIDAÇÕES protected bool ValidarCafedamanha(CafedaManhaView pobject) { if (App.Current.Actives.R_cafedamanha.Frutafk != 0 && App.Current.Actives.R_cafedamanha.Liquidofk != 0 && App.Current.Actives.R_cafedamanha.Paofk != 0) { App.Current.Actives.bolRefeicoes[0] = true; App.Current.Actives.R_cafedamanha.Id_cafedamanha = CafedaManhaViewModel.listar().Count + 1; return(true); } else { return(false); } }
//FIM EVENTOS IMAGENS /// <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_cafedamanha.Id_cafedamanha != 0) { this.imgFrutas.Source = new BitmapImage(new Uri(AlimentoViewModel.listarFrutas()[App.Current.Actives.R_cafedamanha.Frutafk - 1].Img_source, UriKind.RelativeOrAbsolute)); this.imgcopo.Source = new BitmapImage(new Uri(AlimentoViewModel.listarCopos()[App.Current.Actives.R_cafedamanha.Liquidofk - 1].Img_source, UriKind.RelativeOrAbsolute)); this.imgCafePaesCereais.Source = AlimentoViewModel.listarPaes()[App.Current.Actives.R_cafedamanha.Paofk - 1].ImgConvertedSource(); cafedamanhaR = App.Current.Actives.R_cafedamanha; } }