コード例 #1
0
		public AccionesDia (MasterDetailPage masterDetail, int tdia, Usuario tusuario)
		{
			usuario = tusuario;
			dia = tdia;

			var guardaritem = new ToolbarItem {
				Text = "Guardar"
			};
			guardaritem.Clicked += (object sender, System.EventArgs e) => 
			{
				guardarAcciones();
			};

			ToolbarItems.Add(guardaritem);
			this.Title = "Acciones ahorradoras";

			master = masterDetail;




			//End Dias


			cargarAcciones ();




		}
コード例 #2
0
ファイル: PaZos.cs プロジェクト: jupabequi/COLPLATP12
        public App()
        {
            Current = this;

            var isLoggedIn = Properties.ContainsKey("IsLoggedIn")?(bool)Properties ["IsLoggedIn"]:false;

            var user = Properties.ContainsKey("usuario")?Properties ["usuario"]:null;

            // we remember if they're logged in, and only display the login page if they're not
            if (isLoggedIn && user!=null) {

                Usuario usu = new Usuario ();

                usu.Id = (int)user;
                usu.nombre = "";
                usu.ocupacion = "";
                usu.pais = 1;
                usu.genero = 0;
                usu.apellidos = "";

                int usuario = (int)Properties ["usuario"];
                MainPage = new PaZos.MainPage (usu);
            }
            else
                //MainPage = new LoginModalPage (this);
                MainPage = new inicio (this);

            //MainPage = new NavigationPage(new PaZos.Inicio ());
        }
コード例 #3
0
		public evaluacion (MasterDetailPage masterDetail, Usuario tusuario)
		{
			master = masterDetail;
			usuario = tusuario;

			var guardaritem = new ToolbarItem {
				Text = "Guardar"
			};
			guardaritem.Clicked += (object sender, System.EventArgs e) => 
			{
				guardarEvaluacion();
			};

			//ToolbarItems.Add(new ToolbarItem(){Icon="pazosicon.png"});
			ToolbarItems.Add(guardaritem);
			this.Title = "Evaluación del día";




			DateTime fecha = DateTime.Now;
			int dia = (int)fecha.DayOfWeek;
			if (dia == 0) {
				dia = 7;
			}
			diaselected= dia;
			dibuja (dia);

		}
コード例 #4
0
ファイル: PaZos.cs プロジェクト: jupabequi/COLPLATP12
 public void ShowMainPage(Usuario usuario, int opc)
 {
     if (opc == 0) {
         MainPage = new MainPage (usuario);
     } else {
         MainPage = new MainPage (usuario,1);
     }
 }
コード例 #5
0
ファイル: RestMetas.cs プロジェクト: jupabequi/COLPLATP12
		public async Task<List<respuesta>> validar (Usuario usuario)
		{			


			try 
			{
				var json = JsonConvert.SerializeObject (usuario);

				var uri = new Uri (string.Format (ServiceUrl + "?action=4&usuario={0}", json));

				var response = await client.GetAsync (uri);
				if (response.IsSuccessStatusCode) {
					var content = await response.Content.ReadAsStringAsync ();
					return JsonConvert.DeserializeObject <List<respuesta>> (content);
				}
				return null;
			} catch (Exception ex) 
			{
				Debug.WriteLine (@"ERROR {0}", ex.Message);
				return null;
			}				
		}
コード例 #6
0
ファイル: RestUsuarios.cs プロジェクト: jupabequi/COLPLATP12
		public async Task<bool> insert(Usuario user)
		{
			


			try 
			{
				var json = JsonConvert.SerializeObject (user);
				var content = new StringContent (json, Encoding.UTF8, "application/json");

				var uri = new Uri (string.Format (ServiceUrl + "?action=2&usuario={0}", json));
				var response = await client.PostAsync (uri, content);
				if (response.IsSuccessStatusCode) {
					return true;
				}
				return false;
			} catch (Exception ex) 
			{
				Debug.WriteLine (@"ERROR {0}", ex.Message);
				return false;
			}
		}
コード例 #7
0
        public Preguntas(MasterDetailPage masterDetail, Usuario tusuario)
        {
            master = masterDetail;

            var guardaritem = new ToolbarItem {
                Text = "Continuar"
            };
            guardaritem.Clicked += (object sender, System.EventArgs e) =>
            {
                continuar();
            };

            //ToolbarItems.Add(new ToolbarItem(){Icon="pazosicon.png"});
            ToolbarItems.Add(guardaritem);
            this.Title = "¿Qué vas a hacer con tus ahorros?";

            tusuario = usuario;

            var imgBackground = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.FondoLogin.png"),
                Aspect = Aspect.AspectFill
            };

            RelativeLayout layoutcontent = new RelativeLayout ();

            layoutcontent.Children.Add (imgBackground,
                Constraint.Constant (0),
                Constraint.Constant (0),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Height;
                }));

            int y=30;
            int altura = 60;

            BoxView boxViewnegro = new BoxView {

                Color = Color.Black

            };

            layoutcontent.Children.Add (boxViewnegro,
                Constraint.Constant (19),
                Constraint.Constant (y-11),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-38;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return altura*5+22;
                }));
            BoxView boxView = new BoxView {

                Color = Color.White

            };

            layoutcontent.Children.Add (boxView,
                Constraint.Constant (20),
                Constraint.Constant (y-10),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-40;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return altura*5+20;
                }));

            Label A1 = new Label () {
                Text = "1.",
                TextColor = Color.Red,
                FontFamily = "MyriadPro-Bold",
                FontSize=26
            };
            layoutcontent.Children.Add (A1,
                Constraint.Constant (30),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }));
            Label B1 = new Label () {
                HorizontalOptions = LayoutOptions.StartAndExpand
            };
            var B1fs = new FormattedString ();
            Span B1sp = new Span () {
                Text = "¿Tienes una cuenta de ahorros?",
                FontFamily = "MyriadPro-Regular",
                FontSize=18
            };
            B1fs.Spans.Add (B1sp);
            B1.FormattedText = B1fs;

            layoutcontent.Children.Add (B1,
                Constraint.Constant (60),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-60-30-60;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return altura;
                }));
            C1 = new Switch () {

            };
            layoutcontent.Children.Add (C1,
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-60-30;
                }),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }));

            y = y + 60;

            Label A2 = new Label () {
                Text = "2.",
                TextColor = Color.Red,
                FontFamily = "MyriadPro-Bold",
                FontSize=26
            };
            layoutcontent.Children.Add (A2,
                Constraint.Constant (30),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }));
            Label B2 = new Label () {
                HorizontalOptions = LayoutOptions.StartAndExpand
            };
            var B2fs = new FormattedString ();
            Span B2sp = new Span () {
                Text = "¿Sabés que es un CDT?",
                FontFamily = "MyriadPro-Regular",
                FontSize=18
            };
            B2fs.Spans.Add (B2sp);
            B2.FormattedText = B2fs;

            layoutcontent.Children.Add (B2,
                Constraint.Constant (60),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-60-30-60;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return altura;
                }));
            C2 = new Switch () {

            };
            layoutcontent.Children.Add (C2,
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-60-30;
                }),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }));

            y = y + 60;

            Label A3 = new Label () {
                Text = "3.",
                TextColor = Color.Red,
                FontFamily = "MyriadPro-Bold",
                FontSize=26
            };
            layoutcontent.Children.Add (A3,
                Constraint.Constant (30),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }));
            Label B3 = new Label () {
                HorizontalOptions = LayoutOptions.StartAndExpand
            };
            var B3fs = new FormattedString ();
            Span B3sp = new Span () {
                Text = "¿Estás ahorrando las utilidades de tu negocio en un banco?",
                FontFamily = "MyriadPro-Regular",
                FontSize=18
            };
            B3fs.Spans.Add (B3sp);
            B3.FormattedText = B3fs;

            layoutcontent.Children.Add (B3,
                Constraint.Constant (60),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-60-30-60;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return altura;
                }));
            C3 = new Switch () {

            };
            layoutcontent.Children.Add (C3,
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-60-30;
                }),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }));

            y = y + 60;

            Label A4 = new Label () {
                Text = "4.",
                TextColor = Color.Red,
                FontFamily = "MyriadPro-Bold",
                FontSize=26
            };
            layoutcontent.Children.Add (A4,
                Constraint.Constant (30),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }));
            Label B4 = new Label () {
                HorizontalOptions = LayoutOptions.StartAndExpand
            };
            var B4fs = new FormattedString ();
            Span B4sp = new Span () {
                Text = "¿Irías a un banco para pedir información sobre cómo ahorrar?",
                FontFamily = "MyriadPro-Regular",
                FontSize=18
            };
            B4fs.Spans.Add (B4sp);
            B4.FormattedText = B4fs;

            layoutcontent.Children.Add (B4,
                Constraint.Constant (60),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-60-30-60;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return altura;
                }));
            C4 = new Switch () {

            };
            layoutcontent.Children.Add (C4,
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-60-30;
                }),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }));

            y = y + 60;

            Label A5 = new Label () {
                Text = "5.",
                TextColor = Color.Red,
                FontFamily = "MyriadPro-Bold",
                FontSize=26
            };
            layoutcontent.Children.Add (A5,
                Constraint.Constant (30),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }));
            Label B5 = new Label () {
                HorizontalOptions = LayoutOptions.StartAndExpand
            };
            var B5fs = new FormattedString ();
            Span B5sp = new Span () {
                Text = "¿Conoces los servicios virtuales de tu banco?",
                FontFamily = "MyriadPro-Regular",
                FontSize=18
            };
            B5fs.Spans.Add (B5sp);
            B5.FormattedText = B5fs;

            layoutcontent.Children.Add (B5,
                Constraint.Constant (60),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-60-30-60;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return altura;
                }));
            C5 = new Switch () {

            };
            layoutcontent.Children.Add (C5,
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-60-30;
                }),
                Constraint.Constant (y),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 30;
                }));

                        // Build the page.
            Content = layoutcontent;
        }
コード例 #8
0
ファイル: Registro.xaml.cs プロジェクト: jupabequi/COLPLATP12
		public async void registrausuario(Usuario RUSER){

			var respuesta = await new RestUsuarios().insert(RUSER);

		}
コード例 #9
0
ファイル: Registro.xaml.cs プロジェクト: jupabequi/COLPLATP12
		public Registro (ILoginManager ilm)
		{

			this.Title = "Registro";

			RelativeLayout layout = new RelativeLayout ();

			//Colocar background
			var imgBackground = new Image () {
				Source = ImageSource.FromResource ("PaZos.Resources.FondoLogin.png"),
				Aspect = Aspect.AspectFill
			};

			layout.Children.Add (imgBackground,
				Constraint.Constant (0),
				Constraint.Constant (0),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Height;
				}));


			BoxView bv = new BoxView () {
				BackgroundColor = Color.FromRgb(232,78,27)
			};
			layout.Children.Add (bv,
				Constraint.Constant (0),
				Constraint.Constant (0),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 60;
				}));

			Label titulo = new Label () {
				Text="Registro",
				FontSize = 24,
				FontFamily = "TwCenMT-Condensed",
				TextColor = Color.White,
				HorizontalOptions=LayoutOptions.Center,
				XAlign= TextAlignment.Center
			};
			layout.Children.Add (titulo,
				Constraint.Constant (0),
				Constraint.Constant (25),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 60;
				}));

			var logo = new Image () {
				Source = ImageSource.FromResource ("PaZos.Resources.pazosicon.png"),
				Aspect = Aspect.AspectFill
			};

			layout.Children.Add (logo,
				Constraint.Constant (15),
				Constraint.Constant (15),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}));
			

			int alto = 35;
			int ytemp = 70;


			var txtNombre = new ExtendedEntry () {
				Placeholder="Nombre",
				BackgroundColor = Color.White,
				Font = Font.OfSize("TwCenMT-Condensed",18),
				HasBorder=true
			};

			txtNombre.Behaviors.Add (new MaxLengthValidator { MaxLength = 40 });

			layout.Children.Add (txtNombre,
				Constraint.Constant (50),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-100;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return alto;
				}));
			ytemp = ytemp + alto;
			var txtApellido = new ExtendedEntry () {
				Placeholder="Apellido",
				BackgroundColor = Color.White,
				Font = Font.OfSize("TwCenMT-Condensed",18),
				HasBorder=true
			};
			layout.Children.Add (txtApellido,
				Constraint.Constant (50),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-100;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return alto;
				}));

			txtApellido.Behaviors.Add (new MaxLengthValidator { MaxLength = 40 });


			ytemp = ytemp + alto+10;
			var txtCorreo = new ExtendedEntry () {
				Placeholder="Correo electrónico",
				BackgroundColor = Color.White,
				Font = Font.OfSize("TwCenMT-Condensed",18),
				HasBorder=true
			};
			layout.Children.Add (txtCorreo,
				Constraint.Constant (50),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-100;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return alto;
				}));
			txtCorreo.Behaviors.Add (new EmailValidatorBehavior());


			ytemp = ytemp + alto;
			var txtUsuario = new ExtendedEntry () {
				Placeholder="Usuario (Nombre para mostrar)",
				BackgroundColor = Color.White,
				Font = Font.OfSize("TwCenMT-Condensed",18),
				HasBorder=true
			};
			layout.Children.Add (txtUsuario,
				Constraint.Constant (50),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-100;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return alto;
				}));
			txtUsuario.Behaviors.Add (new MaxLengthValidator { MaxLength = 12 });

			ytemp = ytemp + alto+10;
			var txtclave = new ExtendedEntry () {
				Placeholder="Contraseña",
				BackgroundColor = Color.White,
				Font = Font.OfSize("TwCenMT-Condensed",18),
				HasBorder=true,
				IsPassword=true
			};
			layout.Children.Add (txtclave,
				Constraint.Constant (50),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-100;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return alto;
				}));
			txtclave.Behaviors.Add (new MaxLengthValidator { MaxLength = 12 });

			ytemp = ytemp + alto;
			var txtclave2 = new ExtendedEntry () {
				Placeholder="Repetir contraseña",
				BackgroundColor = Color.White,
				Font = Font.OfSize("TwCenMT-Condensed",18),
				HasBorder=true,
				IsPassword=true
			};
			layout.Children.Add (txtclave2,
				Constraint.Constant (50),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-100;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return alto;
				}));

			txtclave2.Behaviors.Add (new MaxLengthValidator { MaxLength = 12 });

			ytemp = ytemp + alto+10;
			var txtedad = new AsisprinPicker () {
				Title="Edad",
				BackgroundColor = Color.White
			};



			int i = 12;
			while (i<60)
			{
				txtedad.Items.Add(i.ToString());
				i++;
			}
			layout.Children.Add (txtedad,
				Constraint.Constant (50),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-100)/2-5;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return alto;
				}));




			var pksexo = new AsisprinPicker () {
				Title="Sexo",
				BackgroundColor = Color.White
			};
			Dictionary<string, int> tiposexo = new Dictionary<string, int>
			{
				{ "Masculino", 1 }, 
				{ "Femenino", 2 },
				{ "LGBTI", 3 }
			};
			foreach (string tSexo in tiposexo.Keys)
			{
				pksexo.Items.Add(tSexo);
			}
			layout.Children.Add (pksexo,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width/2)+5;
				}),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-100)/2-5;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return alto;
				}));

			ytemp = ytemp + alto+10;
			pkPais = new AsisprinPicker () {
				Title="Pais",
				BackgroundColor = Color.White
			};


			pkPais.SelectedIndex = 1;
			layout.Children.Add (pkPais,
				Constraint.Constant (50),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-100;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return alto;
				}));
			pkPais.SelectedIndexChanged += (object sender, EventArgs e) => {
				ListarDepartamentos ();
			};
				

			ytemp = ytemp + alto;
			pkDepartamento = new AsisprinPicker () {
				Title="Departamento",
				BackgroundColor = Color.White
			};


			layout.Children.Add (pkDepartamento,
				Constraint.Constant (50),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-100;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return alto;
				}));

			pkDepartamento.SelectedIndexChanged += (object sender, EventArgs e) => {
				ListarCiudades ();
			};

			ytemp = ytemp + alto;
			pkCiudad = new AsisprinPicker () {
				Title="Ciudad o municipio",
				BackgroundColor = Color.White
			};


			layout.Children.Add (pkCiudad,
				Constraint.Constant (50),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-100;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return alto;
				}));

			ytemp = ytemp + alto+10;
			var button = new Button { Text = "Registrar usuario",
				BackgroundColor = Color.Gray,
				TextColor = Color.White,
				Font = Font.OfSize("TwCenMT-Condensed",22)
			};
			button.Clicked += (sender, e) => {



				/*if (txtNombre.Text=="" || txtNombre.Text == null){

					DisplayActionSheet("Resgistro sin completar","Cancelar","ok",null);
					return;
				}*/
				Usuario Ruser = new Usuario();

				Ruser.nombre = txtNombre.Text;
				Ruser.apellidos = txtApellido.Text;
				Ruser.correo = txtCorreo.Text;
				Ruser.ciudad = pkCiudad.SelectedIndex;
				Ruser.contrasena=txtclave.Text;
				Ruser.departamento=pkDepartamento.SelectedIndex;
				Ruser.genero=pksexo.SelectedIndex;
				Ruser.edad=txtedad.SelectedIndex;
				Ruser.ocupacion="";
				Ruser.pais=pkPais.SelectedIndex;
				Ruser.usuario=txtUsuario.Text;



				registrausuario(Ruser);

				//DisplayAlert("Cuenta creada", "Add processing login here", "OK");
				ilm.ShowLogin(txtUsuario.Text);
			};
			layout.Children.Add (button,
				Constraint.Constant (50),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-100;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return alto;
				}));
			/*
			ytemp = ytemp + alto+10;
			var lbmen1 = new Label () {
				Text = "Si continúas, aceptas las",
				VerticalOptions = LayoutOptions.Center
			};
			layout.Children.Add (lbmen1,
				Constraint.Constant (50),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-100;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 50;
				}));
			ytemp = ytemp + 20;
			var lbmen2 = new Label () {
				Text = "condiciones de uso de la aplicación",
				VerticalOptions = LayoutOptions.Center,
				Font = Font.OfSize("TwCenMT-Condensed",22)
			};
			layout.Children.Add (lbmen2,
				Constraint.Constant (50),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-100;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 50;
				}));
			ytemp = ytemp + 20;
			var lbmen3 = new Label () {
				Text = "y la política de privacidad.",
				VerticalOptions = LayoutOptions.Center,
				Font = Font.OfSize("TwCenMT-Condensed",22)
			};
			layout.Children.Add (lbmen3,
				Constraint.Constant (50),
				Constraint.Constant (ytemp),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-100;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 50;
				}));


			var cancel = new Button { Text = "Cancel" };
			cancel.Clicked += (sender, e) => {



				MessagingCenter.Send<ContentPage> (this, "Login");
			};
*/

			ScrollView scrollview = new ScrollView {

				Content = layout

			};



			Content = scrollview;



				/*new StackLayout {
				Padding = new Thickness (10, 40, 10, 10),
				Children = {
					imgBackground,
					new Label { Text = "Create Account", Font = Font.SystemFontOfSize(NamedSize.Large) }, 
					new Label { Text = "Choose a Username" },
					new Entry { Text = "" },
					new Label { Text = "Password" },
					new Entry { Text = "" },
					new Label { Text = "Re-enter Password" },
					new Entry { Text = "" },
					button, cancel
				}
			};*/
		}
コード例 #10
0
ファイル: Cumplio.xaml.cs プロジェクト: jupabequi/COLPLATP12
        public Cumplio(MasterDetailPage masterDetail, Usuario tusuario)
        {
            usuario = tusuario;

            var guardaritem = new ToolbarItem {
                Text = "Continuar"
            };
            guardaritem.Clicked += (object sender, System.EventArgs e) =>
            {
                continuar();
            };

            //ToolbarItems.Add(new ToolbarItem(){Icon="pazosicon.png"});
            ToolbarItems.Add(guardaritem);
            this.Title = "Acciones ahorradoras";

            master = masterDetail;

            RelativeLayout layout = new RelativeLayout ();

            //Colocar background
            var imgBackground = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.FondoLogin.png"),
                Aspect = Aspect.AspectFill
            };

            layout.Children.Add (imgBackground,
                Constraint.Constant (0),
                Constraint.Constant (0),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Height;
                }));
            //Fin Colocar background
            var imgmensaje = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.cumplio.png"),
                Aspect = Aspect.AspectFit
            };

            layout.Children.Add (imgmensaje,
                Constraint.Constant (0),
                Constraint.Constant (0),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Height;
                }));

            Label lbtexto = new Label ();
            lbtexto.HorizontalOptions = LayoutOptions.CenterAndExpand;
            lbtexto.XAlign = TextAlignment.Center;

            var fs = new FormattedString ();

            int y = 75;
            int factor = 375;

            Span sp2 = new Span () {
                Text = "¿Cumpliste con tus acciones ahorradoras?",
                FontFamily = "MyriadPro-Bold",
                FontSize=16
            };
            fs.Spans.Add (sp2);
            lbtexto.FormattedText = fs;

            layout.Children.Add (lbtexto,
                Constraint.Constant (45),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width*75/factor;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-90;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 40;
                }));

            y = y + 60;

            slino = new Switch () {

            };

            layout.Children.Add (slino,
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/2-15;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width*135/factor;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 60;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 60;
                }));

            Label lblno = new Label () {
                Text="No",
                Font = Font.OfSize("TwCenMT-Condensed",18)
            };
            layout.Children.Add (lblno,
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/2-60;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width*140/factor;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 60;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 60;
                }));

            Label lblsi = new Label () {
                Text="Si",
                Font = Font.OfSize("TwCenMT-Condensed",18)
            };
            layout.Children.Add (lblsi,
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/2+60;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width*140/factor;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 60;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 60;
                }));

            y = y + 100;

            Label lbtexto3 = new Label ();
            lbtexto3.HorizontalOptions = LayoutOptions.CenterAndExpand;
            lbtexto3.XAlign = TextAlignment.Center;

            var fs3 = new FormattedString ();

            Span sp3 = new Span () {
                Text = "Guarda y protege tu dinero en un lugar seguro, ¿estás ahorrando en un banco?",
                FontFamily = "MyriadPro-Regular",
                FontSize=16
            };
            fs3.Spans.Add (sp3);

            lbtexto3.FormattedText = fs3;

            layout.Children.Add (lbtexto3,
                Constraint.Constant (40),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width*250/factor;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-80;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 80;
                }));

            Content = layout;
        }
コード例 #11
0
ファイル: Animo.xaml.cs プロジェクト: jupabequi/COLPLATP12
        public Animo(MasterDetailPage masterDetail, Usuario tusuario)
        {
            usuario = tusuario;

            var guardaritem = new ToolbarItem {
                Text = "Continuar"
            };
            guardaritem.Clicked += (object sender, System.EventArgs e) =>
            {
                continuar();
            };

            //ToolbarItems.Add(new ToolbarItem(){Icon="pazosicon.png"});
            ToolbarItems.Add(guardaritem);
            this.Title = "Acciones ahorradoras";

            master = masterDetail;

            RelativeLayout layout = new RelativeLayout ();

            //Colocar background
            var imgBackground = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.FondoLogin.png"),
                Aspect = Aspect.AspectFill
            };

            layout.Children.Add (imgBackground,
                Constraint.Constant (0),
                Constraint.Constant (0),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Height;
                }));
            //Fin Colocar background
            var imgmensaje = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.Animo.png"),
                Aspect = Aspect.AspectFit
            };

            layout.Children.Add (imgmensaje,
                Constraint.Constant (0),
                Constraint.Constant (0),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Height;
                }));

            int y = 75;
            int factor = 375;

            Label lbtextotitulo = new Label ();
            lbtextotitulo.HorizontalOptions = LayoutOptions.CenterAndExpand;
            lbtextotitulo.XAlign = TextAlignment.Center;
            lbtextotitulo.TextColor = Color.Red;

            var fstitulo = new FormattedString ();

            Span sptitulo = new Span () {
                Text = "¡Ánimo!",
                FontFamily = "Noteworthy-Bold",
                FontSize=28

            };
            fstitulo.Spans.Add (sptitulo);

            lbtextotitulo.FormattedText = fstitulo;

            layout.Children.Add (lbtextotitulo,
                Constraint.Constant (50),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width*75/factor;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-100;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 40;
                }));

            Label lbtexto = new Label ();
            lbtexto.HorizontalOptions = LayoutOptions.CenterAndExpand;
            lbtexto.XAlign = TextAlignment.Center;

            var fs = new FormattedString ();

            Span sp3 = new Span () {
                Text = "Revisa tus acciones, mañana tienes otra oportunidad de ahorrar más.",
                FontFamily = "MyriadPro-Bold",
                FontSize=16
            };
            fs.Spans.Add (sp3);

            lbtexto.FormattedText = fs;

            layout.Children.Add (lbtexto,
                Constraint.Constant (50),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width*125/factor;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-100;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 80;
                }));

            Content = layout;
        }
コード例 #12
0
ファイル: acciones.xaml.cs プロジェクト: jupabequi/COLPLATP12
        public acciones(MasterDetailPage masterDetail,Usuario tusuario)
        {
            usuario = tusuario;

            ToolbarItems.Add(new ToolbarItem(){Icon="pazosicon.png"});
            this.Title = "Acciones ahorradoras";

            master = masterDetail;

            RelativeLayout layout = new RelativeLayout ();

            //Colocar background
            var imgBackground = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.FondoAcciones.png"),
                Aspect = Aspect.AspectFill
            };

            layout.Children.Add (imgBackground,
                Constraint.Constant (0),
                Constraint.Constant (0),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Height;
                }));
            //Fin Colocar background

            //Dias
            var imgDias = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.mujer.png"),
                Aspect = Aspect.AspectFit
            };

            layout.Children.Add (imgDias,
                Constraint.Constant (0),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*80;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*150;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Height-(Parent.Width/375*80);
                }));

            //End Dias

            Label lblTitle = new Label () {
                Text = "¿Cuánto debes ahorrar para cumplir tus metas?",
                FontSize = 20,
                FontFamily = "MyriadPro-Bold",
                HorizontalOptions=LayoutOptions.Center,
                XAlign= TextAlignment.Center
            };

            layout.Children.Add (lblTitle,
                Constraint.Constant (20),
                Constraint.Constant (5),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-40;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 50;
                }));

            Label lbtexto = new Label ();
            lbtexto.HorizontalOptions = LayoutOptions.CenterAndExpand;
            lbtexto.XAlign = TextAlignment.Center;

            var fs = new FormattedString ();

            Span sp1 = new Span () {
                Text = "Ingresa en este calendario las ",
                FontFamily = "MyriadPro-Regular",
                FontSize=13
            };
            fs.Spans.Add (sp1);
            Span sp2 = new Span () {
                Text = "acciones ahorradoras",
                FontFamily = "MyriadPro-Bold",
                FontSize=13
            };
            fs.Spans.Add (sp2);
            Span sp3 = new Span () {
                Text = " que puedes hacer cada día de la semana.",
                FontFamily = "MyriadPro-Regular",
                FontSize=13
            };
            fs.Spans.Add (sp3);
            lbtexto.FormattedText = fs;

            layout.Children.Add (lbtexto,
                Constraint.Constant (20),
                Constraint.Constant (52),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width-40;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 80;
                }));

            double y = 120, yinicial;

            yinicial = y;
            int gap;
            int hoy = 0;
            int alto = 40;
            gap = alto + 10;
            int espacio = alto*2+20+15;
            int x = 79;

            var imglunes = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.Dias.lunes.png"),
            };

            layout.Children.Add (imglunes,
                Constraint.RelativeToParent ((Parent) => {

                    if(hoy==1){
                        return 10;
                    }else{
                        return Parent.Width/2 - Parent.Width/375*x;
                    }
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*y;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return alto;
                }));

            var lblunes = new Button () {
                Text = "",
                TextColor = Color.White,
                //BackgroundColor = Color.Blue
            };
            lblunes.Clicked += (sender, args) => {
                Selected(1);
            };

            layout.Children.Add (lblunes,
                Constraint.RelativeToParent ((Parent) => {
                    if(hoy==1){
                        return 10;
                    }else{
                        return Parent.Width/2 - Parent.Width/375*x;
                    }
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*y;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return alto;
                }));

            //martes

            var imgmartes = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.Dias.martes.png"),
            };

            layout.Children.Add (imgmartes,
                Constraint.RelativeToParent ((Parent) => {
                    if(hoy==2){
                        return 10;
                    }else{
                        return Parent.Width/2 - Parent.Width/375*x;
                    }
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*(y+gap);
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return alto;
                }));

            var lbmartes = new Button () {
                Text = "",
                TextColor = Color.White,
                //BackgroundColor = Color.Blue
            };
            lbmartes.Clicked += (sender, args) => {
                Selected(2);
            };

            layout.Children.Add (lbmartes,
                Constraint.RelativeToParent ((Parent) => {
                    if(hoy==2){
                        return 10;
                    }else{
                        return Parent.Width/2 - Parent.Width/375*x;
                    }
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*(y+gap);
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return alto;
                }));

            //miercoles

            var imgmiercoles = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.Dias.miercoles.png"),
            };

            layout.Children.Add (imgmiercoles,
                Constraint.RelativeToParent ((Parent) => {
                    if(hoy==3){
                        return 10;
                    }else{
                        return Parent.Width/2 - Parent.Width/375*x;
                    }
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*(y+gap*2);
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return alto;
                }));

            var lbmiercoles = new Button () {
                Text = "",
                TextColor = Color.White,
                //BackgroundColor = Color.Blue
            };
            lbmiercoles.Clicked += (sender, args) => {
                Selected(3);
            };

            layout.Children.Add (lbmiercoles,
                Constraint.RelativeToParent ((Parent) => {
                    if(hoy==3){
                        return 10;
                    }else{
                        return Parent.Width/2 - Parent.Width/375*x;
                    }
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*(y+gap*2);
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return alto;
                }));

            //jueves

            var imgjueves = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.Dias.Jueves.png"),
            };

            layout.Children.Add (imgjueves,
                Constraint.RelativeToParent ((Parent) => {
                    if(hoy==4){
                        return 10;
                    }else{
                        return Parent.Width/2 - Parent.Width/375*x;
                    }
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*(y+gap*3);
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return alto;
                }));

            var lbjueves = new Button () {
                Text = "",
                TextColor = Color.White,
                //BackgroundColor = Color.Blue
            };
            lbjueves.Clicked += (sender, args) => {
                Selected(4);
            };

            layout.Children.Add (lbjueves,
                Constraint.RelativeToParent ((Parent) => {
                    if(hoy==4){
                        return 10;
                    }else{
                        return Parent.Width/2 - Parent.Width/375*x;
                    }
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*(y+gap*3);
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return alto;
                }));

            //viernes

            var imgviernes = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.Dias.Viernes.png")
            };

            layout.Children.Add (imgviernes,
                Constraint.RelativeToParent ((Parent) => {
                    if(hoy==5){
                        return 10;
                    }else{
                        return Parent.Width/2 - Parent.Width/375*x;
                    }
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*(y+gap*4);
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return alto;
                }));

            var lbviernes = new Button () {
                Text = "",
                TextColor = Color.White,
                //BackgroundColor = Color.Blue
            };
            lbviernes.Clicked += (sender, args) => {
                Selected(5);
            };

            layout.Children.Add (lbviernes,
                Constraint.RelativeToParent ((Parent) => {
                    if(hoy==5){
                        return 10;
                    }else{
                        return Parent.Width/2 - Parent.Width/375*x;
                    }
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*(y+gap*4);
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return alto;
                }));

            //sabado

            var imgsabado = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.Dias.Sabado.png")
            };

            layout.Children.Add (imgsabado,
                Constraint.RelativeToParent ((Parent) => {
                    if(hoy==6){
                        return 10;
                    }else{
                        return Parent.Width/2 - Parent.Width/375*x;
                    }
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*(y+gap*5);
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return alto;
                }));

            var lbsabado = new Button () {
                Text = "",
                TextColor = Color.White,
                //BackgroundColor = Color.Blue
            };
            lbsabado.Clicked += (sender, args) => {
                Selected(6);
            };

            layout.Children.Add (lbsabado,
                Constraint.RelativeToParent ((Parent) => {
                    if(hoy==6){
                        return 10;
                    }else{
                        return Parent.Width/2 - Parent.Width/375*x;
                    }
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*(y+gap*5);
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return alto;
                }));

            //domingo

            var imgdomingo = new Image () {
                Source = ImageSource.FromResource ("PaZos.Resources.Dias.Domingo.png")
            };

            layout.Children.Add (imgdomingo,
                Constraint.RelativeToParent ((Parent) => {
                    if(hoy==7){
                        return 10;
                    }else{
                        return Parent.Width/2 - Parent.Width/375*x;
                    }
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*(y+gap*6);
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return alto;
                }));

            var lbdomingo = new Button () {
                Text = "",
                TextColor = Color.White,
                //BackgroundColor = Color.Blue
            };
            lbdomingo.Clicked += (sender, args) => {
                Selected(7);
            };

            layout.Children.Add (lbdomingo,
                Constraint.RelativeToParent ((Parent) => {
                    if(hoy==7){
                        return 10;
                    }else{
                        return Parent.Width/2 - Parent.Width/375*x;
                    }
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width/375*(y+gap*6);
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return alto;
                }));

            /*

            int x = 118;
            int y = 152;
            int gap = 62;
            int factor = 375;

            var lblunes = new Button () {
                Text = "",
                TextColor = Color.White,
                //BackgroundColor = Color.Blue
            };
            lblunes.Clicked += (sender, args) => {
                Selected(1);
            };

            layout.Children.Add (lblunes,
                Constraint.Constant (x),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width*y/factor;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 40;
                }));

            //martes
            var lbmartes = new Button () {
                Text = "",
                TextColor = Color.White,
                //BackgroundColor = Color.Blue
            };
            lbmartes.Clicked += (sender, args) => {
                Selected(2);
            };

            layout.Children.Add (lbmartes,
                Constraint.Constant (x),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width*(y+gap)/factor;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 40;
                }));

            //miercoles
            var lbmiercoles = new Button () {
                Text = "",
                TextColor = Color.White,
                //BackgroundColor = Color.Blue
            };
            lbmiercoles.Clicked += (sender, args) => {
                Selected(3);
            };

            layout.Children.Add (lbmiercoles,
                Constraint.Constant (x),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width*(y+gap*2)/factor;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 40;
                }));

            //jueves
            var lbjueves = new Button () {
                Text = "",
                TextColor = Color.White,
                //BackgroundColor = Color.Blue
            };
            lbjueves.Clicked += (sender, args) => {
                Selected(4);
            };

            layout.Children.Add (lbjueves,
                Constraint.Constant (x),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width*(y+gap*3)/factor;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 40;
                }));

            //viernes
            var lbviernes = new Button () {
                Text = "",
                TextColor = Color.White,
                //BackgroundColor = Color.Blue
            };
            lbviernes.Clicked += (sender, args) => {
                Selected(5);
            };

            layout.Children.Add (lbviernes,
                Constraint.Constant (x),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width*(y+gap*4)/factor;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 40;
                }));

            //sabado
            var lbsabado = new Button () {
                Text = "",
                TextColor = Color.White,
                //BackgroundColor = Color.Blue
            };
            lbsabado.Clicked += (sender, args) => {
                Selected(6);
            };

            layout.Children.Add (lbsabado,
                Constraint.Constant (x),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width*(y+gap*5)/factor;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 40;
                }));

            //domingo
            var lbdomingo = new Button () {
                Text = "",
                TextColor = Color.White,
                //BackgroundColor = Color.Blue
            };
            lbdomingo.Clicked += (sender, args) => {
                Selected(7);
            };

            layout.Children.Add (lbdomingo,
                Constraint.Constant (x),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width*(y+gap*6)/factor;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 250;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return 40;
                }));

            */

            Content = layout;
        }
コード例 #13
0
ファイル: Metas.xaml.cs プロジェクト: jupabequi/COLPLATP12
		public Metas (MasterDetailPage masterDetail, Usuario tusuario)
		{

			usuario = tusuario;

			var guardaritem = new ToolbarItem {
				Text = "Guardar"
			};
			guardaritem.Clicked += (object sender, System.EventArgs e) => 
			{
				guardarMetas();
			};

			//ToolbarItems.Add(new ToolbarItem(){Icon="pazosicon.png"});
			ToolbarItems.Add(guardaritem);
			this.Title = "Metas";

			//this.Icon =  "Resources/menuicon.png";

			//cargarImagenes ();

			master = masterDetail;

			RelativeLayout layout = new RelativeLayout ();

			//Colocar background
			var imgBackground = new Image () {
				Source = ImageSource.FromResource ("PaZos.Resources.FondoAcciones.png"),
				Aspect = Aspect.AspectFill
			};

			layout.Children.Add (imgBackground,
				Constraint.Constant (0),
				Constraint.Constant (0),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Height;
				}));


			Label lblTitle = new Label () {
				Text = "¿Para qué quieres ahorrar?",
				FontSize = 20,
				FontFamily = "MyriadPro-Bold",
				HorizontalOptions=LayoutOptions.Center,
				XAlign= TextAlignment.Center
			};

			layout.Children.Add (lblTitle,
				Constraint.Constant (20),
				Constraint.Constant (5),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-40;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 50;
				}));

			Label lbtexto = new Label ();
			lbtexto.HorizontalOptions = LayoutOptions.CenterAndExpand;
			lbtexto.XAlign = TextAlignment.Center;

			var fs = new FormattedString ();


			Span sp1 = new Span () {
				Text = "Ingresa aquí, en orden de prioridad, 3 ",
				FontFamily = "MyriadPro-Regular",
				FontSize=13
			};
			fs.Spans.Add (sp1);
			Span sp2 = new Span () {
				Text = " metas especificas de ahorro.",
				FontFamily = "MyriadPro-Regular",
				FontSize=13
			};
			fs.Spans.Add (sp2);
			Span sp3 = new Span () {
				Text = " Define si tus metas son ",
				FontFamily = "MyriadPro-Regular",
				FontSize=13
			};
			fs.Spans.Add (sp3);
			Span sp4 = new Span () {
				Text = "personales, ",
				FontFamily = "MyriadPro-Bold",
				FontSize=13
			};
			fs.Spans.Add (sp4);
			Span sp5 = new Span () {
				Text = " o para tu ",
				FontFamily = "MyriadPro-Regular",
				FontSize=13
			};
			fs.Spans.Add (sp5);
			Span sp6 = new Span () {
				Text = "emprendimiento",
				FontFamily = "MyriadPro-Bold",
				FontSize=13
			};
			fs.Spans.Add (sp6);	
			lbtexto.FormattedText = fs;

			layout.Children.Add (lbtexto,
				Constraint.Constant (20),
				Constraint.Constant (22),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-40;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 80;
				}));	

			int y = 80;

			int y2 = y;



			y = y - 7;
			pkTipoMeta = new AsisprinPicker () {
				Title = "Tipo de meta"
			};
			layout.Children.Add (pkTipoMeta,
				Constraint.Constant (199),
				Constraint.Constant (y+22),
				Constraint.RelativeToParent ((Parent) => {
					return ParentView.Width-199-20;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));	

				

			y = y + 52 + 3;
			entmeta = new ExtendedEntry () {
				Placeholder = "Escribe tu meta",
				Font = Font.OfSize("TwCenMT-Condensed",26)
			};
			layout.Children.Add (entmeta,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-40;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}));	

			Image imgMeta1 = new Image () {
				Aspect = Aspect.AspectFill,
				Source = ImageSource.FromResource ("PaZos.Resources.Metas.btnmeta1.png")

			};
			layout.Children.Add (imgMeta1,
				Constraint.Constant (20),
				Constraint.Constant (y2),
				Constraint.RelativeToParent ((Parent) => {
					return 175;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 52;
				}));	
			var lbMeta1 = new Label()
			{
				Text = "Meta 1",
				TextColor = Color.White,
				FontSize=26,
				FontFamily =  "MyriadPro-Bold",
				VerticalOptions = LayoutOptions.Center,
				HorizontalOptions = LayoutOptions.Center
			};
			layout.Children.Add (lbMeta1,
				Constraint.Constant (70),
				Constraint.Constant (y2+13),
				Constraint.RelativeToParent ((Parent) => {
					return 175;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 52;
				}));

			y = y + 40 + 2;
			entvalor = new ExtendedEntry() {
				Placeholder = "$",
				Font = Font.OfSize("TwCenMT-Condensed",26),
				XAlign= TextAlignment.End

			};
			entvalor.Unfocused += (object sender, FocusEventArgs e) => {
				double valor;
				if (!Double.TryParse(entvalor.Text, out valor)) {
					DisplayAlert("Meta 1", "Valor no es numérico", "Corregir");
				}else{
					if(Convert.ToDouble(entvalor.Text)>100000){
						enviamensaje();
					}
				}
			};
			entvalor.Behaviors.Add (new NumberValidatorBehavior ());

			layout.Children.Add (entvalor,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2-30;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}));



			Label lbinicia = new Label () {
				Text = "Inicia",
				FontSize = 14,
				FontFamily = "TwCenMT-Condensed",
			};
			layout.Children.Add (lbinicia,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2+5+20-30;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 10;
				}));
		




			dtinicio = new AsisprinDatePicker () {
				VerticalOptions = LayoutOptions.Center,
				Format = "dd/MM/yyyy",

			};


			layout.Children.Add (dtinicio,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2+5+20-30;
				}),
				Constraint.Constant (y+10),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));	

			Label lbTermina = new Label () {
				Text = "Termina",
				FontSize = 14,
				FontFamily = "TwCenMT-Condensed",
			};
			layout.Children.Add (lbTermina,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4*3+5+20-15;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 10;
				}));

			dtfinal = new AsisprinDatePicker () {
				VerticalOptions = LayoutOptions.Center,
				Format = "dd/MM/yyyy"
			};
			layout.Children.Add (dtfinal,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4*3+5+20-15;
				}),
				Constraint.Constant (y+10),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));

			y = y + 40 + 2;
			pkTipoAhorro = new AsisprinPicker () {
				Title = "Tipo de ahorro"
			};

			layout.Children.Add (pkTipoAhorro,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return 150;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));






			// Dictionary to get Color from color name.
			Dictionary<string, int> tiposMetas = new Dictionary<string, int> {
				{ "Emprendimiento", 1 }, 
				{ "Personal", 2 }
			};

			//Picker picker = new Picker
			//{
			//	Title = "Tipo de meta",
			//	VerticalOptions = LayoutOptions.CenterAndExpand
			//};



			//stk1.Children.Add (picker);




			y = y + 30 + 10;

			y2 = y;

			y = y - 7;
			pkTipoMeta2 = new AsisprinPicker () {
				Title = "Tipo de meta"
			};
			layout.Children.Add (pkTipoMeta2,
				Constraint.Constant (199),
				Constraint.Constant (y+22),
				Constraint.RelativeToParent ((Parent) => {
					return ParentView.Width-199-20;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));	



			y = y + 52 + 3;
			entmeta2 = new ExtendedEntry () {
				Placeholder = "Escribe tu meta",
				Font = Font.OfSize("TwCenMT-Condensed",26)
			};
			layout.Children.Add (entmeta2,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-40;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}));	
			



			y = y + 40 + 2;
			entvalor2 = new ExtendedEntry() {
				Placeholder = "$",
				Font = Font.OfSize("TwCenMT-Condensed",26),
				XAlign= TextAlignment.End
			};
			entvalor2.Behaviors.Add (new NumberValidatorBehavior ());
			layout.Children.Add (entvalor2,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2-30;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}));
			entvalor2.Unfocused += (object sender, FocusEventArgs e) => {
				double valor;
				if (!Double.TryParse(entvalor2.Text, out valor)) {
					DisplayAlert("Meta 2", "Valor no es numérico", "Corregir");
				}else{

					if(Convert.ToDouble(entvalor2.Text)>100000){
						enviamensaje();
					}
				}
			};


			Image imgMeta2 = new Image () {
				Aspect = Aspect.AspectFill,
				Source=  ImageSource.FromResource ("PaZos.Resources.Metas.btmeta2.png")

			};
			layout.Children.Add (imgMeta2,
				Constraint.Constant (20),
				Constraint.Constant (y2),
				Constraint.RelativeToParent ((Parent) => {
					return 175;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 52;
				}));	
			var lbMeta2 = new Label()
			{
				Text = "Meta 2",
				TextColor = Color.White,
				FontSize=26,
				FontFamily =  "MyriadPro-Bold",
				VerticalOptions = LayoutOptions.Center,
				HorizontalOptions = LayoutOptions.Center
			};
			layout.Children.Add (lbMeta2,
				Constraint.Constant (70),
				Constraint.Constant (y2+13),
				Constraint.RelativeToParent ((Parent) => {
					return 175;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 52;
				}));

			Label lbinicia2 = new Label () {
				Text = "Inicia",
				FontSize = 14,
				FontFamily = "TwCenMT-Condensed",
			};
			layout.Children.Add (lbinicia2,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2+5+20-30;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 10;
				}));
			
			dtinicio2 = new AsisprinDatePicker () {
				VerticalOptions = LayoutOptions.Center,
				Format = "dd/MM/yyyy"
			};
			layout.Children.Add (dtinicio2,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2+5+20-30;
				}),
				Constraint.Constant (y+10),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));	


			Label lbTermina2 = new Label () {
				Text = "Termina",
				FontSize = 14,
				FontFamily = "TwCenMT-Condensed",
			};
			layout.Children.Add (lbTermina2,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4*3+5+20-15;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 10;
				}));

			dtfinal2 = new AsisprinDatePicker () {
				VerticalOptions = LayoutOptions.Center,
				Format = "dd/MM/yyyy"
			};
			layout.Children.Add (dtfinal2,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4*3+5+20-15;
				}),
				Constraint.Constant (y+10),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));


			y = y + 40 + 2;
			pkTipoAhorro2 = new AsisprinPicker () {
				Title = "Tipo de ahorro"
			};

			layout.Children.Add (pkTipoAhorro2,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return 150;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));
			



			y = y + 30+10;
			y2 = y;
			y = y - 7;



			pkTipoMeta3 = new AsisprinPicker () {
				Title = "Tipo de meta"

			};
			layout.Children.Add (pkTipoMeta3,
				Constraint.Constant (199),
				Constraint.Constant (y+22),
				Constraint.RelativeToParent ((Parent) => {
					return ParentView.Width-199-20;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));	



			y = y + 52 + 3;
			entmeta3 = new ExtendedEntry () {
				Placeholder = "Escribe tu meta",
				Font = Font.OfSize("TwCenMT-Condensed",26)
			};
			layout.Children.Add (entmeta3,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-40;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}));	

			Image imgMeta3 = new Image () {
				Aspect = Aspect.AspectFill,
				Source=  ImageSource.FromResource ("PaZos.Resources.Metas.btnmeta3.png")

			};
			layout.Children.Add (imgMeta3,
				Constraint.Constant (20),
				Constraint.Constant (y2),
				Constraint.RelativeToParent ((Parent) => {
					return 175;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 52;
				}));

			var lbMeta3 = new Label()
			{
				Text = "Meta 3",
				TextColor = Color.White,
				FontSize=26,
				FontFamily =  "MyriadPro-Bold",
				VerticalOptions = LayoutOptions.Center,
				HorizontalOptions = LayoutOptions.Center
			};
			layout.Children.Add (lbMeta3,
				Constraint.Constant (70),
				Constraint.Constant (y2+13),
				Constraint.RelativeToParent ((Parent) => {
					return 175;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 52;
				}));


			y = y + 40 + 2;
			entvalor3 = new ExtendedEntry() {
				Placeholder = "$",
				Font = Font.OfSize("TwCenMT-Condensed",26),
				XAlign= TextAlignment.End
			};
			entvalor3.Behaviors.Add (new NumberValidatorBehavior ());
			layout.Children.Add (entvalor3,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2-30;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}));
			entvalor3.Unfocused += (object sender, FocusEventArgs e) => {
				double valor;
				if (!Double.TryParse(entvalor3.Text, out valor)) {
					DisplayAlert("Meta 3", "Valor no es numérico", "Corregir");
				}else{

					if(Convert.ToDouble(entvalor3.Text)>100000){
						enviamensaje();
					}
				}
			};


			Label lbinicia3 = new Label () {
				Text = "Inicia",
				FontSize = 14,
				FontFamily = "TwCenMT-Condensed",
			};
			layout.Children.Add (lbinicia3,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2+5+20-30;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 10;
				}));
			dtinicio3 = new AsisprinDatePicker () {
				VerticalOptions = LayoutOptions.Center,
				Format = "dd/MM/yyyy"
			};
			layout.Children.Add (dtinicio3,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2+5+20-30;
				}),
				Constraint.Constant (y+10),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));	

			Label lbTermina3 = new Label () {
				Text = "Termina",
				FontSize = 14,
				FontFamily = "TwCenMT-Condensed",
			};
			layout.Children.Add (lbTermina3,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4*3+5+20-15;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 10;
				}));
			dtfinal3 = new AsisprinDatePicker () {
				VerticalOptions = LayoutOptions.Center,
				Format = "dd/MM/yyyy"
			};
			layout.Children.Add (dtfinal3,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4*3+5+20-15;
				}),
				Constraint.Constant (y+10),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));

			y = y + 40 + 2;
			pkTipoAhorro3 = new AsisprinPicker () {
				Title = "Tipo de ahorro"
			};

			layout.Children.Add (pkTipoAhorro3,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return 150;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));
			
			
		
			Label lbespacio = new Label () {
				Text = " "
			};
			layout.Children.Add (lbespacio,
					Constraint.Constant (20),
					Constraint.Constant (y+30),
					Constraint.RelativeToParent ((Parent) => {
						return 150;
					}),
					Constraint.RelativeToParent ((Parent) => {
						return 10;
					}));
	

			foreach (string tipoMeta in tiposMetas.Keys) {
				pkTipoMeta.Items.Add (tipoMeta);
				pkTipoMeta2.Items.Add (tipoMeta);
				pkTipoMeta3.Items.Add (tipoMeta);
			}

			// Dictionary to get Color from color name.
			Dictionary<string, int> tiposAhorro = new Dictionary<string, int> {
				{ "Ahorro diario", 1 }, 
				{ "Ahorro semanal", 2 },
				{ "Ahorro mensual", 3 }
			};

			foreach (string tipoAhorro in tiposAhorro.Keys) {
				pkTipoAhorro.Items.Add (tipoAhorro);
				pkTipoAhorro2.Items.Add (tipoAhorro);
				pkTipoAhorro3.Items.Add (tipoAhorro);
			}

			ScrollView scrollview = new ScrollView {

				Content = layout

			};


			Content = scrollview;

			cargarMetas ();

		}
コード例 #14
0
ファイル: progreso.xaml.cs プロジェクト: jupabequi/COLPLATP12
		public progreso (MasterDetailPage masterDetail, Usuario tusuario)
		{
			ToolbarItems.Add(new ToolbarItem(){Icon="pazosicon.png"});
			this.Title = "Progreso";
			usuario = tusuario;

			//this.Icon =  "menuicon44.png";

			//cargarImagenes ();

			master = masterDetail;

			RelativeLayout layout = new RelativeLayout ();

			//Colocar background
			var imgBackground = new Image () {
				Source = ImageSource.FromResource ("PaZos.Resources.FondoAcciones.png"),
				Aspect = Aspect.AspectFill
			};

			layout.Children.Add (imgBackground,
				Constraint.Constant (0),
				Constraint.Constant (0),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Height;
				}));



			int y = 20;

			int y2 = y;



			y = y - 7;
			pkTipoMeta = new AsisprinPicker () {
				Title = "Tipo de meta",
				IsEnabled = false
			};
			layout.Children.Add (pkTipoMeta,
				Constraint.Constant (199),
				Constraint.Constant (y+22),
				Constraint.RelativeToParent ((Parent) => {
					return ParentView.Width-199-20;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));	



			y = y + 52 + 3;
			entmeta = new ExtendedEntry () {
				Placeholder = "Escribe tu meta",
				Font = Font.OfSize("TwCenMT-Condensed",26),
				IsEnabled=false
			};
			layout.Children.Add (entmeta,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-40;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}));	

			Image imgMeta1 = new Image () {
				Aspect = Aspect.AspectFill,
				Source = ImageSource.FromResource ("PaZos.Resources.Metas.btnmeta1.png")

			};
			layout.Children.Add (imgMeta1,
				Constraint.Constant (20),
				Constraint.Constant (y2),
				Constraint.RelativeToParent ((Parent) => {
					return 175;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 52;
				}));	
			var lbMeta1 = new Label()
			{
				Text = "Meta 1",
				TextColor = Color.White,
				FontSize=26,
				FontFamily =  "MyriadPro-Bold",
				VerticalOptions = LayoutOptions.Center,
				HorizontalOptions = LayoutOptions.Center
			};
			layout.Children.Add (lbMeta1,
				Constraint.Constant (70),
				Constraint.Constant (y2+13),
				Constraint.RelativeToParent ((Parent) => {
					return 175;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 52;
				}));

			y = y + 40 + 2;
			entvalor = new ExtendedEntry() {
				Placeholder = "$",
				Font = Font.OfSize("TwCenMT-Condensed",26),
				XAlign= TextAlignment.End,
				IsEnabled=false
			};

			//entvalor.Behaviors.Add (new NumberValidatorBehavior ());

			layout.Children.Add (entvalor,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2-30;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}));



			Label lbinicia = new Label () {
				Text = "Inicia",
				FontSize = 14,
				FontFamily = "TwCenMT-Condensed",
			};
			layout.Children.Add (lbinicia,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2+5+20-30;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 10;
				}));





			dtinicio = new AsisprinDatePicker () {
				VerticalOptions = LayoutOptions.Center,
				Format = "dd/MM/yyyy",
				IsEnabled=false
			};


			layout.Children.Add (dtinicio,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2+5+20-30;
				}),
				Constraint.Constant (y+10),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));	

			Label lbTermina = new Label () {
				Text = "Termina",
				FontSize = 14,
				FontFamily = "TwCenMT-Condensed",
			};
			layout.Children.Add (lbTermina,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4*3+5+20-15;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 10;
				}));

			dtfinal = new AsisprinDatePicker () {
				VerticalOptions = LayoutOptions.Center,
				Format = "dd/MM/yyyy",
				IsEnabled=false
			};
			layout.Children.Add (dtfinal,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4*3+5+20-15;
				}),
				Constraint.Constant (y+10),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));

			y = y + 40 + 2;
			entacumulado = new ExtendedEntry () {
				Font = Font.OfSize("TwCenMT-Condensed",24),
				XAlign = TextAlignment.End,
				IsEnabled=false
			};
			layout.Children.Add (entacumulado,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-50)/2;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));
			porcentaje = new ExtendedEntry () {
				Font = Font.OfSize("TwCenMT-Condensed",24),
				XAlign = TextAlignment.Center,
				IsEnabled=false
			};
			layout.Children.Add (porcentaje,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width)/2+5;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-50)/2;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));





			// Dictionary to get Color from color name.
			Dictionary<string, int> tiposMetas = new Dictionary<string, int> {
				{ "Emprendimiento", 1 }, 
				{ "Personal", 2 }
			};

			//Picker picker = new Picker
			//{
			//	Title = "Tipo de meta",
			//	VerticalOptions = LayoutOptions.CenterAndExpand
			//};



			//stk1.Children.Add (picker);




			y = y + 30 + 10;

			y2 = y;

			y = y - 7;
			pkTipoMeta2 = new AsisprinPicker () {
				Title = "Tipo de meta",
				IsEnabled=false
			};
			layout.Children.Add (pkTipoMeta2,
				Constraint.Constant (199),
				Constraint.Constant (y+22),
				Constraint.RelativeToParent ((Parent) => {
					return ParentView.Width-199-20;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));	



			y = y + 52 + 3;
			entmeta2 = new ExtendedEntry () {
				Placeholder = "Escribe tu meta",
				Font = Font.OfSize("TwCenMT-Condensed",26),
				IsEnabled=false
			};
			layout.Children.Add (entmeta2,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-40;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}));	




			y = y + 40 + 2;
			entvalor2 = new ExtendedEntry() {
				Placeholder = "$",
				Font = Font.OfSize("TwCenMT-Condensed",26),
				XAlign= TextAlignment.End,
				IsEnabled=false
			};
			//entvalor2.Behaviors.Add (new NumberValidatorBehavior ());
			layout.Children.Add (entvalor2,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2-30;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}));



			Image imgMeta2 = new Image () {
				Aspect = Aspect.AspectFill,
				Source=  ImageSource.FromResource ("PaZos.Resources.Metas.btmeta2.png")

			};
			layout.Children.Add (imgMeta2,
				Constraint.Constant (20),
				Constraint.Constant (y2),
				Constraint.RelativeToParent ((Parent) => {
					return 175;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 52;
				}));	
			var lbMeta2 = new Label()
			{
				Text = "Meta 2",
				TextColor = Color.White,
				FontSize=26,
				FontFamily =  "MyriadPro-Bold",
				VerticalOptions = LayoutOptions.Center,
				HorizontalOptions = LayoutOptions.Center
			};
			layout.Children.Add (lbMeta2,
				Constraint.Constant (70),
				Constraint.Constant (y2+13),
				Constraint.RelativeToParent ((Parent) => {
					return 175;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 52;
				}));

			Label lbinicia2 = new Label () {
				Text = "Inicia",
				FontSize = 14,
				FontFamily = "TwCenMT-Condensed",
			};
			layout.Children.Add (lbinicia2,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2+5+20-30;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 10;
				}));

			dtinicio2 = new AsisprinDatePicker () {
				VerticalOptions = LayoutOptions.Center,
				Format = "dd/MM/yyyy",
				IsEnabled=false
			};
			layout.Children.Add (dtinicio2,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2+5+20-30;
				}),
				Constraint.Constant (y+10),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));	


			Label lbTermina2 = new Label () {
				Text = "Termina",
				FontSize = 14,
				FontFamily = "TwCenMT-Condensed",
			};
			layout.Children.Add (lbTermina2,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4*3+5+20-15;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 10;
				}));

			dtfinal2 = new AsisprinDatePicker () {
				VerticalOptions = LayoutOptions.Center,
				Format = "dd/MM/yyyy",
				IsEnabled=false
			};
			layout.Children.Add (dtfinal2,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4*3+5+20-15;
				}),
				Constraint.Constant (y+10),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));


			y = y + 40 + 2;
			entacumulado2 = new ExtendedEntry () {
				Font = Font.OfSize("TwCenMT-Condensed",24),
				IsEnabled=false,
				XAlign=TextAlignment.End
			};
			layout.Children.Add (entacumulado2,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-50)/2;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));
			porcentaje2 = new ExtendedEntry () {
				Font = Font.OfSize("TwCenMT-Condensed",24),
				IsEnabled=false,
				XAlign=TextAlignment.Center
			};
			layout.Children.Add (porcentaje2,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width)/2+5;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-50)/2;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));




			y = y + 30+10;
			y2 = y;
			y = y - 7;



			pkTipoMeta3 = new AsisprinPicker () {
				Title = "Tipo de meta"

			};
			layout.Children.Add (pkTipoMeta3,
				Constraint.Constant (199),
				Constraint.Constant (y+22),
				Constraint.RelativeToParent ((Parent) => {
					return ParentView.Width-199-20;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));	



			y = y + 52 + 3;
			entmeta3 = new ExtendedEntry () {
				Placeholder = "Escribe tu meta",
				Font = Font.OfSize("TwCenMT-Condensed",26),
				IsEnabled=false
			};
			layout.Children.Add (entmeta3,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-40;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}));	

			Image imgMeta3 = new Image () {
				Aspect = Aspect.AspectFill,
				Source=  ImageSource.FromResource ("PaZos.Resources.Metas.btnmeta3.png")

			};
			layout.Children.Add (imgMeta3,
				Constraint.Constant (20),
				Constraint.Constant (y2),
				Constraint.RelativeToParent ((Parent) => {
					return 175;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 52;
				}));

			var lbMeta3 = new Label()
			{
				Text = "Meta 3",
				TextColor = Color.White,
				FontSize=26,
				FontFamily =  "MyriadPro-Bold",
				VerticalOptions = LayoutOptions.Center,
				HorizontalOptions = LayoutOptions.Center
			};
			layout.Children.Add (lbMeta3,
				Constraint.Constant (70),
				Constraint.Constant (y2+13),
				Constraint.RelativeToParent ((Parent) => {
					return 175;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 52;
				}));


			y = y + 40 + 2;
			entvalor3 = new ExtendedEntry() {
				Placeholder = "$",
				Font = Font.OfSize("TwCenMT-Condensed",26),
				XAlign= TextAlignment.End,
				IsEnabled=false
			};
			//entvalor3.Behaviors.Add (new NumberValidatorBehavior ());
			layout.Children.Add (entvalor3,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2-30;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}));


			Label lbinicia3 = new Label () {
				Text = "Inicia",
				FontSize = 14,
				FontFamily = "TwCenMT-Condensed",
			};
			layout.Children.Add (lbinicia3,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2+5+20-30;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 10;
				}));
			dtinicio3 = new AsisprinDatePicker () {
				VerticalOptions = LayoutOptions.Center,
				Format = "dd/MM/yyyy",
				IsEnabled=false
			};
			layout.Children.Add (dtinicio3,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/2+5+20-30;
				}),
				Constraint.Constant (y+10),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));	

			Label lbTermina3 = new Label () {
				Text = "Termina",
				FontSize = 14,
				FontFamily = "TwCenMT-Condensed",
			};
			layout.Children.Add (lbTermina3,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4*3+5+20-15;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 10;
				}));
			dtfinal3 = new AsisprinDatePicker () {
				VerticalOptions = LayoutOptions.Center,
				Format = "dd/MM/yyyy",
				IsEnabled=false
			};
			layout.Children.Add (dtfinal3,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4*3+5+20-15;
				}),
				Constraint.Constant (y+10),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-40)/4-5+15;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));

			y = y + 40 + 2;
			entacumulado3 = new ExtendedEntry () {
				Font = Font.OfSize("TwCenMT-Condensed",24),
				IsEnabled=false,
				XAlign=TextAlignment.End
			};
			layout.Children.Add (entacumulado3,
				Constraint.Constant (20),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-50)/2;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));
			porcentaje3 = new ExtendedEntry () {
				Font = Font.OfSize("TwCenMT-Condensed",24),
				IsEnabled=false,
				XAlign = TextAlignment.Center
			};
			layout.Children.Add (porcentaje3,
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width)/2+5;
				}),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return (Parent.Width-50)/2;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));


			Label lbespacio = new Label () {
				Text = " "
			};
			layout.Children.Add (lbespacio,
				Constraint.Constant (20),
				Constraint.Constant (y+30),
				Constraint.RelativeToParent ((Parent) => {
					return 150;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 10;
				}));


			foreach (string tipoMeta in tiposMetas.Keys) {
				pkTipoMeta.Items.Add (tipoMeta);
				pkTipoMeta2.Items.Add (tipoMeta);
				pkTipoMeta3.Items.Add (tipoMeta);
			}


			ScrollView scrollview = new ScrollView {

				Content = layout

			};


			Content = scrollview;
			cargarMetas ();
		}
コード例 #15
0
		public AccionesMensaje2 (MasterDetailPage masterDetail, Usuario tusuario)
		{
			usuario = tusuario;

			ToolbarItems.Add(new ToolbarItem(){Icon="pazosicon.png"});
			this.Title = "Acciones ahorradoras";

			master = masterDetail;

			RelativeLayout layout = new RelativeLayout ();

			//Colocar background
			var imgBackground = new Image () {
				Source = ImageSource.FromResource ("PaZos.Resources.FondoAcciones.png"),
				Aspect = Aspect.AspectFill
			};

			layout.Children.Add (imgBackground,
				Constraint.Constant (0),
				Constraint.Constant (0),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Height;
				}));
			//Fin Colocar background 
			var imgmensaje = new Image () {
				Source = ImageSource.FromResource ("PaZos.Resources.Accionesmensaje2.png"),
				Aspect = Aspect.AspectFit
			};

			layout.Children.Add (imgmensaje,
				Constraint.Constant (0),
				Constraint.Constant (0),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Height;
				}));

			Label lbtexto = new Label ();
			lbtexto.HorizontalOptions = LayoutOptions.CenterAndExpand;
			lbtexto.XAlign = TextAlignment.Center;

			var fs = new FormattedString ();

			int y = 45;

			Span sp2 = new Span () {
				Text = "Si haces todas tus acciones, esta semana ahorrarías",
				FontFamily = "MyriadPro-Bold",
				FontSize=16
			};
			fs.Spans.Add (sp2);
			lbtexto.FormattedText = fs;

			layout.Children.Add (lbtexto,
				Constraint.Constant (45),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-90;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}));

			y = y + 38 + 5;
			valor = new ExtendedEntry () {
				Font = Font.OfSize("TwCenMT-Condensed",26),
				XAlign= TextAlignment.Center,
				IsEnabled=false
			};
			layout.Children.Add (valor,
				Constraint.Constant (75),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-150;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));

			y = y + 35;

			Label lbtextoB = new Label ();
			lbtextoB.HorizontalOptions = LayoutOptions.CenterAndExpand;
			lbtextoB.XAlign = TextAlignment.Center;

			var fsB = new FormattedString ();

			Span spB = new Span () {
				Text = "Si mantines estos hábitos de",
				FontFamily = "MyriadPro-Bold",
				FontSize=16
			};

			fsB.Spans.Add (spB);
			lbtextoB.FormattedText = fsB;

			layout.Children.Add (lbtextoB,
				Constraint.Constant (45),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-90;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));

			y = y + 35;

			Label lbtextoC = new Label ();
			lbtextoC.HorizontalOptions = LayoutOptions.CenterAndExpand;


			var fsC = new FormattedString ();

			Span spC = new Span () {
				Text = "ahorro, en ",
				FontFamily = "MyriadPro-Bold",
				FontSize=16
			};

			fsC.Spans.Add (spC);
			lbtextoC.FormattedText = fsC;

			layout.Children.Add (lbtextoC,
				Constraint.Constant (45),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-90;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));
			
			numero = new ExtendedEntry () {
				Font = Font.OfSize("TwCenMT-Condensed",26),
				XAlign= TextAlignment.Center,
				IsEnabled=false
			};
			layout.Children.Add (numero,
				Constraint.Constant (125),
				Constraint.Constant (y-5),
				Constraint.RelativeToParent ((Parent) => {
					return 40;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));

			meses = new ExtendedEntry () {
				Font = Font.OfSize("TwCenMT-Condensed",26),
				XAlign= TextAlignment.Center,
				IsEnabled=false
			};
			layout.Children.Add (meses,
				Constraint.Constant (170),
				Constraint.Constant (y-5),
				Constraint.RelativeToParent ((Parent) => {
					return 90;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));

			y = y + 35;

			Label lbtextoD = new Label ();
			lbtextoD.HorizontalOptions = LayoutOptions.CenterAndExpand;
			lbtextoD.XAlign = TextAlignment.Center;

			var fsD = new FormattedString ();

			Span spD = new Span () {
				Text = "alcanzarías tus metas.",
				FontFamily = "MyriadPro-Bold",
				FontSize=16
			};

			fsD.Spans.Add (spD);
			lbtextoD.FormattedText = fsD;

			layout.Children.Add (lbtextoD,
				Constraint.Constant (45),
				Constraint.Constant (y),
				Constraint.RelativeToParent ((Parent) => {
					return Parent.Width-90;
				}),
				Constraint.RelativeToParent ((Parent) => {
					return 30;
				}));
			
			Content = layout;
			cargarMensaje ();
		}
コード例 #16
0
ファイル: MenuPage.xaml.cs プロジェクト: jupabequi/COLPLATP12
        public MenuPage(MasterDetailPage masterDetail, Usuario tusuario)
        {
            usuario = tusuario;

            Title = "Menú";
            Icon = "menuicon44.png";
            master = masterDetail;

            var layout = new RelativeLayout();

            var Fondo = new Image { Aspect = Aspect.AspectFill };
            Fondo.Source = ImageSource.FromResource ("PaZos.Resources.FondoLogin.png");
            layout.Children.Add(Fondo,
                Constraint.Constant (0),
                Constraint.Constant (0),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Width;
                }),
                Constraint.RelativeToParent ((Parent) => {
                    return Parent.Height-40;
                }));

            var imgMeta = new Image ();
            imgMeta.Source = ImageSource.FromResource ("PaZos.Resources.metas.png");

            var imgAcciones = new Image ();
            imgAcciones.Source = ImageSource.FromResource ("PaZos.Resources.Acciones.png");

            var imgEvaluacion = new Image ();
            imgEvaluacion.Source = ImageSource.FromResource ("PaZos.Resources.Evaluacion.png");

            var imgprogreso = new Image ();
            imgprogreso.Source = ImageSource.FromResource ("PaZos.Resources.progreso.png");

            var imgacercade = new Image ();
            imgacercade.Source = ImageSource.FromResource ("PaZos.Resources.acercade.png");

            var logoutButton = new Button { Text = "Logout" };
            logoutButton.Clicked += (sender, e) => {
                App.Current.Logout();
            };

            int y = 30;
            int size = 22;

            layout.Children.Add(imgMeta,
                Constraint.Constant(0),
                Constraint.Constant(y),
                Constraint.RelativeToParent((Parent) =>
                {
                    return Parent.Width*270/300;
                }),
                Constraint.RelativeToParent((Parent) =>
                {
                    return 60;
                }));
            var lbMeta = new Button()
            {
                Text = "Metas",
                TextColor = Color.White,
                FontSize=size,
                FontFamily =  "MyriadPro-Bold",
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center
            };
            lbMeta.Clicked += (sender, args) =>
            {
                Selected(1);
            };

            layout.Children.Add(lbMeta,
                Constraint.Constant(0),
                Constraint.Constant(y),
                Constraint.RelativeToParent((Parent) =>
                {
                        return Parent.Width*270/300;
                }),
                Constraint.RelativeToParent((Parent) =>
                {
                    return 60;
                }));

            y=y+60;
            layout.Children.Add(imgAcciones,
                Constraint.Constant(0),
                Constraint.Constant(y),
                Constraint.RelativeToParent((Parent) =>
                {
                        return Parent.Width*270/300;
                }),
                Constraint.RelativeToParent((Parent) =>
                {
                    return 60;
                }));
            lbAcciones = new Button()
            {
                Text = "Acciones ahorradoras",
                TextColor = Color.White,
                FontSize=size,
                FontFamily =  "MyriadPro-Bold",
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center
            };
            lbAcciones.Clicked += (sender, args) =>
            {
                Selected(2);
            };

            layout.Children.Add(lbAcciones,
                Constraint.Constant(0),
                Constraint.Constant(y),
                Constraint.RelativeToParent((Parent) =>
                {
                        return Parent.Width*270/300;
                }),
                Constraint.RelativeToParent((Parent) =>
                {
                    return 60;
                }));

            y=y+60;
            layout.Children.Add(imgEvaluacion,
                Constraint.Constant(0),
                Constraint.Constant(y),
                Constraint.RelativeToParent((Parent) =>
                {
                        return Parent.Width*270/300;
                }),
                Constraint.RelativeToParent((Parent) =>
                {
                    return 60;
                }));
            var lbEvaluacion = new Button()
            {
                Text = "Evaluación del día",
                TextColor = Color.White,
                FontSize=size,
                FontFamily =  "MyriadPro-Bold",
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center
            };
            lbEvaluacion.Clicked += (sender, args) =>
            {
                Selected(3);
            };

            layout.Children.Add(lbEvaluacion,
                Constraint.Constant(0),
                Constraint.Constant(y),
                Constraint.RelativeToParent((Parent) =>
                {
                        return Parent.Width*270/300;
                }),
                Constraint.RelativeToParent((Parent) =>
                {
                    return 60;
                }));
            y=y+60;
            layout.Children.Add(imgprogreso,
                Constraint.Constant(0),
                Constraint.Constant(y),
                Constraint.RelativeToParent((Parent) =>
                {
                        return Parent.Width*270/300;
                }),
                Constraint.RelativeToParent((Parent) =>
                {
                    return 60;
                }));
            var lbprogreso = new Button()
            {
                Text = "Progreso",
                TextColor = Color.White,
                FontSize=size,
                FontFamily =  "MyriadPro-Bold",
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center
            };
            lbprogreso.Clicked += (sender, args) =>
            {
                Selected(4);
            };

            layout.Children.Add(lbprogreso,
                Constraint.Constant(0),
                Constraint.Constant(y),
                Constraint.RelativeToParent((Parent) =>
                {
                        return Parent.Width*270/300;
                }),
                Constraint.RelativeToParent((Parent) =>
                {
                    return 60;
                }));

            y=y+60;
            layout.Children.Add(imgacercade,
                Constraint.Constant(0),
                Constraint.Constant(y),
                Constraint.RelativeToParent((Parent) =>
                {
                        return Parent.Width*270/300;
                }),
                Constraint.RelativeToParent((Parent) =>
                {
                    return 60;
                }));
            var lbacercade = new Button()
            {
                Text = "Acerca de..",
                TextColor = Color.White,
                FontSize=size,
                FontFamily =  "MyriadPro-Bold",
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center
            };
            lbacercade.Clicked += (sender, args) =>
            {
                Selected(5);
            };

            layout.Children.Add(lbacercade,
                Constraint.Constant(0),
                Constraint.Constant(y),
                Constraint.RelativeToParent((Parent) =>
                {
                        return Parent.Width*270/300;
                }),
                Constraint.RelativeToParent((Parent) =>
                {
                    return 60;
                }));

            //Content = layout;
            Content = new StackLayout {
                BackgroundColor = Color.Black,
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children = {
                    layout/*,
                    logoutButton*/
                }
            };
        }