Ejemplo n.º 1
0
        public PenSpecificationsEditor()
        {
            buttonSpecifications = new ButtonSpecificationsEditor();

            this.Content = new StackLayout
            {
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                Spacing = 5,
                Padding = 5,
                Items   =
                {
                    new StackLayoutItem
                    {
                        Control = enable = new CheckBox
                        {
                            Text = "Enable"
                        }
                    },
                    new Group
                    {
                        Text        = "Max Pressure",
                        Orientation = Orientation.Horizontal,
                        Content     = maxPressure = new UnsignedIntegerNumberBox()
                    },
                    new Group
                    {
                        Text        = "Active Report ID",
                        Orientation = Orientation.Horizontal,
                        Content     = activeReportId = new DetectionRangeBox()
                    },
                    buttonSpecifications
                }
            };

            enable.CheckedBinding.Cast <bool>().Bind(
                PenSpecificationsBinding.Convert(
                    c => c != null,
                    v => v ? new PenSpecifications() : null
                    )
                );
            enable.CheckedBinding.Bind(maxPressure, c => c.Enabled);
            enable.CheckedBinding.Bind(activeReportId, c => c.Enabled);
            enable.CheckedBinding.Bind(buttonSpecifications, c => c.Enabled);

            maxPressure.ValueBinding.Bind(PenSpecificationsBinding.Child(c => c.MaxPressure));
            activeReportId.ValueBinding.Bind(PenSpecificationsBinding.Child(c => c.ActiveReportID));
            buttonSpecifications.ButtonSpecificationsBinding.Bind(PenSpecificationsBinding.Child(c => c.Buttons));
        }
        public TabletSpecificationsEditor()
        {
            this.Content = new StackLayout
            {
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                Spacing = 5,
                Padding = 5,
                Items   =
                {
                    new Expander
                    {
                        Header  = "Digitizer",
                        Content = digitizer = new DigitizerSpecificationsEditor()
                    },
                    new Expander
                    {
                        Header  = "Pen",
                        Content = pen = new PenSpecificationsEditor()
                    },
                    new Expander
                    {
                        Header  = "Auxiliary Buttons",
                        Padding = 5,
                        Content = auxButtons = new ButtonSpecificationsEditor()
                    },
                    new Expander
                    {
                        Header  = "Touch",
                        Content = touch = new DigitizerSpecificationsEditor()
                    },
                    new Expander
                    {
                        Header  = "Mouse",
                        Padding = 5,
                        Content = mouseButtons = new ButtonSpecificationsEditor()
                    }
                }
            };

            digitizer.SpecificationsBinding.Bind(SpecificationsBinding.Child(c => c.Digitizer));
            pen.SpecificationsBinding.Bind(SpecificationsBinding.Child(c => c.Pen));
            auxButtons.SpecificationsBinding.Bind(SpecificationsBinding.Child(c => c.AuxiliaryButtons));
            touch.SpecificationsBinding.Bind(SpecificationsBinding.Child(c => c.Touch));
            mouseButtons.SpecificationsBinding.Bind(SpecificationsBinding.Child(c => c.MouseButtons));
        }