Ejemplo n.º 1
0
        protected override void OnParentSet()
        {
            base.OnParentSet();
            //if (Url != null || Clicked != null)
            {
                var btn = new Button {
                    BackgroundColor = Color.Transparent
                };
                btn.SetValue(RowSpanProperty, 2);
                btn.SetValue(ColumnSpanProperty, 2);

                btn.Clicked += delegate {
                    if (Clicked != null)
                    {
                        var e = new MyButtonEventArgs();
                        Clicked.Invoke(this, e);

                        if (e.Handled)
                        {
                            return;
                        }
                    }

                    if (Url != null)
                    {
                        System.Mvc.Engine.Execute(Url);
                    }
                };

                this.Add(btn);
            }
        }
Ejemplo n.º 2
0
        public MyButton()
        {
            var btn = (Button)base.Insert(new Button {
                BackgroundColor = Color.Transparent,
            });

            btn.Clicked += (s, e) => {
                var arg = new MyButtonEventArgs();
                Clicked?.Invoke(arg);

                if (arg.Handled == false && Url != null)
                {
                    System.Mvc.Engine.Execute(Url);
                }
            };
        }