示例#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);
                }
            }
        }
示例#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);
            }
                );
        }
示例#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));
                }
            });
        }
示例#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;
        }
示例#5
0
        public void Init()
        {
            ViewHelper.DefaultViewProperties(this);

            this.Orientation = Me.Orientation;



            if (Me.Controls.Count > 0)
            {
                ProcessControl(Me.Controls[0]);
            }
        }
示例#6
0
文件: Label.cs 项目: dolani/CodeTorch
        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);
            }
                );
        }
示例#7
0
文件: Entry.cs 项目: dolani/CodeTorch
        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));
                }
            }
                );
        }
示例#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;
        }