public void Setup() { BGStuff.setupGame = this; BGStuff.settingUpGame = true; settings = new GameSettings(); bluetooth.ReadMessage(); settings.Master = bluetooth.GetMaster(); settings.ConnectedDeviceName = bluetooth.GetConnectedDeviceName(); FileManager file = new FileManager(); if (settings.Master) { //if (file.CheckForExistingGame(settings.ConnectedDeviceName)) //{ // ResumeGame(); //} } else { entryNumOfShots.IsReadOnly = true; btnContinue.IsEnabled = false; pickerSizeOfBoard.IsEnabled = false; } Labels.Add(txtEnterName); Labels.Add(txtTitle); Labels.Add(txtSizeOfGrid); Labels.Add(txtNumOfShots); Entries.Add(entryNumOfShots); Entries.Add(entName); Buttons.Add(btnContinue); Pickers.Add(pickerSizeOfBoard); ApplyTheme(); }
public void SelectFolder(object source, RoutedEventArgs eventArgs) { var button = source as Button; if (button != null && !string.IsNullOrWhiteSpace(button?.Tag?.ToString())) { var propInfo = this.GetType().GetProperty(button.Tag.ToString()); var folder = Pickers.FolderPicker(); propInfo.SetValue(this, folder); } }
public LegendAndTitlesSample(PieChartSample chartSample) : base() { FlexPie chart = PieChartSampleFactory.GetFlexChartSample(chartSample); chart.HeaderText = EntryInputs.headerText; chart.HeaderFont = Font.SystemFontOfSize(30); chart.HeaderTextColor = Color.FromHex("#666666"); chart.FooterText = EntryInputs.footerText; chart.FooterFont = Font.SystemFontOfSize(15); chart.FooterTextColor = Color.FromHex("#666666"); chart.Legend.Position = Xuni.Xamarin.ChartCore.ChartPositionType.Bottom; RelativeLayout mainRelativeLayout = new RelativeLayout(); WrapLayout stepperStack = new WrapLayout(); stepperStack.Orientation = StackOrientation.Horizontal; Entry headerEntry = new Entry(); headerEntry.VerticalOptions = LayoutOptions.FillAndExpand; headerEntry.HorizontalOptions = LayoutOptions.FillAndExpand; stepperStack.Children.Add(EntryInputs.getHeaderEntry(chart)); stepperStack.Children.Add(EntryInputs.getFooterEntry(chart)); stepperStack.Children.Add(Pickers.GetLegendPositionPicker(chart)); mainRelativeLayout.Children.Add(stepperStack, Constraint.Constant(0), Constraint.Constant(0)); mainRelativeLayout.Children.Add(chart, Constraint.Constant(0), Constraint.RelativeToView(stepperStack, (parent, sibling) => { return(sibling.Y + sibling.Height); }), Constraint.RelativeToView(stepperStack, (parent, sibling) => { return(parent.Width); }), Constraint.RelativeToView(stepperStack, (parent, sibling) => { return(parent.Height - sibling.Height); })); // On Windows Phone,StackLayout and Picker will shrink automatically. // http://forums.xamarin.com/discussion/22436/picker-is-shrink-on-windows-phone-8 mainRelativeLayout.SizeChanged += (s, e) => { stepperStack.WidthRequest = mainRelativeLayout.Width; }; Content = mainRelativeLayout; }
public override void CopyFrom(BindableObject bindableObject) { base.CopyFrom(bindableObject); if (bindableObject is TimePickerStyle timePickerStyle) { Pickers.CopyFrom(timePickerStyle.Pickers); CellPadding = (timePickerStyle.CellPadding == null) ? new Size2D() : new Size2D(timePickerStyle.CellPadding.Width, timePickerStyle.CellPadding.Height); } }
public SelectionSample(PieChartSample chartSample) : base() { FlexPie chart = PieChartSampleFactory.GetFlexChartSample(chartSample); chart.SelectionMode = Xuni.Xamarin.ChartCore.ChartSelectionModeType.Point; chart.SelectedItemOffset = .2; chart.SelectedDashes = new double[] { 20, 10 }; chart.SelectedBorderColor = Color.FromRgb(255, 0, 0); chart.SelectedBorderWidth = 3; chart.SelectedItemPosition = Xuni.Xamarin.ChartCore.ChartPositionType.Top; chart.IsAnimated = true; RelativeLayout mainRelativeLayout = new RelativeLayout(); WrapLayout stepperStack = new WrapLayout(); stepperStack.Orientation = StackOrientation.Horizontal; stepperStack.Children.Add(Steppers.GetSelectedOffsetStepper(chart)); stepperStack.Children.Add(Pickers.GetSelectedItemPositionPicker(chart)); stepperStack.Children.Add(Switches.GetAnimatedSwitch(chart)); mainRelativeLayout.Children.Add(stepperStack, Constraint.Constant(0), Constraint.Constant(0)); mainRelativeLayout.Children.Add(chart, Constraint.Constant(0), Constraint.RelativeToView(stepperStack, (parent, sibling) => { return(sibling.Y + sibling.Height); }), Constraint.RelativeToView(stepperStack, (parent, sibling) => { return(parent.Width); }), Constraint.RelativeToView(stepperStack, (parent, sibling) => { return(parent.Height - sibling.Height); })); // On Windows Phone,StackLayout and Picker will shrink automatically. // http://forums.xamarin.com/discussion/22436/picker-is-shrink-on-windows-phone-8 mainRelativeLayout.SizeChanged += (s, e) => { stepperStack.WidthRequest = mainRelativeLayout.Width; }; Content = mainRelativeLayout; }
public SelectionModesSample(ChartSample chartSample) : base() { FlexChart chart = ChartSampleFactory.GetFlexChartSample(chartSample); chart.SelectedBorderColor = Color.FromRgb(255, 0, 0); chart.SelectedBorderWidth = 3; chart.SelectedDashes = new double[] { 20, 10 }; RelativeLayout mainRelativeLayout = new RelativeLayout(); WrapLayout pickerStack = new WrapLayout(); pickerStack.Orientation = StackOrientation.Horizontal; Picker chartType = Pickers.GetChartTypePicker(chart); Picker selectionType = Pickers.GetSelectionModeTypePicker(chart); chartType.SelectedIndex = 0; selectionType.SelectedIndex = 1; pickerStack.Children.Add(chartType); pickerStack.Children.Add(selectionType); mainRelativeLayout.Children.Add(pickerStack, Constraint.Constant(0), Constraint.Constant(0)); mainRelativeLayout.Children.Add(chart, Constraint.Constant(0), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return(sibling.Y + sibling.Height); }), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return(parent.Width); }), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return(parent.Height - sibling.Height); })); // On Windows Phone,StackLayout and Picker will shrink automatically. // http://forums.xamarin.com/discussion/22436/picker-is-shrink-on-windows-phone-8 mainRelativeLayout.SizeChanged += (s, e) => { pickerStack.WidthRequest = mainRelativeLayout.Width; }; Content = mainRelativeLayout; }
public ChartTypesSample(ChartSample chartSample) : base() { FlexChart chart = ChartSampleFactory.GetFlexChartSample(chartSample); RelativeLayout mainRelativeLayout = new RelativeLayout(); WrapLayout pickerStack = new WrapLayout(); pickerStack.Orientation = StackOrientation.Horizontal; Picker chartType = Pickers.GetChartTypePicker(chart); Picker stackingType = Pickers.GetChartStackingTypePicker(chart); Picker rotationType = Pickers.GetChartRotationTypePicker(chart); pickerStack.Children.Add(chartType); pickerStack.Children.Add(stackingType); pickerStack.Children.Add(rotationType); mainRelativeLayout.Children.Add(pickerStack, Constraint.Constant(0), Constraint.Constant(0)); mainRelativeLayout.Children.Add(chart, Constraint.Constant(0), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return(sibling.Y + sibling.Height); }), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return(parent.Width); }), Constraint.RelativeToView(pickerStack, (parent, sibling) => { return(parent.Height - sibling.Height); })); // On Windows Phone,StackLayout and Picker will shrink automatically. // http://forums.xamarin.com/discussion/22436/picker-is-shrink-on-windows-phone-8 mainRelativeLayout.SizeChanged += (s, e) => { pickerStack.WidthRequest = mainRelativeLayout.Width; }; Content = mainRelativeLayout; }
public void TimePicker() { Pickers Pickers = new Pickers(); Pickers.pickTime(8, 46, false, (int h, int m) => { Toast.make("Picked Time: " + h.ToString() + ":" + m.ToString(), Toast.LENGTH_SHORT); }); }
public void datePicker() { Pickers Pickers = new Pickers(); Pickers.pickDate(8, 11, 2018, (int d, int m, int y) => { Toast.make("Picked date: " + d.ToString() + "/" + m.ToString() + "/" + y.ToString(), Toast.LENGTH_SHORT); }); }