void ReleaseDesignerOutlets () { if (innerRadiusLabel != null) { innerRadiusLabel.Dispose (); innerRadiusLabel = null; } if (offsetSlider != null) { offsetSlider.Dispose (); offsetSlider = null; } if (pieChart != null) { pieChart.Dispose (); pieChart = null; } if (reversedSwitch != null) { reversedSwitch.Dispose (); reversedSwitch = null; } if (startAngleSlider != null) { startAngleSlider.Dispose (); startAngleSlider = null; } if (stepper != null) { stepper.Dispose (); stepper = null; } }
public override void ViewDidLoad() { base.ViewDidLoad (); _stepper = new UIStepper(); View.AddSubview(_stepper); View.SetStyleClass("sample-background"); _stepper.SetStyleId("sample-stepper"); }
public StepperView() : base(new System.Drawing.RectangleF(0,0,300,40)) { captionLabel = new UILabel (); valueLabel = new UILabel (); stepper = new UIStepper (); base.AddSubview (captionLabel); base.AddSubview (valueLabel); base.AddSubview (stepper); valueLabel.Text = stepper.Value.ToString(); stepper.ValueChanged += delegate { valueLabel.Text = stepper.Value.ToString(); }; }
void ReleaseDesignerOutlets () { if (flexPie != null) { flexPie.Dispose (); flexPie = null; } if (isAnimatedSwitch != null) { isAnimatedSwitch.Dispose (); isAnimatedSwitch = null; } if (offsetLabel != null) { offsetLabel.Dispose (); offsetLabel = null; } if (positionSelector != null) { positionSelector.Dispose (); positionSelector = null; } if (stepper != null) { stepper.Dispose (); stepper = null; } }
partial void valueChanged (UIStepper sender);
partial void stepperClicked(UIStepper sender) { pieChart.SelectedItemOffset = stepper.Value; offsetLabel.Text = stepper.Value.ToString(); }
public static void All() { var x1 = new UIButton(); x1.TouchUpInside += (s, e) => { }; var x2 = new UISlider(); x2.ValueChanged += (s, e) => { }; var x3 = new UIStepper(); x3.ValueChanged += (s, e) => { }; var x4 = new UISwitch(); x4.ValueChanged += (s, e) => { }; var x5 = new UITextField(); x5.Text = x5.Text; x5.EditingChanged += (s, e) => { }; var x6 = new UIView(); x6.Hidden = x6.Hidden; x6.Frame = x6.Frame; x6.TintColor = x6.TintColor; x6.BackgroundColor = x6.BackgroundColor; x6.Alpha = x6.Alpha; x6.UserInteractionEnabled = x6.UserInteractionEnabled; var x7 = new UIViewController(); x7.Title = x7.Title; var x8 = new UIDatePicker(); x8.Date = x8.Date; var x9 = new UIProgressView(); x9.Progress = x9.Progress; x9.ProgressTintColor = x9.ProgressTintColor; x9.TrackTintColor = x9.TrackTintColor; var x10 = new UIImageView(); x10.Image = x10.Image; var x11 = new UILabel(); x11.Text = x11.Text; x11.TextColor = x11.TextColor; var x12 = new UISegmentedControl(); x12.SelectedSegment = x12.SelectedSegment; var x13 = new UISlider(); x13.Value = x13.Value; x13.MaxValue = x13.MaxValue; x13.MinValue = x13.MinValue; var x14 = new UIStepper(); x14.Value = x14.Value; x14.MaximumValue = x14.MaximumValue; x14.MinimumValue = x14.MinimumValue; var x15 = new UISwitch(); x15.On = x15.On; var x16 = new UITextView(); x16.Text = x16.Text; x16.Changed += (sender, e) => { }; }
public static string BindValue(this UIStepper uiStepper) => MvxIosPropertyBinding.UIStepper_Value;
public void Include(UIStepper s) { s.Value = s.Value + 1; }
public override void ViewDidLoad() { base.ViewDidLoad (); this.Title = "GL Performance Cube"; _testButton = new UIBarButtonItem ("Test", UIBarButtonItemStyle.Bordered, testButtonClicked); this.NavigationItem.RightBarButtonItem = _testButton; _setupGLView (); RectangleF rect = _view.Bounds; rect.X = 10; rect.Width -= 20; rect.Y = rect.Height - 35; rect.Height = 25; _numTrisLabel = new UILabel (rect); _numTrisLabel.Text = "triangles = " + ((_triangles) / 3); _numTrisLabel.BackgroundColor = UIColor.Clear; _numTrisLabel.TextColor = UIColor.White; _numTrisLabel.AutoresizingMask = UIViewAutoresizing.FlexibleTopMargin; _view.AddSubview (_numTrisLabel); _numTrisStepper = new UIStepper (rect); _numTrisStepper.AutoresizingMask = UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleLeftMargin; _numTrisStepper.MinimumValue = 0; rect.X = rect.Width - _numTrisStepper.Bounds.Width; _numTrisStepper.Frame = rect; _numTrisStepper.ValueChanged += HandleNumTrisStepperChanged; _view.AddSubview (_numTrisStepper); rect.X = 10; rect.Y -= 35; _fpLabel = new UILabel (rect); _fpLabel.Text = string.Empty; _fpLabel.BackgroundColor = UIColor.Clear; _fpLabel.TextColor = UIColor.White; _fpLabel.AutoresizingMask = UIViewAutoresizing.FlexibleTopMargin; _view.AddSubview (_fpLabel); }
private string GetStepperLabelText(UIStepper stepper) { return(((int)stepper.Value).ToString()); }
partial void PageNumberChanged(UIStepper sender) { this.pageNumberLabel.Text = "Page number: " + sender.Value.ToString(); this.currentPageNumber = (int)sender.Value; }
public virtual bool SetValue(string arg1, string arg2 = "") { double val = Utils.ConvertToDouble(arg1); CurrVal = val; if (m_viewY is UIStepper) { UIStepper stepper = m_viewY as UIStepper; stepper.Value = val; UIView[] subviews = m_viewX.Subviews; foreach (UIView view in subviews) { if (view is UILabel) { UILabel label = view as UILabel; label.Text = CurrVal.ToString(); } } } else if (WidgetType == UIType.COMBOBOX) { switch (arg1) { case "alignment": Tuple <UIControlContentHorizontalAlignment, UITextAlignment> al = UtilsiOS.GetAlignment(arg2); m_button.HorizontalAlignment = al.Item1; break; case "backgroundcolorpicker": m_picker.BackgroundColor = UtilsiOS.String2Color(arg2); break; case "backgroundcolorbutton2": m_button2.BackgroundColor = UtilsiOS.String2Color(arg2); break; case "fontcolor2": m_button2.SetTitleColor(UtilsiOS.String2Color(arg2), UIControlState.Normal); break; case "text2": m_button2.SetTitle(arg2 + "\t", UIControlState.Normal); break; } if (string.IsNullOrEmpty(arg1) || arg1 == "value") { SetComboboxText("", (int)val); } } else if (m_viewX is UISwitch) { ((UISwitch)m_viewX).On = (int)val == 1; } else if (m_viewX is UISlider) { ((UISlider)m_viewX).Value = (float)val; } else if (m_viewX is UIStepper) { ((UIStepper)m_viewX).Value = (float)val; } else if (m_viewX is UIPickerView) { UIPickerView picker = m_viewX as UIPickerView; picker.Select((int)val, 0, true); TypePickerViewModel model = picker.Model as TypePickerViewModel; model?.Selected(picker, (int)val, 0); } else if (m_viewX is UISegmentedControl) { ((UISegmentedControl)m_viewX).SelectedSegment = (nint)val; } else { return(false); } return(true); }
partial void homeScoreValueChanged(UIStepper sender) { this.homeScore.Text = this.homeScoreStepper.Value.ToString(); }
partial void ballsStepperChanged(UIStepper sender) { this.UpdateTextValue(sender.Value, this.txtBalls); }
private void resetScore(UIStepper field, UITextField textField) { field.Value = 0; textField.Text = "0"; }
partial void visitorScoreStepperStep(UIStepper sender) { this.vistorScore.Text = this.vistorScoreStepper.Value.ToString(); }
partial void inningStepperValueChanged(UIStepper sender) { this.UpdateTextValue(sender.Value, this.txtInning); }
private void InitInsuranceInfo() { RectangleF antallStepperRect; RectangleF cashValueRect; RectangleF antallRect; RectangleF currencyRect; RectangleF showReceiptsRect; RectangleF deleteBtnRect; float x; float y; if (UserInterfaceIdiomIsPhone) { //x and y under the representative image; x = 10; y = 750; } else { //on the right in a second collumn x = 500; y = 80; } const float margin = 0; const float broad = 100; const float lineheight = 30; const float linebuffer = 10; antallRect = new RectangleF (x, y, broad, lineheight); antallStepperRect = new RectangleF (x + broad, y, broad, lineheight); currencyRect = new RectangleF (x + margin, y + linebuffer + lineheight, broad, lineheight); cashValueRect = new RectangleF (x + margin +broad, y + linebuffer + lineheight, broad, lineheight); showReceiptsRect = new RectangleF (x + margin, y + linebuffer * 2 + lineheight * 2, broad * 2, lineheight); deleteBtnRect = new RectangleF (x + margin, y + linebuffer * 3 + lineheight * 3, broad * 2, lineheight); antall = new UILabel (antallRect); Add (antall); antallStepper = new UIStepper (antallStepperRect); Add (antallStepper); currency = new UILabel (currencyRect); Add (currency); this.cashValue = new UITextField (cashValueRect); //this.cashValue.KeyboardType = UIKeyboardType.DecimalPad; ///this pissant keyboard has no dissmiss dammit Add (cashValue); showReceipts = new UIButton (UIButtonType.RoundedRect); showReceipts.Frame = showReceiptsRect; Add (showReceipts); deleteBtn = new UIButton (UIButtonType.RoundedRect); deleteBtn.Frame = deleteBtnRect; Add (deleteBtn); }
public void CreateStepper(CGRect rect, string extraLabel) { UIView parent = GetParentView(); WidgetType = UIVariable.UIType.STEPPER; UILabel label = null; int stepperX = (int)(10 * UtilsiOS.WidthMultiplier()); int stepperY = (int)(4 * UtilsiOS.WidthMultiplier()); int labelSize = (int)rect.Height; CGRect stepRect = new CGRect(stepperX, stepperY, rect.Width, rect.Height); UIStepper stepper = new UIStepper(stepRect); m_viewX = new UIView(rect); if (!string.IsNullOrWhiteSpace(extraLabel)) { extraLabel = extraLabel.ToLower(); nfloat labelWidth = rect.Width - stepper.Bounds.Width; nfloat labelHeight = stepper.Bounds.Height; if (extraLabel.EndsWith("left")) { stepperX = 0; CGRect labelRect = new CGRect(stepperX, stepperY, labelWidth, labelHeight); label = new UILabel(labelRect); label.TextAlignment = UITextAlignment.Left; stepRect = new CGRect(stepperX + labelWidth, stepperY, stepper.Bounds.Width, stepper.Bounds.Height); stepper = new UIStepper(stepRect); } else { CGRect labelRect = new CGRect(stepperX + stepper.Bounds.Width, stepperY, labelWidth, labelHeight); label = new UILabel(labelRect); label.TextAlignment = UITextAlignment.Right; } label.Text = CurrVal.ToString(); label.TextAlignment = UITextAlignment.Center; //label.SizeToFit(); m_viewX.AddSubview(label); } // "5:3:50:1" double curr = 0, min = 0, max = 0, step = 0; Utils.Extract(extraLabel, ref curr, ref min, ref max, ref step); CurrVal = curr; MinVal = min; MaxVal = max; Step = step; stepper.MinimumValue = (float)MinVal; stepper.MaximumValue = (float)MaxVal; stepper.Value = (float)CurrVal; stepper.StepValue = (float)Step; m_viewX.AddSubview(stepper); //m_viewY = stepper; stepper.ValueChanged += (sender, e) => { CurrVal = stepper.Value; if (label != null) { label.Text = CurrVal.ToString(); } ActionDelegate?.Invoke(WidgetName, CurrVal.ToString()); }; }
partial void outStepperChanged(UIStepper sender) { this.UpdateTextValue(sender.Value, this.txtOuts); }
partial void valueChanged (UIStepper sender) { pieChart.InnerRadius = stepper.Value; innerRadiusLabel.Text = stepper.Value.ToString(); innerRadiusLabel.SizeToFit(); }
partial void stepperChanged(UIStepper sender);
partial void PercentageStepperValueChanged(UIStepper sender) { Data.Percentage = Convert.ToInt32(sender.Value); ReloadData(); }
partial void valueChanged(UIStepper sender) { pieChart.InnerRadius = stepper.Value; innerRadiusLabel.Text = stepper.Value.ToString(); innerRadiusLabel.SizeToFit(); }
partial void valueChanged(UIStepper sender);
public override void ViewDidLoad() { base.ViewDidLoad(); using (UIScrollView scrollView = new UIScrollView(new CGRect(0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height))) { foreach (MembresiaModel membresia in new PickerItemsController().GetMembresias()) { double subtotal = membresia.Membresia_Precio_Base; Membresias.Add(membresia.Membresia_Id, new CarritoModel { Membresia_Cantidad = 0, Sucursal_Id = 0 }); if (Carrito.ContainsKey(membresia.Membresia_Id)) { if (DateTime.Parse(Carrito[membresia.Membresia_Id].Membresia_Fecha_Inicio) >= DateTime.Now) { Membresias[membresia.Membresia_Id].Membresia_Cantidad = (int)Carrito[membresia.Membresia_Id].Membresia_Cantidad; Membresias[membresia.Membresia_Id].Sucursal_Id = Carrito[membresia.Membresia_Id].Sucursal_Id; Membresias[membresia.Membresia_Id].Membresia_Fecha_Inicio = Carrito[membresia.Membresia_Id].Membresia_Fecha_Inicio; CanPay = true; } } scrollView.AddSubview(new STLLine(size)); size += 10; UILabel lblMembresia = new STLLabel(membresia.Membresia_Descripcion, size, 14) { Frame = new CGRect(10, size, UIScreen.MainScreen.Bounds.Width / 2 + 30, 30), Text = membresia.Membresia_Descripcion }; scrollView.AddSubview(lblMembresia); UITextField txtCantidad = new UITextField { Text = Membresias[membresia.Membresia_Id].Membresia_Cantidad.ToString(), Frame = new CGRect(UIScreen.MainScreen.Bounds.Width - 120, size, 30, 30), Font = UIFont.SystemFontOfSize(14), KeyboardType = UIKeyboardType.NumberPad }; scrollView.AddSubview(txtCantidad); UIStepper stpMembresia = new UIStepper { Frame = new CGRect(UIScreen.MainScreen.Bounds.Width - 100, size, 55, 30), Value = Membresias[membresia.Membresia_Id].Membresia_Cantidad, MaximumValue = Convert.ToDouble(membresia.Membresia_Espacios_Disponibles) }; scrollView.AddSubview(stpMembresia); size += 45; /// scrollView.AddSubview(new STLLabel("Tarifa Mensual", size)); scrollView.AddSubview(new STLLabel(membresia.Membresia_Precio_Base.ToString("C")) { Frame = new CGRect(UIScreen.MainScreen.Bounds.Width * 2 / 3, size, UIScreen.MainScreen.Bounds.Width / 4, 30) }); size += 45; scrollView.AddSubview(new STLLabel("Tarifa Inscripción", size)); scrollView.AddSubview(new STLLabel(membresia.Inscripcion_Precio_Base.ToString("C")) { Frame = new CGRect(UIScreen.MainScreen.Bounds.Width * 2 / 3, size, UIScreen.MainScreen.Bounds.Width / 4, 30) }); /// size += 45; UITextField txtSucursal = new STLTextField("Sucursal", size) { Text = Carrito.ContainsKey(membresia.Membresia_Id) ? Carrito[membresia.Membresia_Id].Sucursal_Descripcion : "" }; txtSucursal.EditingDidBegin += (sender, e) => { selectView = new UIDropdownList(txtSucursal, View); }; txtSucursal.EditingDidEnd += (sender, e) => { Membresias[membresia.Membresia_Id].Sucursal_Id = new SucursalController().GetSucursalId(txtSucursal.Text); selectView.RemoveFromSuperview(); }; scrollView.AddSubview(txtSucursal); size += 40; scrollView.AddSubview(new STLLabel("Fecha de Inicio", size, 14)); size += 30; UIDatePicker dpFechaInicio = new UIDatePicker { Mode = UIDatePickerMode.Date, Frame = new CGRect(40, size, UIScreen.MainScreen.Bounds.Width - 80, 100), Date = !string.IsNullOrEmpty(Membresias[membresia.Membresia_Id].Membresia_Fecha_Inicio) ? (NSDate)DateTime.SpecifyKind(DateTime.Parse(Membresias[membresia.Membresia_Id].Membresia_Fecha_Inicio), DateTimeKind.Utc) : (NSDate)DateTime.Now, MinimumDate = (NSDate)DateTime.Now }; scrollView.Add(dpFechaInicio); size += 100; ///// UILabel lblMeses = new STLLabel("Cantidad de meses", size, 14); scrollView.AddSubview(lblMeses); UITextField txtMesesCantidad = new UITextField { Text = "1", Frame = new CGRect(UIScreen.MainScreen.Bounds.Width - 120, size, 30, 30), Font = UIFont.SystemFontOfSize(14), KeyboardType = UIKeyboardType.NumberPad }; scrollView.AddSubview(txtMesesCantidad); UIStepper stpMesesMembresia = new UIStepper { Frame = new CGRect(UIScreen.MainScreen.Bounds.Width - 100, size, 55, 30), MinimumValue = 1 }; scrollView.AddSubview(stpMesesMembresia); UILabel lblProporcional = new STLLabel(subtotal.ToString("C")), lblTotal = new STLLabel((membresia.Membresia_Precio_Base * stpMesesMembresia.Value).ToString("C")); stpMesesMembresia.ValueChanged += (sender, e) => { txtMesesCantidad.Text = stpMesesMembresia.Value.ToString(); lblTotal.Text = (((membresia.Membresia_Precio_Base * (Convert.ToDouble(txtMesesCantidad.Text) - 1)) + subtotal + (membresia.Inscripcion_Precio_Base * (Convert.ToDouble(txtMesesCantidad.Text) - 1))) * Convert.ToDouble(txtCantidad.Text)).ToString("C"); }; txtMesesCantidad.EditingChanged += (sender, e) => { if (!string.IsNullOrEmpty(txtMesesCantidad.Text) || txtMesesCantidad.Text != "0") { lblTotal.Text = (((membresia.Membresia_Precio_Base * (Convert.ToDouble(txtMesesCantidad.Text) - 1)) + subtotal + (membresia.Inscripcion_Precio_Base * (Convert.ToDouble(txtMesesCantidad.Text) - 1))) * Convert.ToDouble(txtCantidad.Text)).ToString("C"); } }; size += 45; scrollView.AddSubview(new STLLabel("Proporcional al mes", size)); subtotal = (membresia.Membresia_Precio_Base / DateHelper.GetMonthsDays((DateTime)dpFechaInicio.Date) * (DateHelper.GetMonthsDays((DateTime)dpFechaInicio.Date) - ((DateTime)dpFechaInicio.Date).Day + 1)); lblTotal.Text = (((membresia.Membresia_Precio_Base * (Convert.ToDouble(txtMesesCantidad.Text) - 1)) + subtotal + (membresia.Inscripcion_Precio_Base * (Convert.ToDouble(txtMesesCantidad.Text) - 1))) * Convert.ToDouble(txtCantidad.Text)).ToString("C"); lblProporcional.Text = (subtotal * Convert.ToDouble(txtCantidad.Text)).ToString("C"); lblProporcional.Frame = new CGRect(UIScreen.MainScreen.Bounds.Width * 2 / 3, size, UIScreen.MainScreen.Bounds.Width / 4, 30); stpMembresia.ValueChanged += (sender, e) => { txtCantidad.Text = stpMembresia.Value.ToString(); Membresias[membresia.Membresia_Id].Membresia_Cantidad = (int)stpMembresia.Value; CanPay = (stpMembresia.Value > 0); Changed = CanPay; double EndMonth = DateHelper.GetMonthsDays((DateTime)dpFechaInicio.Date); double currentDay = ((DateTime)dpFechaInicio.Date).Day; subtotal = Convert.ToInt32(txtCantidad.Text) == 0 ? 0 : (membresia.Membresia_Precio_Base / EndMonth * (EndMonth - currentDay + 1)); lblProporcional.Text = subtotal.ToString("C"); lblTotal.Text = (((membresia.Membresia_Precio_Base * (Convert.ToDouble(txtMesesCantidad.Text) - 1)) + subtotal + (membresia.Inscripcion_Precio_Base * (Convert.ToDouble(txtMesesCantidad.Text) - 1))) * Convert.ToDouble(txtCantidad.Text)).ToString("C"); }; txtCantidad.EditingChanged += (sender, e) => { if (!string.IsNullOrEmpty(txtCantidad.Text)) { if (Convert.ToDouble(txtCantidad.Text) > Convert.ToDouble(membresia.Membresia_Espacios_Disponibles)) { new MessageDialog().SendMessage("Tamaño de " + membresia.Membresia_Descripcion, "Superaste el tamaño permitido"); txtCantidad.Text = membresia.Membresia_Espacios_Disponibles; } double EndMonth = DateHelper.GetMonthsDays((DateTime)dpFechaInicio.Date); double currentDay = ((DateTime)dpFechaInicio.Date).Day; subtotal = Convert.ToInt32(txtCantidad.Text) == 0 ? 0 : (membresia.Membresia_Precio_Base / EndMonth * (EndMonth - currentDay + 1)); lblProporcional.Text = subtotal.ToString("C"); lblTotal.Text = (((membresia.Membresia_Precio_Base * (Convert.ToDouble(txtMesesCantidad.Text) - 1)) + subtotal + (membresia.Inscripcion_Precio_Base * (Convert.ToDouble(txtMesesCantidad.Text) - 1))) * Convert.ToDouble(txtCantidad.Text)).ToString("C"); stpMembresia.Value = Convert.ToDouble(txtCantidad.Text); Membresias[membresia.Membresia_Id].Membresia_Cantidad = (int)stpMembresia.Value; CanPay = (stpMembresia.Value > 0); Changed = CanPay; } }; txtMesesCantidad.EditingChanged += (sender, e) => { if (!string.IsNullOrEmpty(txtMesesCantidad.Text)) { if (Convert.ToInt32(txtMesesCantidad.Text) < 1) { new MessageDialog().SendMessage("La cantidad de meses a contratar debe ser mínimo 1", "Meses de membresias"); txtMesesCantidad.Text = "1"; } double EndMonth = DateHelper.GetMonthsDays((DateTime)dpFechaInicio.Date); double currentDay = ((DateTime)dpFechaInicio.Date).Day; subtotal = Convert.ToInt32(txtMesesCantidad.Text) == 0 ? 0 : (membresia.Membresia_Precio_Base / EndMonth * (EndMonth - currentDay + 1)); lblProporcional.Text = subtotal.ToString("C"); lblTotal.Text = (((membresia.Membresia_Precio_Base * (Convert.ToDouble(txtMesesCantidad.Text) - 1)) + subtotal + (membresia.Inscripcion_Precio_Base * (Convert.ToDouble(txtMesesCantidad.Text) - 1))) * Convert.ToDouble(txtCantidad.Text)).ToString("C"); stpMesesMembresia.Value = Convert.ToDouble(txtMesesCantidad.Text); Membresias[membresia.Membresia_Id].Membresia_Cantidad = (int)stpMesesMembresia.Value; CanPay = (stpMesesMembresia.Value > 0); Changed = CanPay; } }; dpFechaInicio.ValueChanged += (sender, e) => { double EndMonth = DateHelper.GetMonthsDays(((DateTime)(((UIDatePicker)sender).Date))); double currentDay = ((DateTime)(((UIDatePicker)sender).Date)).Day; subtotal = Convert.ToInt32(txtCantidad.Text) == 0 ? 0 : (membresia.Membresia_Precio_Base / EndMonth * (EndMonth - currentDay + 1)); lblProporcional.Text = subtotal.ToString("C"); lblTotal.Text = (((membresia.Membresia_Precio_Base * (Convert.ToDouble(txtMesesCantidad.Text) - 1)) + subtotal + (membresia.Inscripcion_Precio_Base * (Convert.ToDouble(txtMesesCantidad.Text) - 1))) * Convert.ToDouble(txtCantidad.Text)).ToString("C"); }; scrollView.AddSubview(lblProporcional); size += 45; scrollView.AddSubview(new STLLabel("Total", size)); lblTotal.Frame = new CGRect(UIScreen.MainScreen.Bounds.Width * 2 / 3, size, UIScreen.MainScreen.Bounds.Width / 4, 30); scrollView.AddSubview(lblTotal); /// size += 45; } scrollView.ContentSize = new CGSize(UIScreen.MainScreen.Bounds.Width, size + 30); View.AddSubview(scrollView); } NavigationItem.SetRightBarButtonItem(new UIBarButtonItem(UIImage.FromBundle("ic_shopping_cart"), UIBarButtonItemStyle.Plain, (sender, e) => { if (CanPay) { if (new CarritoController().AddCarrito(Membresias, TiposServicios.Membresia, KeyChainHelper.GetKey("Usuario_Id"))) { CarritoCompraController controller = (CarritoCompraController)Storyboard.InstantiateViewController("CarritoCompraController"); controller.Title = "Confirmación de compra"; NavigationController.PushViewController(controller, true); } else { new MessageDialog().SendMessage("Debe de seleccionar alguna sucursal", "Aviso"); } } else { new MessageDialog().SendMessage("Debe de seleccionar alguna membresía", "Aviso"); } }), true); NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Cancel, (sender, e) => { if (Changed) { if (new CarritoController().AddCarrito(Membresias, TiposServicios.Membresia, KeyChainHelper.GetKey("Usuario_Id"))) { NavigationController.PopViewController(true); } else { new MessageDialog().SendMessage("Debe de seleccionar alguna sucursal", "Aviso"); } } else { NavigationController.PopViewController(true); } }), true); }
partial void NudgeValue(Foundation.NSObject sender) { UIStepper stepper = (UIStepper)sender; nudgeValueCallback(this, stepper.Value); }
public UIStepper AddStepper(string name, UIColor backgroundColor) { var stepper = new UIStepper (); stepper.BackgroundColor = backgroundColor; stepper.Frame = DefaultFrame (); stepper.TranslatesAutoresizingMaskIntoConstraints = false; OurConstraints.ViewNames.Add (new NSString (name)); OurConstraints.Views.Add (stepper); this.Add (stepper); return stepper; }
public override void ViewDidLoad() { base.ViewDidLoad (); //scrollView = stackView.Superview as UIScrollView; //scrollView.KeyboardDismissMode = UIScrollViewKeyboardDismissMode.OnDrag; //scrollView.ScrollEnabled = true; // Set up Navigation Bar var saveButton = new UIBarButtonItem (UIBarButtonSystemItem.Save, save); var cancelButton = new UIBarButtonItem (UIBarButtonSystemItem.Cancel, cancel); NavigationItem.Title = "New Medication:"; NavigationItem.RightBarButtonItem = saveButton; NavigationItem.HidesBackButton = true; NavigationItem.LeftBarButtonItem = cancelButton; //NSNotificationCenter.DefaultCenter.AddObserver (this, new ObjCRuntime.Selector("keyboardDidAppear:"), UIKeyboard.DidShowNotification, null); //NSNotificationCenter.DefaultCenter.AddObserver (this, new ObjCRuntime.Selector ("keyboardWillDissapear:"), UIKeyboard.WillHideNotification, null); // Set up the date formatter dateFormat = new NSDateFormatter(); dateFormat.DateStyle = NSDateFormatterStyle.None; dateFormat.TimeStyle = NSDateFormatterStyle.Short; // Set up new pet form nameField = new UITextField(); nameField.Text = "Medication Name"; nameField.BorderStyle = UITextBorderStyle.RoundedRect; nameField.ReturnKeyType = UIReturnKeyType.Done; medTypeLabel = new UILabel (); medTypeLabel.Text = "Type of Medication"; medTypeButton = new UIButton (UIButtonType.RoundedRect); medTypeButton.AddTarget (editMedType, UIControlEvent.TouchUpInside); medTypeButton.SetTitle ("Pill", UIControlState.Normal); medTypeButton.TitleLabel.Font = medTypeButton.TitleLabel.Font.WithSize (medTypeLabel.Font.PointSize); medTypePicker = new UIPickerView (); medTypePicker.Delegate = new MedTypePickerDelegate (this); medTypePicker.DataSource = new MedTypePickerDataSource (); freqLabel = new UILabel (); freqLabel.Text = "Frequency"; freqTextField = new UITextField (); freqTextField.Text = "1"; freqTextField.KeyboardType = UIKeyboardType.NumberPad; freqTextField.BorderStyle = UITextBorderStyle.RoundedRect; freqTextField.Enabled = false; freqTextField.AddTarget (freqTextFieldChanged, UIControlEvent.EditingDidEnd | UIControlEvent.EditingDidEndOnExit); freqStepper = new UIStepper (); freqStepper.Value = 1; freqStepper.MinimumValue = 1; freqStepper.Enabled = false; freqStepper.AddTarget (freqStepperIncremented, UIControlEvent.ValueChanged); UIStackView freqStackView = new UIStackView (new UIView[] { freqTextField, freqStepper }); freqStackView.Spacing = 8; freqStackView.Axis = UILayoutConstraintAxis.Horizontal; freqButton = new UIButton (UIButtonType.RoundedRect); freqButton.SetTitle ("Daily", UIControlState.Normal); freqButton.TitleLabel.Font = freqButton.TitleLabel.Font.WithSize (medTypeLabel.Font.PointSize); freqButton.AddTarget (editFrequency, UIControlEvent.TouchUpInside); freqPicker = new UIPickerView (); freqPicker.Delegate = new MedFreqPickerDelegate (this); freqPicker.DataSource = new MedFreqPickerDataSource (); timePicker = new UIDatePicker (); gregorian = new NSCalendar (NSCalendarType.Gregorian); timePicker.Date = gregorian.DateBySettingsHour (9, 0, 0, NSDate.Now, NSCalendarOptions.MatchNextTime); timePicker.Mode = UIDatePickerMode.Time; timePicker.AddTarget (timePickerChanged, UIControlEvent.AllEvents); UILabel timeLabel = new UILabel (); timeLabel.Text = "Time"; timeButtons = new UIButton[1]; timeDates = new NSDate[1]; timeDates [0] = gregorian.DateBySettingsHour (9, 0, 0, NSDate.Now, NSCalendarOptions.MatchNextTime); timeButtons [0] = new UIButton (UIButtonType.RoundedRect); timeButtons [0].SetTitle ("9:00 AM", UIControlState.Normal); timeButtons [0].AddTarget (openTimePicker, UIControlEvent.TouchUpInside); timeStack = new UIStackView (); timeStack.Alignment = UIStackViewAlignment.Leading; timeStack.Distribution = UIStackViewDistribution.FillProportionally; timeStack.Spacing = 5; timeStack.Axis = UILayoutConstraintAxis.Vertical; timeStack.AddArrangedSubview (timeLabel); foreach (var button in timeButtons) { timeStack.AddArrangedSubview (button); } timeStack.AddArrangedSubview (timePicker); timePicker.Hidden = true; dayLabel = new UILabel (); dayLabel.Text = "Day"; dayLabel.Hidden = true; dayButton = new UIButton (UIButtonType.RoundedRect); var day = gregorian.GetComponentFromDate (NSCalendarUnit.Weekday, NSDate.Now); dayButton.SetTitle (gregorian.WeekdaySymbols[day], UIControlState.Normal); dayButton.AddTarget (openDayPicker, UIControlEvent.TouchUpInside); dayButton.Hidden = true; dayPicker = new UIDatePicker (); dayPicker.Mode = UIDatePickerMode.Date; dayPicker.MinimumDate = NSDate.Now; dayPicker.MaximumDate = NSDate.Now.AddSeconds (604800); dayPicker.AddTarget (dayPickerChanged, UIControlEvent.AllEvents); dayPicker.Hidden = true; prescriptionLengthLabel = new UILabel (); prescriptionLengthLabel.Text = "Prescription Length"; prescriptionLengthTextField = new UITextField (); prescriptionLengthTextField.Text = "20"; prescriptionLengthTextField.AddTarget (prescriptionTextFieldChanged, UIControlEvent.EditingDidEnd | UIControlEvent.EditingDidEndOnExit); prescriptionLengthTextField.KeyboardType = UIKeyboardType.NumberPad; prescriptionLengthTextField.BorderStyle = UITextBorderStyle.RoundedRect; prescriptionLengthStepper = new UIStepper (); prescriptionLengthStepper.Value = 20; prescriptionLengthStepper.MinimumValue = 1; prescriptionLengthStepper.AddTarget (prescriptionStepperIncremented, UIControlEvent.ValueChanged); prescriptionDayLabel = new UILabel (); prescriptionDayLabel.Text = "Days"; UIStackView prescriptionStackView = new UIStackView (new UIView[] { prescriptionLengthTextField, prescriptionLengthStepper, prescriptionDayLabel }); prescriptionStackView.Axis = UILayoutConstraintAxis.Horizontal; prescriptionStackView.Alignment = UIStackViewAlignment.Leading; prescriptionStackView.Distribution = UIStackViewDistribution.FillProportionally; prescriptionStackView.Spacing = 5; refillsLabel = new UILabel (); refillsLabel.Text = "Refills Remaining"; refillsTextField = new UITextField (); refillsTextField.Text = "0"; refillsTextField.KeyboardType = UIKeyboardType.NumberPad; refillsTextField.BorderStyle = UITextBorderStyle.RoundedRect; refillsTextField.AddTarget (refillsTextFieldChanged, UIControlEvent.EditingDidEnd | UIControlEvent.EditingDidEndOnExit); refillsStepper = new UIStepper (); refillsStepper.Value = 0; refillsStepper.MinimumValue = 0; refillsStepper.AddTarget (refillsStepperIncremented, UIControlEvent.ValueChanged); UIStackView refillsStackView = new UIStackView (new UIView[] { refillsTextField, refillsStepper }); refillsStackView.Spacing = 5; refillsStackView.Alignment = UIStackViewAlignment.Leading; refillsStackView.Distribution = UIStackViewDistribution.FillProportionally; refillsStackView.Axis = UILayoutConstraintAxis.Horizontal; pharmacyTextView = new UITextView (); pharmacyTextView.Text = "Pharmacy Address"; pharmacyTextView.ScrollEnabled = false; pharmacyTextView.BackgroundColor = UIColor.LightGray; pharmacyTextField = new UITextField (); pharmacyTextField.Text = "Pharmacy Address"; pharmacyTextField.BorderStyle = UITextBorderStyle.RoundedRect; // Sets up the stackview stackView.Spacing = 5; stackView.Alignment = UIStackViewAlignment.Leading; stackView.Distribution = UIStackViewDistribution.EqualSpacing; stackView.AddArrangedSubview (nameField); UIView spaceView = new UIView (CoreGraphics.CGRect.FromLTRB (0, 0, 50, SECTION_SPACER)); spaceView.AddConstraint (NSLayoutConstraint.Create (spaceView, NSLayoutAttribute.Height, NSLayoutRelation.Equal, null, NSLayoutAttribute.NoAttribute, 1, SECTION_SPACER)); stackView.AddArrangedSubview (spaceView); stackView.AddArrangedSubview (medTypeLabel); stackView.AddArrangedSubview (medTypeButton); stackView.AddArrangedSubview (medTypePicker); medTypePicker.Hidden = true; UIView spaceView2 = new UIView (CoreGraphics.CGRect.FromLTRB (0, 0, 50, SECTION_SPACER)); spaceView2.AddConstraint (NSLayoutConstraint.Create (spaceView2, NSLayoutAttribute.Height, NSLayoutRelation.Equal, null, NSLayoutAttribute.NoAttribute, 1, SECTION_SPACER)); stackView.AddArrangedSubview (spaceView2); stackView.AddArrangedSubview (freqLabel); stackView.AddArrangedSubview (freqStackView); stackView.AddArrangedSubview (freqButton); stackView.AddArrangedSubview (freqPicker); freqPicker.Hidden = true; UIView spaceView3 = new UIView (CoreGraphics.CGRect.FromLTRB (0, 0, 50, SECTION_SPACER)); spaceView3.AddConstraint (NSLayoutConstraint.Create (spaceView3, NSLayoutAttribute.Height, NSLayoutRelation.Equal, null, NSLayoutAttribute.NoAttribute, 1, SECTION_SPACER)); stackView.AddArrangedSubview (spaceView3); stackView.AddArrangedSubview (timeStack); stackView.AddArrangedSubview (dayLabel); stackView.AddArrangedSubview (dayButton); stackView.AddArrangedSubview (dayPicker); UIView spaceView4 = new UIView (CoreGraphics.CGRect.FromLTRB (0, 0, 50, SECTION_SPACER)); spaceView4.AddConstraint (NSLayoutConstraint.Create (spaceView4, NSLayoutAttribute.Height, NSLayoutRelation.Equal, null, NSLayoutAttribute.NoAttribute, 1, SECTION_SPACER)); stackView.AddArrangedSubview (spaceView4); stackView.AddArrangedSubview (prescriptionLengthLabel); stackView.AddArrangedSubview (prescriptionStackView); UIView spaceView5 = new UIView (CoreGraphics.CGRect.FromLTRB (0, 0, 50, SECTION_SPACER)); spaceView5.AddConstraint (NSLayoutConstraint.Create (spaceView5, NSLayoutAttribute.Height, NSLayoutRelation.Equal, null, NSLayoutAttribute.NoAttribute, 1, SECTION_SPACER)); stackView.AddArrangedSubview (spaceView5); stackView.AddArrangedSubview (refillsLabel); stackView.AddArrangedSubview (refillsStackView); UIView spaceView6 = new UIView (CoreGraphics.CGRect.FromLTRB (0, 0, 50, SECTION_SPACER)); spaceView6.AddConstraint (NSLayoutConstraint.Create (spaceView6, NSLayoutAttribute.Height, NSLayoutRelation.Equal, null, NSLayoutAttribute.NoAttribute, 1, SECTION_SPACER)); stackView.AddArrangedSubview (spaceView6); stackView.AddArrangedSubview (pharmacyTextField); UIView spaceView7 = new UIView (CoreGraphics.CGRect.FromLTRB (0, 0, 50, SECTION_SPACER)); spaceView7.AddConstraint (NSLayoutConstraint.Create (spaceView7, NSLayoutAttribute.Height, NSLayoutRelation.Equal, null, NSLayoutAttribute.NoAttribute, 1, SECTION_SPACER)); stackView.AddArrangedSubview (spaceView7); }
partial void stepperClicked(UIStepper sender);
/// <summary> /// Called by all constructor overloads /// </summary> private void Initialize () { Step = 0.5f; textField = new UITextField { TextAlignment = UITextAlignment.Right, VerticalAlignment = UIControlContentVerticalAlignment.Center, TextColor = Theme.BlueTextColor, KeyboardType = UIKeyboardType.NumberPad, }; textField.EditingDidBegin += (sender, e) => { var method = EditingDidBegin; if (method != null) method (this, EventArgs.Empty); }; textField.EditingDidEnd += (sender, e) => { Value = textField.Text.ToDouble (CultureInfo.InvariantCulture); var method = EditingDidEnd; if (method != null) method (this, EventArgs.Empty); }; stepper = new UIStepper(); stepper.StepValue = Step; stepper.Value = 0; stepper.ValueChanged += (sender, e) => Value = stepper.Value; AddSubview (stepper); AddSubview (textField); }
public void Include(UIStepper s) { s.Value = s.Value + 1; s.ValueChanged += (sender, args) => { s.Value = 0; }; }
partial void stepperClicked (UIStepper sender);
partial void PageNumberChanged(UIStepper sender);
partial void strikesStepperValueChanged(UIStepper sender) { this.UpdateTextValue(sender.Value, this.txtStrikes); }
partial void stepperClicked (UIStepper sender) { flexPie.SelectedItemOffset = stepper.Value; offsetLabel.Text = stepper.Value.ToString (); }
partial void foulStepperValueChanged(UIStepper sender) { this.UpdateTextValue(sender.Value, this.txtFouls); }
partial void PercentageStepperValueChanged(UIStepper sender);
void ReleaseDesignerOutlets() { if (CategoryChooser != null) { CategoryChooser.Dispose (); CategoryChooser = null; } if (DescriptionLabel != null) { DescriptionLabel.Dispose (); DescriptionLabel = null; } if (ImageView != null) { ImageView.Dispose (); ImageView = null; } if (NumberField != null) { NumberField.Dispose (); NumberField = null; } if (Stepper != null) { Stepper.Dispose (); Stepper = null; } }
partial void stepperClicked(UIStepper sender) { offsetLabel.Text = sender.Value.ToString(); sunburst.SelectedItemOffset = sender.Value; }
private string GetStepperLabelText(UIStepper stepper) { return ((int)stepper.Value).ToString (); }
public static void UpdateMinimum(this UIStepper nativeStepper, IStepper stepper) { nativeStepper.MinimumValue = stepper.Minimum; }
partial void ValueChanged(UIStepper sender) { stepper.MinimumValue = 0; stepper.MaximumValue = 10; lblDisplay.Text = stepper.Value.ToString(); }