public ButtonSpecificationsEditor() { this.Content = new StackLayout { Spacing = 5, Items = { new StackLayoutItem { Control = enable = new CheckBox { Text = "Enable", } }, new Group { Text = "Button Count", Orientation = Orientation.Horizontal, Content = buttonCount = new UnsignedIntegerNumberBox() } } }; enable.CheckedBinding.Cast <bool>().Bind( SpecificationsBinding.Convert( c => c != null, v => v ? new ButtonSpecifications() : null ) ); enable.CheckedBinding.Bind(buttonCount, b => b.Enabled); buttonCount.ValueBinding.Bind(SpecificationsBinding.Child(b => b.ButtonCount)); }
public DigitizerSpecificationsEditor() { this.Content = new StackLayout { HorizontalContentAlignment = HorizontalAlignment.Stretch, Spacing = 5, Padding = 5, Items = { new StackLayoutItem { Control = enable = new CheckBox { Text = "Enable" } }, new Group { Text = "Width (mm)", Orientation = Orientation.Horizontal, Content = width = new FloatNumberBox() }, new Group { Text = "Height (mm)", Orientation = Orientation.Horizontal, Content = height = new FloatNumberBox() }, new Group { Text = "Horizontal Resolution", Orientation = Orientation.Horizontal, Content = maxX = new FloatNumberBox() }, new Group { Text = "Vertical Resolution", Orientation = Orientation.Horizontal, Content = maxY = new FloatNumberBox() } } }; enable.CheckedBinding.Cast <bool>().Bind( SpecificationsBinding.Convert( c => c != null, v => v ? new DigitizerSpecifications() : null ) ); enable.CheckedBinding.Bind(width, c => c.Enabled); enable.CheckedBinding.Bind(height, c => c.Enabled); enable.CheckedBinding.Bind(maxX, c => c.Enabled); enable.CheckedBinding.Bind(maxY, c => c.Enabled); width.ValueBinding.Bind(SpecificationsBinding.Child <float>(c => c.Width)); height.ValueBinding.Bind(SpecificationsBinding.Child <float>(c => c.Height)); maxX.ValueBinding.Bind(SpecificationsBinding.Child <float>(c => c.MaxX)); maxY.ValueBinding.Bind(SpecificationsBinding.Child <float>(c => c.MaxY)); }
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)); }
public PenSpecificationsEditor() { 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 = "Button Count", Orientation = Orientation.Horizontal, Content = buttonCount = new UnsignedIntegerNumberBox() } } }; enable.CheckedBinding.Cast <bool>().Bind( SpecificationsBinding.Convert( c => c != null, v => v ? new PenSpecifications() : null ) ); enable.CheckedBinding.Bind(maxPressure, c => c.Enabled); enable.CheckedBinding.Bind(buttonCount, c => c.Enabled); maxPressure.ValueBinding.Bind(SpecificationsBinding.Child(c => c.MaxPressure)); buttonCount.ValueBinding.Bind(SpecificationsBinding.Child(c => c.Buttons.ButtonCount)); }