public PickerInput(Viewform view, ListItem item) : base(view, item) { Picker picker = new Picker { Title = ThisItem.Name, VerticalOptions = LayoutOptions.CenterAndExpand }; // Use boolitem instead of ActivityItem foreach (string option in item.Options) { picker.Items.Add(option); } picker.SelectedIndexChanged += (sender, args) => { if (picker.SelectedIndex == -1) { SetInput(null); } else { SetInput(picker.Items[picker.SelectedIndex]); } }; this.Children.Add(picker); }
public SwitchInput(Viewform view, BoolItem item) : base(view, item) { Style = (Style)Application.Current.Resources["SwitchLayout"]; // Add the switch title if (ThisItem.Name != null && !ThisItem.Name.Equals("")) { Label labelTitle = new Label { Text = ThisItem.Name, Style = (Style)Application.Current.Resources["SwitchTitle"] }; this.Children.Add(labelTitle); } // Create Layout for the switch buttons StackLayout switchButtons = new StackLayout { Style = (Style)Application.Current.Resources["SwitchButtons"] }; // Create buttons Label labelOption1; Frame fOne = CreateButton(item.OptionOne, out labelOption1); Label labelOption2; Frame fTwo = CreateButton(item.OptionTwo, out labelOption2); // Make the buttons tappable AddFunctionToButton(fOne, labelOption1, fTwo, labelOption2, item.OptionOne); AddFunctionToButton(fTwo, labelOption2, fOne, labelOption1, item.OptionTwo); switchButtons.Children.Add(fOne); switchButtons.Children.Add(fTwo); this.Children.Add(switchButtons); }
public EntryInput(Viewform view, TextItem item) : base(view, item) { limit = item.board; CreateEntry(); }
public InputItem(Viewform view, ActivityItem item) { ThisView = view; ThisItem = item; }