コード例 #1
0
        public override void OnElementChanged()
        {
            Controller = new VisualElementController(Element);
            base.OnElementChanged();

            BindColor(
                Control,
                Element,
                c => c.BackgroundColor,
                VisualElement.BackgroundColorProperty);

            Control.LoadComplete += (sender, args) => {
                Bind(
                    Control,
                    Element,
                    c => c.Height,
                    VisualElement.HeightRequestProperty);

                Bind(
                    Control,
                    Element,
                    c => c.Width,
                    VisualElement.WidthRequestProperty);
            };

            Bind(
                Control,
                Element,
                c => c.Enabled,
                VisualElement.IsEnabledProperty);

            Bind(
                Control,
                Element,
                c => c.Visible,
                VisualElement.IsVisibleProperty);

            EnabledBinding =
                Bind(
                    Control,
                    Element,
                    c => c.Enabled,
                    VisualElement.IsEnabledProperty
                    );
        }
コード例 #2
0
 public override void Clear()
 {
     base.Clear();
     EnabledBinding = null;
 }