Exemplo n.º 1
0
        public void Init()
        {
            ViewHelper.DefaultViewProperties(this);

            this.Orientation = Me.Orientation;

            Device.OnPlatform(
                Android: () =>
            {
                this.Spacing = OnPlatformDouble.GetAndroidValue(Me.Spacing);
            },
                iOS: () =>
            {
                this.Spacing = OnPlatformDouble.GetiOSValue(Me.Spacing);
            },
                WinPhone: () =>
            {
                this.Spacing = OnPlatformDouble.GetWinPhoneValue(Me.Spacing);
            }
                );

            if (Me.Controls.Count > 0)
            {
                foreach (BaseControl control in Me.Controls)
                {
                    ProcessControl(control);
                }
            }
        }
Exemplo n.º 2
0
        public void Init()
        {
            ViewHelper.DefaultViewProperties(this);

            this.IsOpaque = Me.IsOpaque;

            Device.OnPlatform(
                Android: () =>
            {
                this.Aspect = OnPlatformAspect.GetAndroidValue(Me.Aspect);

                this.Source = OnPlatformString.GetAndroidValue(Me.Source);
            },
                iOS: () =>
            {
                this.Aspect = OnPlatformAspect.GetiOSValue(Me.Aspect);
                this.Source = OnPlatformString.GetiOSValue(Me.Source);
            },
                WinPhone: () =>
            {
                this.Aspect = OnPlatformAspect.GetWinPhoneValue(Me.Aspect);
                this.Source = OnPlatformString.GetWinPhoneValue(Me.Source);
            }
                );
        }
Exemplo n.º 3
0
        public void Init()
        {
            ViewHelper.DefaultViewProperties(this);

            Device.OnPlatform(
                Android: () =>
            {
                if (!String.IsNullOrEmpty(OnPlatformString.GetAndroidValue(Me.Color)))
                {
                    this.Color = Color.FromHex(OnPlatformString.GetAndroidValue(Me.Color));
                }
            },
                iOS: () =>
            {
                if (!String.IsNullOrEmpty(OnPlatformString.GetAndroidValue(Me.Color)))
                {
                    this.Color = Color.FromHex(OnPlatformString.GetAndroidValue(Me.Color));
                }
            },
                WinPhone: () =>
            {
                if (!String.IsNullOrEmpty(OnPlatformString.GetAndroidValue(Me.Color)))
                {
                    this.Color = Color.FromHex(OnPlatformString.GetAndroidValue(Me.Color));
                }
            });
        }
Exemplo n.º 4
0
        public void Init()
        {
            ViewHelper.DefaultViewProperties(this);

            this.Intent = Me.Intent;



            TableRoot root = null;

            string title = String.Empty;

            Device.OnPlatform(
                Android: () =>
            {
                title = OnPlatformString.GetAndroidValue(Me.Title);
            },
                iOS: () =>
            {
                title = OnPlatformString.GetiOSValue(Me.Title);
            },
                WinPhone: () =>
            {
                title = OnPlatformString.GetWinPhoneValue(Me.Title);
            }
                );

            if (String.IsNullOrEmpty(title))
            {
                root = new TableRoot();
            }
            else
            {
                root = new TableRoot(title);
            }

            if (Me.Sections.Count > 0)
            {
                foreach (BaseSection section in Me.Sections)
                {
                    TableSection sectionControl = new TableSection();



                    ProcessSection(sectionControl, section);

                    root.Add(sectionControl);
                }
            }

            this.Root = root;
        }
Exemplo n.º 5
0
        public void Init()
        {
            ViewHelper.DefaultViewProperties(this);

            this.Orientation = Me.Orientation;



            if (Me.Controls.Count > 0)
            {
                ProcessControl(Me.Controls[0]);
            }
        }
Exemplo n.º 6
0
        public void Init()
        {
            ViewHelper.DefaultViewProperties(this);

            Device.OnPlatform(
                Android: () =>
            {
                this.Text = OnPlatformString.GetAndroidValue(Me.Text);
            },
                iOS: () =>
            {
                this.Text = OnPlatformString.GetiOSValue(Me.Text);
            },
                WinPhone: () =>
            {
                this.Text = OnPlatformString.GetWinPhoneValue(Me.Text);
            }
                );
        }
Exemplo n.º 7
0
        public void Init()
        {
            ViewHelper.DefaultViewProperties(this);

            this.IsPassword = Me.IsPassword;

            Device.OnPlatform(
                Android: () =>
            {
                this.Text        = OnPlatformString.GetAndroidValue(Me.Text);
                this.Placeholder = OnPlatformString.GetAndroidValue(Me.Placeholder);

                if (!String.IsNullOrEmpty(OnPlatformString.GetAndroidValue(Me.TextColor)))
                {
                    this.TextColor = Color.FromHex(OnPlatformString.GetAndroidValue(Me.TextColor));
                }
            },
                iOS: () =>
            {
                this.Text        = OnPlatformString.GetiOSValue(Me.Text);
                this.Placeholder = OnPlatformString.GetiOSValue(Me.Placeholder);

                if (!String.IsNullOrEmpty(OnPlatformString.GetiOSValue(Me.TextColor)))
                {
                    this.TextColor = Color.FromHex(OnPlatformString.GetiOSValue(Me.TextColor));
                }
            },
                WinPhone: () =>
            {
                this.Text        = OnPlatformString.GetWinPhoneValue(Me.Text);
                this.Placeholder = OnPlatformString.GetWinPhoneValue(Me.Placeholder);

                if (!String.IsNullOrEmpty(OnPlatformString.GetWinPhoneValue(Me.TextColor)))
                {
                    this.TextColor = Color.FromHex(OnPlatformString.GetWinPhoneValue(Me.TextColor));
                }
            }
                );
        }
Exemplo n.º 8
0
        public void Init()
        {
            ViewHelper.DefaultViewProperties(this);

            Device.OnPlatform(
                Android: () =>
            {
                //this.BorderWidth = OnPlatformInt.GetAndroidValue(Me.BorderWidth);
                //this.BorderRadius = OnPlatformInt.GetAndroidValue(Me.BorderRadius);

                if (!String.IsNullOrEmpty(OnPlatformString.GetAndroidValue(Me.BorderColor)))
                {
                    this.BorderColor = Color.FromHex(OnPlatformString.GetAndroidValue(Me.BorderColor));
                }

                if (!String.IsNullOrEmpty(OnPlatformString.GetAndroidValue(Me.Image)))
                {
                    try
                    {
                        this.Image = ImageSource.FromFile(OnPlatformString.GetAndroidValue(Me.Image)) as FileImageSource;
                    }
                    catch (Exception ex)
                    {
                        System.Diagnostics.Debug.WriteLine("Error while trying to load button image {1}: {0} ", ex.Message, Me.Image);
                    }
                }


                this.Text = OnPlatformString.GetAndroidValue(Me.Text);

                if (!String.IsNullOrEmpty(OnPlatformString.GetAndroidValue(Me.TextColor)))
                {
                    this.TextColor = Color.FromHex(OnPlatformString.GetAndroidValue(Me.TextColor));
                }
            },
                iOS: () =>
            {
                if (!String.IsNullOrEmpty(OnPlatformString.GetiOSValue(Me.BorderColor)))
                {
                    this.BorderColor = Color.FromHex(OnPlatformString.GetiOSValue(Me.BorderColor));
                }

                if (!String.IsNullOrEmpty(OnPlatformString.GetiOSValue(Me.Image)))
                {
                    try
                    {
                        this.Image = ImageSource.FromFile(OnPlatformString.GetiOSValue(Me.Image)) as FileImageSource;
                    }
                    catch (Exception ex)
                    {
                        System.Diagnostics.Debug.WriteLine("Error while trying to load button image {1}: {0} ", ex.Message, Me.Image);
                    }
                }


                this.Text = OnPlatformString.GetiOSValue(Me.Text);

                if (!String.IsNullOrEmpty(OnPlatformString.GetiOSValue(Me.TextColor)))
                {
                    this.TextColor = Color.FromHex(OnPlatformString.GetiOSValue(Me.TextColor));
                }
            },
                WinPhone: () =>
            {
                if (!String.IsNullOrEmpty(OnPlatformString.GetWinPhoneValue(Me.BorderColor)))
                {
                    this.BorderColor = Color.FromHex(OnPlatformString.GetWinPhoneValue(Me.BorderColor));
                }

                if (!String.IsNullOrEmpty(OnPlatformString.GetWinPhoneValue(Me.Image)))
                {
                    try
                    {
                        this.Image = ImageSource.FromFile(OnPlatformString.GetWinPhoneValue(Me.Image)) as FileImageSource;
                    }
                    catch (Exception ex)
                    {
                        System.Diagnostics.Debug.WriteLine("Error while trying to load button image {1}: {0} ", ex.Message, Me.Image);
                    }
                }


                this.Text = OnPlatformString.GetWinPhoneValue(Me.Text);

                if (!String.IsNullOrEmpty(OnPlatformString.GetWinPhoneValue(Me.TextColor)))
                {
                    this.TextColor = Color.FromHex(OnPlatformString.GetWinPhoneValue(Me.TextColor));
                }
            }


                );

            this.Clicked += Button_Clicked;
        }