//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_lanchetarde.Id_lanchedatarde != 0)
            {
                this.imgLANCHETardeFrutas.Source = new BitmapImage(new Uri(AlimentoViewModel.listarFrutas()[App.Current.Actives.R_lanchetarde.Frutafk - 1].Img_source, UriKind.RelativeOrAbsolute));
                this.imgcopo.Source = new BitmapImage(new Uri(AlimentoViewModel.listarCopos()[App.Current.Actives.R_lanchetarde.Liquidofk - 1].Img_source, UriKind.RelativeOrAbsolute));
                this.imgLANCHETardePaesCereais.Source = new BitmapImage(new Uri(AlimentoViewModel.listarPaes()[App.Current.Actives.R_lanchetarde.Paofk - 1].Img_source, UriKind.RelativeOrAbsolute));
                lanchetardeR = App.Current.Actives.R_lanchetarde;
            }
        }
        //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;
            }
        }
Beispiel #3
0
 /// <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_almoco.Id_almoco != 0)
     {
         this.imgAlmocoFrutas.Source    = new BitmapImage(new Uri(AlimentoViewModel.listarFrutas()[App.Current.Actives.R_almoco.Frutafk - 1].Img_source, UriKind.RelativeOrAbsolute));
         this.imgcopo.Source            = new BitmapImage(new Uri(AlimentoViewModel.listarCopos()[App.Current.Actives.R_almoco.Liquidofk - 1].Img_source, UriKind.RelativeOrAbsolute));
         this.imgAlmocoVegetais.Source  = new BitmapImage(new Uri(AlimentoViewModel.listarvegetal()[App.Current.Actives.R_almoco.Vegetalfk - 1].Img_source, UriKind.RelativeOrAbsolute));
         this.imgAlmocoProteinas.Source = new BitmapImage(new Uri(AlimentoViewModel.listarProteinas()[App.Current.Actives.R_almoco.Proteinafk - 1].Img_source, UriKind.RelativeOrAbsolute));
         this.imgAlmocoGraos.Source     = new BitmapImage(new Uri(AlimentoViewModel.listarGraoIntegral()[App.Current.Actives.R_almoco.GraoIntegralfk - 1].Img_source, UriKind.RelativeOrAbsolute));
         almocoR = App.Current.Actives.R_almoco;
     }
 }
        private void coposList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            lst = AlimentoViewModel.listarCopos();
            thisApp.Actives.ActiveImagem      = lst[CopoList.SelectedIndex].Img_source;
            thisApp.Actives.IdAlimento_Select = CopoList.SelectedIndex + 1;
            switch (App.Current.Actives.IdRefeicao_Select)
            {
            case 1:
                App.Current.Actives.R_cafedamanha.Liquidofk = CopoList.SelectedIndex + 1;
                break;

            case 2:
                App.Current.Actives.R_lanchedamanha.Liquidofk = CopoList.SelectedIndex + 1;
                break;

            case 3:
                App.Current.Actives.R_almoco.Liquidofk = CopoList.SelectedIndex + 1;
                break;

            case 4:
                App.Current.Actives.R_lanchetarde.Liquidofk = CopoList.SelectedIndex + 1;
                break;

            case 5:
                App.Current.Actives.R_jantar.Liquidofk = CopoList.SelectedIndex + 1;
                break;

            case 6:
                App.Current.Actives.R_lanchenoite.Liquidofk = CopoList.SelectedIndex + 1;
                break;

            default:
                break;
            }
            this.NavigationService.GoBack();
        }
 public FrmCopo()
 {
     InitializeComponent();
     this.CopoList.ItemsSource = AlimentoViewModel.listarCopos();
 }
Beispiel #6
0
        public void trocarNomeHeader()
        {
            #region Verificação do tipo de qual alimento será referenciado
            //Lista de alimentos a exibir;
            List <AlimentoView> lstDados = new List <AlimentoView>();

            switch (App.Current.Actives.IdRefeicao_Select)
            {
            case 1:
                // Nome do cabeçalho:
                this.txtTitulo1.Text = "café da manhã";
                // Recolhando os alimentos que serão exibidos:
                lstDados.Add(
                    AlimentoViewModel.listarFrutas()[
                        CafedaManhaViewModel.listar()[atual.Cafedamanha_fk - 1].Frutafk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarPaes()[
                        CafedaManhaViewModel.listar()[atual.Cafedamanha_fk - 1].Paofk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarCopos()[
                        CafedaManhaViewModel.listar()[atual.Cafedamanha_fk - 1].Liquidofk - 1]);
                break;

            case 2:
                // Nome do cabeçalho:
                this.txtTitulo1.Text = "lanche da manhã";
                // Recolhando os alimentos que serão exibidos:
                lstDados.Add(
                    AlimentoViewModel.listarFrutas()[
                        LanchedaManhaViewModel.listar()[atual.Lanchemanha_fk - 1].Frutafk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarCopos()[
                        LanchedaManhaViewModel.listar()[atual.Lanchemanha_fk - 1].Liquidofk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarPaes()[
                        LanchedaManhaViewModel.listar()[atual.Lanchemanha_fk - 1].Paofk - 1]);
                break;

            case 3:
                // Nome do cabeçalho:
                this.txtTitulo1.Text = "almoço";
                // Recolhando os alimentos que serão exibidos:
                lstDados.Add(
                    AlimentoViewModel.listarCopos() [
                        AlmocoViewModel.listar()[atual.Almoco_fk - 1].Liquidofk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarGraoIntegral()[
                        AlmocoViewModel.listar()[atual.Almoco_fk - 1].GraoIntegralfk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarvegetal()[
                        AlmocoViewModel.listar()[atual.Almoco_fk - 1].Vegetalfk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarFrutas()[
                        AlmocoViewModel.listar()[atual.Almoco_fk - 1].Frutafk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarProteinas()[
                        AlmocoViewModel.listar()[atual.Almoco_fk - 1].Proteinafk - 1]);
                break;

            case 4:
                // Nome do cabeçalho:
                this.txtTitulo1.Text = "lanche da tarde";
                // Exibe as imagens correspondentes no prato e copo:
                lstDados.Add(
                    AlimentoViewModel.listarFrutas()[
                        LanchedaTardeViewModel.listar()[atual.Lanchetarde_fk - 1].Frutafk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarCopos()[
                        LanchedaTardeViewModel.listar()[atual.Lanchetarde_fk - 1].Liquidofk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarPaes()[
                        LanchedaTardeViewModel.listar()[atual.Lanchetarde_fk - 1].Paofk - 1]);
                break;

            case 5:
                // Nome do cabeçalho:
                this.txtTitulo1.Text = "jantar";
                // Exibe as imagens correspondentes no prato e copo:
                lstDados.Add(
                    AlimentoViewModel.listarCopos() [
                        JantaViewModel.listar()[atual.Jantar_fk - 1].Frutafk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarGraoIntegral()[
                        JantaViewModel.listar()[atual.Jantar_fk - 1].GraoIntegralfk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarvegetal()[
                        JantaViewModel.listar()[atual.Jantar_fk - 1].Vegetalfk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarFrutas()[
                        JantaViewModel.listar()[atual.Jantar_fk - 1].Frutafk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarProteinas()[
                        JantaViewModel.listar()[atual.Jantar_fk - 1].Proteinafk - 1]);
                break;

            case 6:
                // Nome do cabeçalho:
                this.txtTitulo1.Text = "lanche da noite";
                // Exibe as imagens correspondentes no prato e copo:
                lstDados.Add(
                    AlimentoViewModel.listarFrutas()[
                        LanchedaNoiteViewModel.listar()
                        [atual.Lanchedanoite_fk - 1].Frutafk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarCopos()[
                        LanchedaNoiteViewModel.listar()
                        [atual.Lanchedanoite_fk - 1].Liquidofk - 1]);
                lstDados.Add(
                    AlimentoViewModel.listarPaes()[
                        LanchedaNoiteViewModel.listar()
                        [atual.Lanchedanoite_fk - 1].Paofk - 1]);

                break;

            default:
                break;
            }
            // Fim da Listagem detalhada da refeição:
            for (int i = 0; i < lstDados.Count; i++)
            {
                lstDados[i].Id_alimento = i + 1;
            }
            this.DadosalimentosCtrl.lstDadosAlimento.ItemsSource = lstDados;
            #endregion
        }