Ejemplo n.º 1
0
		//NSArray animationTypes = new NSArray ();

		public BusyIndicator()
		{

			busyIndicator = new SFBusyIndicator ();
			this.animationTypes.Add ((NSString)"Ball");
			this.animationTypes.Add ((NSString)"Battery");
			this.animationTypes.Add ((NSString)"DoubleCircle");
			this.animationTypes.Add ((NSString)"ECG");
			this.animationTypes.Add ((NSString)"Globe");
			this.animationTypes.Add ((NSString)"HorizontalPulsingBox");
			this.animationTypes.Add ((NSString)"MovieTimer");
			this.animationTypes.Add ((NSString)"Print");
			this.animationTypes.Add ((NSString)"Rectangle");
			this.animationTypes.Add ((NSString)"RollingBall");
			this.animationTypes.Add ((NSString)"SingleCircle");
			this.animationTypes.Add ((NSString)"SlicedCircle");
			this.animationTypes.Add ((NSString)"ZoomingTarget");


			busyIndicator.Foreground = UIColor.FromRGB (36,63,217);
			busyIndicator.ViewBoxWidth = 100;
			busyIndicator.ViewBoxHeight = 100;
			busyIndicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeBall;
			this.AddSubview (busyIndicator);


			label.Text="AnimationTypes";
			label.TextColor = UIColor.Black;
			this.AddSubview (label);



			textbutton.SetTitle("Ball", UIControlState.Normal);
			textbutton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
			textbutton.BackgroundColor = UIColor.Clear;
			textbutton.SetTitleColor(UIColor.Black, UIControlState.Normal);
			textbutton.Hidden = false;
			textbutton.Layer.BorderColor = UIColor.FromRGB(246,246,246).CGColor;
			textbutton.Layer.BorderWidth = 4;
			textbutton.Layer.CornerRadius = 8;
			textbutton.TouchUpInside += ShowPicker;
			this.AddSubview (textbutton);

			PickerModel model = new PickerModel(this.animationTypes);
			model.PickerChanged += (sender, e) => {
				this.selectedType = e.SelectedValue;
				textbutton.SetTitle(selectedType, UIControlState.Normal);
				if(selectedType=="Ball"){
					busyIndicator.ViewBoxWidth = 70;
					busyIndicator.ViewBoxHeight = 70;
					busyIndicator.Foreground = UIColor.FromRGB (36,63,217);
					busyIndicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeBall;}
				else if(selectedType=="Battery"){
					busyIndicator.ViewBoxWidth = 70;
					busyIndicator.ViewBoxHeight = 70;
					busyIndicator.Foreground = UIColor.FromRGB(167,0,21);
					busyIndicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeBattery;}
				else if(selectedType=="DoubleCircle"){
					busyIndicator.ViewBoxWidth = 70;
					busyIndicator.ViewBoxHeight = 70;
					busyIndicator.Foreground = UIColor.FromRGB(149,140,123);
					busyIndicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeDoubleCircle;}
				else if(selectedType=="ECG"){
					busyIndicator.ViewBoxWidth = 70;
					busyIndicator.ViewBoxHeight = 70;
					busyIndicator.Foreground = UIColor.FromRGB(218,144,26);
					busyIndicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeECG;}
				else if(selectedType=="Globe"){
					busyIndicator.ViewBoxWidth=100;
					busyIndicator.ViewBoxHeight=100;
					busyIndicator.Foreground = UIColor.FromRGB(158,168,238);
					busyIndicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeGlobe;}
				else if(selectedType=="HorizontalPulsingBox"){
					busyIndicator.ViewBoxWidth=100;
					busyIndicator.ViewBoxHeight=100;
					busyIndicator.Foreground = UIColor.FromRGB(228,46,6);
					busyIndicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeHorizontalPulsingBox;}
				else if(selectedType=="MovieTimer"){
					busyIndicator.ViewBoxWidth=100;
					busyIndicator.ViewBoxHeight=100;
					busyIndicator.Foreground = UIColor.FromRGB(45,45,45);
					busyIndicator.SecondaryColor=UIColor.FromRGB(155,155,155);
					busyIndicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeMovieTimer;}
				else if(selectedType=="Print"){
					busyIndicator.ViewBoxWidth=70;
					busyIndicator.ViewBoxHeight=70;
					busyIndicator.Foreground = UIColor.FromRGB(94,111,248);
					busyIndicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypePrint;}
				else if(selectedType=="Rectangle"){
					busyIndicator.ViewBoxWidth=100;
					busyIndicator.ViewBoxHeight=100;
					busyIndicator.Foreground = UIColor.FromRGB(39,170,158);
					busyIndicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeRectangle;}
				else if(selectedType=="RollingBall"){
					busyIndicator.ViewBoxWidth=70;
					busyIndicator.ViewBoxHeight=70;
					busyIndicator.Foreground = UIColor.FromRGB(45,45,45);
					busyIndicator.SecondaryColor=UIColor.White;
					busyIndicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeRollingBall;}
				else if(selectedType=="SingleCircle"){
					busyIndicator.ViewBoxWidth = 70;
					busyIndicator.ViewBoxHeight = 70;
					busyIndicator.Foreground = UIColor.FromRGB(175,37,65);
					busyIndicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeSingleCircle;}
				else if(selectedType=="SlicedCircle"){
					busyIndicator.ViewBoxWidth = 70;
					busyIndicator.ViewBoxHeight = 70;
					busyIndicator.Foreground = UIColor.FromRGB(119,151,114);
					busyIndicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeSlicedCircle;}
				else if(selectedType=="ZoomingTarget"){
					busyIndicator.ViewBoxWidth = 70;
					busyIndicator.ViewBoxHeight = 70;
					busyIndicator.Foreground = UIColor.FromRGB(237,143,60);
					busyIndicator.AnimationType = SFBusyIndicatorAnimationType.SFBusyIndicatorAnimationTypeZoomingTarget;}
			};



			picker.ShowSelectionIndicator = true;
			picker.Hidden = false;
			picker.Model = model;
			picker.BackgroundColor = UIColor.White;

			this.AddSubview (picker);



			button.SetTitle("Done\t", UIControlState.Normal);
			button.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
			button.BackgroundColor = UIColor.FromRGB(240,240,240);
			button.SetTitleColor(UIColor.Black, UIControlState.Normal);
			button.Hidden = false;
			button.TouchUpInside += HidePicker;
			this.AddSubview (button);



			this.BackgroundColor = UIColor.White;
			this.control = this;
			// Perform any additional setup after loading the view, typically from a nib.
		}
		public NavigationDrawer ()
		{
			picker1 = new UIPickerView ();
			picker2 = new UIPickerView ();

			PickerModel model = new PickerModel (TAlignment);
			picker1.Model = model;
			PickerModel model1 = new PickerModel (LAlignment);
			picker2.Model = model1;

			label3 = new UILabel ();

			textbutton = new UIButton ();
			textbutton1 = new UIButton ();
			label4 = new UILabel ();



			label3.Text = "Position";
			label3.TextColor = UIColor.Black;
			label3.TextAlignment = UITextAlignment.Left;

			label4.Text = "Transition";
			label4.TextColor = UIColor.Black;
			label4.TextAlignment = UITextAlignment.Left;


			textbutton.SetTitle("Left",UIControlState.Normal);
			textbutton.SetTitleColor(UIColor.Black,UIControlState.Normal);
			textbutton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
			textbutton.Layer.CornerRadius = 8;
			textbutton.Layer.BorderWidth = 2;
			textbutton.TouchUpInside += ShowPicker1;
			textbutton.Layer.BorderColor =UIColor.FromRGB(246,246,246).CGColor;


			textbutton1.SetTitle("SlideOnTop",UIControlState.Normal);
			textbutton1.SetTitleColor(UIColor.Black,UIControlState.Normal);
			textbutton1.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
			textbutton1.Layer.CornerRadius = 8;
			textbutton1.Layer.BorderWidth = 2;
			textbutton1.TouchUpInside += ShowPicker2;
			textbutton1.Layer.BorderColor =UIColor.FromRGB(246,246,246).CGColor;

			doneButton.SetTitle("Done\t",UIControlState.Normal);
			doneButton.SetTitleColor(UIColor.Black,UIControlState.Normal);
			doneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
			doneButton.TouchUpInside += HidePicker;
			doneButton.Hidden = true;
			doneButton.BackgroundColor = UIColor.FromRGB(246,246,246);

			model.PickerChanged += SelectedIndexChanged;
			model1.PickerChanged += SelectedIndexChanged1;

			picker1.ShowSelectionIndicator = true;
			picker1.Hidden = true;

			picker2.ShowSelectionIndicator = true;
			picker2.Hidden = true;
			this.control = this;
		}
Ejemplo n.º 3
0
		public AutoComplete ()
		{
			picker1 = new UIPickerView ();
			picker2 = new UIPickerView ();
			PickerModel model = new PickerModel (suggesionmode);
			picker1.Model = model;
			PickerModel model1 = new PickerModel (autocompletemd);
			picker2.Model = model1;
			PickerModel model2 = new PickerModel (experience);
			label2 = new UILabel ();
			label3 = new UILabel ();
			label4 = new UILabel ();
			label5 = new UILabel ();
			label6 = new UILabel ();
			textbutton = new UIButton ();
			textbutton1 = new UIButton ();
			this.title.Add ((NSString)"Banking");
			this.title.Add ((NSString)"Software");
			this.title.Add ((NSString)"Media");
			this.title.Add ((NSString)"Medical");
			this.exp.Add ((NSString)"1");
			this.exp.Add ((NSString)"2");
			label1s = new UILabel ();
			label2s = new UILabel ();
			label3s = new UILabel ();
			label4s = new UILabel ();
			textbuttons = new UIButton ();
			autocomplete1 = new SFAutoComplete ();
			autocomplete2 = new SFAutoComplete ();
			autocomplete1.AutoCompleteSource = new Countrylist().Country;
			autocomplete1.SuggestionMode = SFAutoCompleteSuggestionMode.SFAutoCompleteSuggestionModeStartsWith;
			autocomplete1.Watermark= (NSString)"Enter a country name";
			autocomplete1.MaxDropDownHeight=90;
			autocomplete1.AutoCompleteMode= SFAutoCompleteAutoCompleteMode.SFAutoCompleteAutoCompleteModeSuggest;
			autocomplete2.AutoCompleteSource = title;
			autocomplete2.SuggestionMode = SFAutoCompleteSuggestionMode.SFAutoCompleteSuggestionModeStartsWith;
			autocomplete2.Watermark=(NSString)"Starts with ’S’, ‘M’ or ‘B’";
			autocomplete2.MaxDropDownHeight=90;
			autocomplete2.AutoCompleteMode= SFAutoCompleteAutoCompleteMode.SFAutoCompleteAutoCompleteModeSuggest;

			label1s.Text = "Job  Search";
			label1s.TextColor = UIColor.Black;
			label1s.TextAlignment = UITextAlignment.Left;
			label1s.Font=UIFont.FromName("Helvetica-Bold", 20f);

			label2s.Text = "Country";
			label2s.TextColor = UIColor.Black;
			label2s.TextAlignment = UITextAlignment.Left;
			label2s.Font=UIFont.FromName("Helvetica", 16f);

			label3s.Text = "Job Title";
			label3s.TextColor = UIColor.Black;
			label3s.TextAlignment = UITextAlignment.Left;
			label3s.Font=UIFont.FromName("Helvetica", 16f);

			label4s.Text = "Experience";
			label4s.TextColor = UIColor.Black;
			label4s.TextAlignment = UITextAlignment.Left;
			label4s.Font=UIFont.FromName("Helvetica", 16f);

			textbuttons.SetTitle("Search",UIControlState.Normal);
			textbuttons.SetTitleColor(UIColor.Black,UIControlState.Normal);
			textbuttons.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
			textbuttons.Layer.CornerRadius = 8;
			textbuttons.Layer.BorderWidth = 2;
			textbuttons.Layer.BorderColor =UIColor.FromRGB(246,246,246).CGColor;
			textbuttons.TouchUpInside += SelectResults;

			textbutton1s.SetTitle("1", UIControlState.Normal);
			textbutton1s.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
			textbutton1s.BackgroundColor = UIColor.Clear;
			textbutton1s.SetTitleColor(UIColor.Black, UIControlState.Normal);
			textbutton1s.Layer.BorderColor = UIColor.FromRGB(246,246,246).CGColor;
			textbutton1s.Layer.BorderWidth = 4;
			textbutton1s.Layer.CornerRadius = 8;
			textbutton1s.TouchUpInside += ShowPickers;
			this.AddSubview (textbutton1s);

			PickerModel models = new PickerModel(this.exp);
			models.PickerChanged += (sender, e) => {
				this.selectedTypes = e.SelectedValue;
				textbutton1s.SetTitle(selectedTypes, UIControlState.Normal);
			};

			pickers.ShowSelectionIndicator = true;
			pickers.Hidden = true;
			pickers.Model = model2;
			pickers.BackgroundColor = UIColor.White;
			buttons.SetTitle("Done\t", UIControlState.Normal);
			buttons.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
			buttons.BackgroundColor = UIColor.FromRGB(240,240,240);
			buttons.SetTitleColor(UIColor.Black, UIControlState.Normal);
			buttons.Hidden = true;
			buttons.TouchUpInside += HidePickers;

			this.AddSubview (pickers);
			this.AddSubview (buttons);
			this.AddSubview (autocomplete1);
			this.AddSubview (autocomplete2);
			this.AddSubview (label1s);
			this.AddSubview (label2s);
			this.AddSubview (label3s);
			this.AddSubview (label4s);
			this.AddSubview (textbuttons);
			this.control = this;

			label2.Text = "SuggestionMode";
			label2.TextColor = UIColor.Black;
			label2.TextAlignment = UITextAlignment.Left;
			label3.Text = "AutoCompleteMode";
			label3.TextColor = UIColor.Black;
			label3.TextAlignment = UITextAlignment.Left;

			label4.Text = "Min Prefix Character";
			label4.TextColor = UIColor.Black;
			label4.TextAlignment = UITextAlignment.Left;
			label4.Font=UIFont.FromName("Helvetica", 14f);

			label5.Text = "Max DropDownHeight";
			label5.TextColor = UIColor.Black;
			label5.TextAlignment = UITextAlignment.Left;
			label5.Font=UIFont.FromName("Helvetica", 14f);

			label6.Text = "Popup Delay";
			label6.TextColor = UIColor.Black;
			label6.TextAlignment = UITextAlignment.Left;
			label6.Font=UIFont.FromName("Helvetica", 14f);
			textbutton.SetTitle("StartsWith",UIControlState.Normal);
			textbutton.SetTitleColor(UIColor.Black,UIControlState.Normal);
			textbutton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
			textbutton.Layer.CornerRadius = 8;
			textbutton.Layer.BorderWidth = 2;
			textbutton.TouchUpInside += ShowPicker1;
			textbutton.Layer.BorderColor =UIColor.FromRGB(246,246,246).CGColor;

			text1 = new UITextView ();
			text2 = new UITextView ();
			text3 = new UITextView ();
			text1.Layer.BorderColor = UIColor.Black.CGColor;
			text2.Layer.BorderColor = UIColor.Black.CGColor;
			text3.Layer.BorderColor = UIColor.Black.CGColor;
			text1.BackgroundColor = UIColor.FromRGB(246,246,246);
			text2.BackgroundColor = UIColor.FromRGB(246,246,246);
			text3.BackgroundColor = UIColor.FromRGB(246,246,246);
			text1.KeyboardType = UIKeyboardType.NumberPad;
			text2.KeyboardType = UIKeyboardType.NumberPad;
			text3.KeyboardType = UIKeyboardType.NumberPad;
			text1.Text = "1";
			text2.Text = "400";
			text3.Text = "100";
			text2.Changed+= (object sender, EventArgs e) => 
			{
				if(text2.Text.Length>0){
					autocomplete1.MaxDropDownHeight = double.Parse(text2.Text);
					autocomplete2.MaxDropDownHeight = double.Parse(text2.Text);
				}
				else{
					autocomplete1.MaxDropDownHeight = 200;
					autocomplete2.MaxDropDownHeight = 200;
				}
			};
			text1.Changed+= (object sender, EventArgs e) => 
			{
				if(text1.Text.Length>0){
					autocomplete1.MinimumPrefixCharacters = int.Parse(text1.Text);
					autocomplete2.MinimumPrefixCharacters = int.Parse(text1.Text);
				}
				else{
					autocomplete1.MinimumPrefixCharacters = 1;
					autocomplete2.MinimumPrefixCharacters = 1;
				}
			};
			text3.Changed+= (object sender, EventArgs e) => 
			{
				if(text3.Text.Length>0)
				{
					autocomplete1.PopUpDelay = double.Parse(text3.Text);
					autocomplete2.PopUpDelay = double.Parse(text3.Text);
				}
				else
				{
					autocomplete1.PopUpDelay = 100;
					autocomplete2.PopUpDelay = 100;
				}
			};
			textbutton1.SetTitle("Suggest",UIControlState.Normal);
			textbutton1.SetTitleColor(UIColor.Black,UIControlState.Normal);
			textbutton1.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
			textbutton1.Layer.CornerRadius = 8;
			textbutton1.Layer.BorderWidth = 2;
			textbutton1.TouchUpInside += ShowPicker2;
			textbutton1.Layer.BorderColor =UIColor.FromRGB(246,246,246).CGColor;

			doneButton.SetTitle("Done\t",UIControlState.Normal);
			doneButton.SetTitleColor(UIColor.Black,UIControlState.Normal);
			doneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
			doneButton.TouchUpInside += HidePicker;
			doneButton.Hidden = true;
			doneButton.BackgroundColor = UIColor.FromRGB(246,246,246);
			model.PickerChanged += SelectedIndexChanged;
			model1.PickerChanged += SelectedIndexChanged1;
			model2.PickerChanged += SelectedIndexChanged2;
			picker1.ShowSelectionIndicator = true;
			picker1.Hidden = true;
			picker1.BackgroundColor = UIColor.Gray;
			picker2.BackgroundColor = UIColor.Gray;
			picker2.ShowSelectionIndicator = true;
			picker2.Hidden = true;
		}
		public RangeSliderGettingStarted ()
		{
			picker1 = new UIPickerView ();
			picker2 = new UIPickerView ();
			labelswitch = new UISwitch ();
			labelswitch1 = new UISwitch ();
			PickerModel model = new PickerModel (TAlignment);
			picker1.Model = model;
			PickerModel model1 = new PickerModel (LAlignment);
			picker2.Model = model1;
			rangeSlider1 = new SFRangeSlider ();
			rangeSlider2 = new SFRangeSlider ();
			rangeSlider1.Delegate=new RangeSliderDelegate();
			rangeSlider2.Delegate = new RangeSliderDelegate ();
			label1 = new UILabel ();
			label2 = new UILabel ();
			label3 = new UILabel ();
			label4 = new UILabel ();
			label5 = new UILabel ();
			label6 = new UILabel ();
			label9 = new UILabel ();
			label10 = new UILabel ();
			textbutton = new UIButton ();
			textbutton1 = new UIButton ();
			label7 = new UILabel ();
			label8 = new UILabel ();
			rangeSlider1.Maximum = 12;
			rangeSlider1.Minimum = 0;
			rangeSlider1.RangeStart = 0;
			rangeSlider1.RangeEnd = 12;
			rangeSlider1.TickPlacement = SFTickPlacement.SFTickPlacementBottomRight;
			rangeSlider1.TickFrequency = 2;
			rangeSlider1.ValuePlacement = SFValuePlacement.SFValuePlacementBottomRight;
			rangeSlider1.SnapsTo = SFSnapsTo.SFSnapsToNone;
			rangeSlider1.KnobColor = UIColor.White;
			rangeSlider1.TrackSelectionColor = UIColor.FromRGB (65, 115, 185);
			rangeSlider1.TrackColor = UIColor.FromRGB (182, 182, 182);

			label1.Text = "Departure";
			label1.TextColor = UIColor.Black;
			label1.TextAlignment = UITextAlignment.Left;
			label1.Font=UIFont.FromName("Helvetica", 18f);

			label3.Text = "Tick Placement";
			label3.TextColor = UIColor.Black;
			label3.TextAlignment = UITextAlignment.Left;

			label4.Text = "Label Placement";
			label4.TextColor = UIColor.Black;
			label4.TextAlignment = UITextAlignment.Left;

			label5.Text = "(in Hours)";
			label5.TextColor = UIColor.Gray;
			label5.TextAlignment = UITextAlignment.Left;
			label5.Font=UIFont.FromName("Helvetica", 14f);

			label6.Text = "(in Hours)";
			label6.TextColor = UIColor.Gray;
			label6.TextAlignment = UITextAlignment.Left;
			label6.Font=UIFont.FromName("Helvetica", 14f);

			label8.Text = "SnapToTick";
			label8.TextColor = UIColor.Black;
			label8.TextAlignment = UITextAlignment.Left;

			label9.Text = "Time: 12 AM - 12 PM";
			label9.TextColor = UIColor.Gray;
			label9.TextAlignment = UITextAlignment.Left;
			label9.Font=UIFont.FromName("Helvetica", 14f);

			label10.Text = "Time: 12 AM - 12 PM";
			label10.TextColor = UIColor.Gray;
			label10.TextAlignment = UITextAlignment.Left;
			label10.Font=UIFont.FromName("Helvetica", 14f);

			textbutton.SetTitle("BottomRight",UIControlState.Normal);
			textbutton.SetTitleColor(UIColor.Black,UIControlState.Normal);
			textbutton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
			textbutton.Layer.CornerRadius = 8;
			textbutton.Layer.BorderWidth = 2;
			textbutton.TouchUpInside += ShowPicker1;
			textbutton.Layer.BorderColor =UIColor.FromRGB(246,246,246).CGColor;


			textbutton1.SetTitle("BottomRight",UIControlState.Normal);
			textbutton1.SetTitleColor(UIColor.Black,UIControlState.Normal);
			textbutton1.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
			textbutton1.Layer.CornerRadius = 8;
			textbutton1.Layer.BorderWidth = 2;
			textbutton1.TouchUpInside += ShowPicker2;
			textbutton1.Layer.BorderColor =UIColor.FromRGB(246,246,246).CGColor;

			doneButton.SetTitle("Done\t",UIControlState.Normal);
			doneButton.SetTitleColor(UIColor.Black,UIControlState.Normal);
			doneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
			doneButton.TouchUpInside += HidePicker;
			doneButton.Hidden = true;
			doneButton.BackgroundColor = UIColor.FromRGB(246,246,246);

			label7.Text = "ShowLabel";
			label7.TextColor = UIColor.Black;
			label7.TextAlignment = UITextAlignment.Left;

			labelswitch.On = true;
			labelswitch1.On = false;

			rangeSlider2.Frame = new CGRect (10, 100, this.Frame.Size.Width, this.Frame.Size.Height);
			rangeSlider2.Maximum = 12;
			rangeSlider2.Minimum = 0;
			rangeSlider2.RangeStart = 0;
			rangeSlider2.RangeEnd = 12;
			rangeSlider2.TickPlacement = SFTickPlacement.SFTickPlacementBottomRight;
			rangeSlider2.TickFrequency = 2;
			rangeSlider2.ValuePlacement = SFValuePlacement.SFValuePlacementBottomRight;
			rangeSlider2.SnapsTo = SFSnapsTo.SFSnapsToNone;
			rangeSlider2.KnobColor = UIColor.White;
			rangeSlider2.TrackSelectionColor = UIColor.FromRGB (65, 115, 185);
			rangeSlider2.TrackColor = UIColor.FromRGB (182, 182, 182);

			labelswitch.ValueChanged += toggleChanged;
			labelswitch1.ValueChanged += toggleChanged1;
			label2.Text = "Arrival";
			label2.TextColor = UIColor.Black;
			label2.TextAlignment = UITextAlignment.Left;
			label2.Font=UIFont.FromName("Helvetica", 18f);
			model.PickerChanged += SelectedIndexChanged;
			model1.PickerChanged += SelectedIndexChanged1;

			picker1.ShowSelectionIndicator = true;
			picker1.Hidden = true;

			picker2.ShowSelectionIndicator = true;
			picker2.Hidden = true;

			this.AddSubview (rangeSlider1);
			this.AddSubview (rangeSlider2);
			this.AddSubview (label1);
			this.AddSubview (label2);
			this.AddSubview (label5);
			this.AddSubview (label6);
			this.AddSubview (label9);
			this.AddSubview (label10);
			this.control = this;
		}
		public NumericTextBox ()
		{
			this.cultureTypes.Add ((NSString)"United States");
			this.cultureTypes.Add ((NSString)"United Kingdom");
			this.cultureTypes.Add ((NSString)"Japan");
			this.cultureTypes.Add ((NSString)"France");
			this.cultureTypes.Add ((NSString)"Italy");

			numericTextBox1= new SFNumericTextBox();
			numericTextBox1.Watermark = "Enter Principal";
			numericTextBox1.AllowNull = true;
			numericTextBox1.MaximumNumberDecimalDigits = 2;
			numericTextBox1.PercentDisplayMode = SFNumericTextBoxPercentDisplayMode.Compute;
			numericTextBox1.ValueChangeMode = SFNumericTextBoxValueChangeMode.OnLostFocus;
			numericTextBox1.FormatString = "c";
			numericTextBox1.Value = 1000;
			numericTextBox1.CultureInfo = new NSLocale ("en_US");
			numericTextBox1.NumericTextBoxDelegate = new NumericTextBoxDelegate();
			this.AddSubview(numericTextBox1);

			numericTextBox2= new SFNumericTextBox();
			numericTextBox2.Watermark = "Enter RI";
			numericTextBox2.AllowNull = true;
			numericTextBox2.MaximumNumberDecimalDigits = 0;
			numericTextBox2.PercentDisplayMode = SFNumericTextBoxPercentDisplayMode.Compute;
			numericTextBox2.ValueChangeMode = SFNumericTextBoxValueChangeMode.OnLostFocus;
			numericTextBox2.FormatString = @"p";
			numericTextBox2.Value = 0.1f;
			numericTextBox2.CultureInfo = new NSLocale ("en_US");
			numericTextBox2.NumericTextBoxDelegate = new NumericTextBoxDelegate();
			this.AddSubview(numericTextBox2);

			numericTextBox3= new SFNumericTextBox();
			numericTextBox3.Watermark = @"Enter Years";
			numericTextBox3.AllowNull = true;
			numericTextBox3.MaximumNumberDecimalDigits = 0;
			numericTextBox3.PercentDisplayMode = SFNumericTextBoxPercentDisplayMode.Compute;
			numericTextBox3.ValueChangeMode = SFNumericTextBoxValueChangeMode.OnLostFocus;
			numericTextBox3.FormatString = @"years";
			numericTextBox3.Value = 20;
			numericTextBox3.CultureInfo = new NSLocale ("en_US");
			numericTextBox3.NumericTextBoxDelegate = new NumericTextBoxDelegate();
			this.AddSubview(numericTextBox3);

			numericTextBox4= new SFNumericTextBox();
			numericTextBox4.Watermark = @"Enter a number";
			numericTextBox4.AllowNull = true;
			numericTextBox4.MaximumNumberDecimalDigits = 0;
			numericTextBox4.PercentDisplayMode = SFNumericTextBoxPercentDisplayMode.Compute;
			numericTextBox4.ValueChangeMode = SFNumericTextBoxValueChangeMode.OnLostFocus;
			numericTextBox4.FormatString = @"c";
			numericTextBox4.Value = 2000;
			numericTextBox4.Enabled = false;
			numericTextBox4.TextColor = UIColor.Gray;
			numericTextBox4.CultureInfo = new NSLocale ("en_US");
			numericTextBox4.NumericTextBoxDelegate = new NumericTextBoxDelegate();
			this.AddSubview(numericTextBox4);

			titleText = new UILabel();
			titleText.TextColor = UIColor.Black;
			titleText.BackgroundColor= UIColor.Clear;
			titleText.Text=@"Simple Interest Calculator";
			titleText.TextAlignment = UITextAlignment.Left;
			titleText.Font = UIFont.FromName("Helvetica", 20f);
			this.AddSubview(titleText);

			description = new UILabel();
			description.TextColor = UIColor.Black;
			description.BackgroundColor= UIColor.Clear;
			description.Text=@"The formula for finding simple interest is:";
			description.TextAlignment = UITextAlignment.Left;
			description.Font = UIFont.FromName("Helvetica", 16f);
			this.AddSubview(description);

			formulaLabel = new UILabel();
			formulaLabel.TextColor = UIColor.Black;
			formulaLabel.BackgroundColor= UIColor.Clear;
			formulaLabel.Text=@"Interest = Principal * Rate * Time";
			formulaLabel.TextAlignment = UITextAlignment.Left;
			formulaLabel.Font = UIFont.FromName("Helvetica", 16f);
			this.AddSubview(formulaLabel);

			principal = new UILabel();
			principal.TextColor = UIColor.Black;
			principal.BackgroundColor= UIColor.Clear;
			principal.Text=@"Principal";
			principal.TextAlignment= UITextAlignment.Left;
			principal.Font=UIFont.FromName("Helvetica", 13f);
			this.AddSubview(principal);

			interestrate = new UILabel();
			interestrate.TextColor = UIColor.Black;
			interestrate.BackgroundColor= UIColor.Clear;
			interestrate.Text=@"Interest Rate";
			interestrate.TextAlignment= UITextAlignment.Left;
			interestrate.Font=UIFont.FromName("Helvetica", 13f);
			this.AddSubview(interestrate);

			term = new UILabel();
			term.TextColor = UIColor.Black;
			term.BackgroundColor= UIColor.Clear;
			term.Text=@"Term";
			term.TextAlignment= UITextAlignment.Left;
			term.Font=UIFont.FromName("Helvetica", 13f);
			this.AddSubview(term);

			interest = new UILabel();
			interest.TextColor = UIColor.Black;
			interest.BackgroundColor= UIColor.Clear;
			interest.Text=@"Interest";
			interest.TextAlignment= UITextAlignment.Left;
			interest.Font=UIFont.FromName("Helvetica", 13f);
			this.AddSubview(interest);

			allow = new UILabel();
			allow.TextColor = UIColor.Black;
			allow.BackgroundColor= UIColor.Clear;
			allow.Text=@"Allow Null";
			allow.TextAlignment= UITextAlignment.Left;
			allow.Font=UIFont.FromName("Helvetica", 16f);
			options.AddSubview(allow);

			allowSwitch = new UISwitch();
			allowSwitch.ValueChanged += toggleChanged;
			allowSwitch.On=true;
			options.AddSubview(allowSwitch);

			culLabel = new UILabel();
			culLabel.TextColor = UIColor.Black;
			culLabel.BackgroundColor= UIColor.Clear;
			culLabel.Text=@"Culture";
			culLabel.TextAlignment= UITextAlignment.Left;
			culLabel.Font=UIFont.FromName("Helvetica", 16f);
			options.AddSubview(culLabel);

			culture = new UIButton ();
			culture.SetTitle("United States", UIControlState.Normal);
			culture.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
			culture.BackgroundColor = UIColor.Clear;
			culture.SetTitleColor(UIColor.Black, UIControlState.Normal);
			culture.Hidden = false;
			culture.Layer.BorderColor = UIColor.FromRGB(246,246,246).CGColor;
			culture.Layer.BorderWidth = 4;
			culture.Layer.CornerRadius = 8;
			culture.TouchUpInside += ShowPicker;
			options.AddSubview (culture);

			PickerModel model1 = new PickerModel(this.cultureTypes);
			model1.PickerChanged += (sender, e) => {
				this.selectedType = e.SelectedValue;
				culture.SetTitle(selectedType, UIControlState.Normal);
				if(selectedType=="United States"){
					numericTextBox1.CultureInfo = new NSLocale ("en_US");
					numericTextBox2.CultureInfo = new NSLocale ("en_US");
					numericTextBox3.CultureInfo = new NSLocale ("en_US");
					numericTextBox4.CultureInfo = new NSLocale ("en_US");}
				else if(selectedType=="United Kingdom"){
					numericTextBox1.CultureInfo = new NSLocale ("en_UK");
					numericTextBox2.CultureInfo = new NSLocale ("en_UK");
					numericTextBox3.CultureInfo = new NSLocale ("en_UK");
					numericTextBox4.CultureInfo = new NSLocale ("en_UK");}
				else if(selectedType=="Japan"){
					numericTextBox1.CultureInfo = new NSLocale ("jp_JP");
					numericTextBox2.CultureInfo = new NSLocale ("jp_JP");
					numericTextBox3.CultureInfo = new NSLocale ("jp_JP");
					numericTextBox4.CultureInfo = new NSLocale ("jp_JP");}
				else if(selectedType=="France"){
					numericTextBox1.CultureInfo = new NSLocale ("fr_FR");
					numericTextBox2.CultureInfo = new NSLocale ("fr_FR");
					numericTextBox3.CultureInfo = new NSLocale ("fr_FR");
					numericTextBox4.CultureInfo = new NSLocale ("fr_FR");}
				else if(selectedType=="Italy"){
					numericTextBox1.CultureInfo = new NSLocale ("it_IT");
					numericTextBox2.CultureInfo = new NSLocale ("it_IT");
					numericTextBox3.CultureInfo = new NSLocale ("it_IT");
					numericTextBox4.CultureInfo = new NSLocale ("it_IT");}
			};
			picker = new UIPickerView();
			picker.ShowSelectionIndicator = true;
			picker.Hidden = false;
			picker.Model = model1;
			picker.BackgroundColor = UIColor.White;
			options.AddSubview(picker);
			button = new UIButton ();
			button.SetTitle("Done\t", UIControlState.Normal);
			button.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
			button.BackgroundColor = UIColor.FromRGB(240,240,240);
			button.SetTitleColor(UIColor.Black, UIControlState.Normal);
			button.Hidden = false;
			button.TouchUpInside += HidePicker;
			options.AddSubview (button);

			this.BackgroundColor = UIColor.White;
			this.control = this;


		}
Ejemplo n.º 6
0
        public Connectors()
        {
            HeaderBar.BackgroundColor = UIColor.FromRGB(245, 245, 245);
            var label = new UILabel();

            label.Text            = "Connector Types: ";
            label.TextColor       = UIColor.Black;
            label.BackgroundColor = UIColor.Clear;
            label.TextAlignment   = UITextAlignment.Center;
            label.Frame           = new CGRect(20, 0, 180, 60);
            HeaderBar.AddSubview(label);

            straight = AddButton(220, "Images/Diagram/CSStraight.png");
            straight.TouchUpInside += Straight_TouchUpInside;
            HeaderBar.AddSubview(straight);

            curve = AddButton(280, "Images/Diagram/CSCurve.png");
            curve.TouchUpInside += Curve_TouchUpInside;;
            HeaderBar.AddSubview(curve);

            ortho = AddButton(340, "Images/Diagram/CSOrtho.png");
            ortho.TouchUpInside  += Ortho_TouchUpInside;
            ortho.BackgroundColor = UIColor.FromRGB(30, 144, 255);
            HeaderBar.AddSubview(ortho);

            selectionPicker1 = new UIPickerView();
            this.OptionView  = new UIView();

            PickerModel model = new PickerModel(verticalOrientationlist);

            selectionPicker1.Model = model;

            connectorStyle               = new UILabel();
            connectorStyle.Text          = "Connector Style";
            connectorStyle.TextColor     = UIColor.Black;
            connectorStyle.TextAlignment = UITextAlignment.Left;

            connectorSize               = new UILabel();
            connectorSize.Text          = "Connector Size";
            connectorSize.TextColor     = UIColor.Black;
            connectorSize.TextAlignment = UITextAlignment.Left;

            //Represent the vertical button
            connectorStyleButton = new UIButton();
            connectorStyleButton.SetTitle("Default", UIControlState.Normal);
            connectorStyleButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            connectorStyleButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            connectorStyleButton.Layer.CornerRadius  = 8;
            connectorStyleButton.Layer.BorderWidth   = 2;
            connectorStyleButton.TouchUpInside      += ShowPicker1;
            connectorStyleButton.BackgroundColor     = UIColor.LightGray;
            connectorStyleButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;

            plus = new UIButton();
            plus.BackgroundColor    = UIColor.White;
            plus.Layer.CornerRadius = 8;
            plus.Layer.BorderWidth  = 0.5f;
            plus.TouchUpInside     += Plus_TouchUpInside;
            plusimg       = new UIImageView();
            plusimg.Image = UIImage.FromBundle("Images/Diagram/CSplus.png");
            plus.AddSubview(plusimg);

            minus = new UIButton();
            minus.BackgroundColor    = UIColor.White;
            minus.Layer.CornerRadius = 8;
            minus.Layer.BorderWidth  = 0.5f;
            minus.TouchUpInside     += Minus_TouchUpInside;
            minusimg       = new UIImageView();
            minusimg.Image = UIImage.FromBundle("Images/Diagram/CSsub.png");
            minus.AddSubview(minusimg);

            sizeindicator                 = new UILabel();
            sizeindicator.Text            = width.ToString();
            sizeindicator.BackgroundColor = UIColor.Clear;
            sizeindicator.TextColor       = UIColor.Black;
            sizeindicator.TextAlignment   = UITextAlignment.Center;

            //Represent the button
            doneButton.SetTitle("Done\t", UIControlState.Normal);
            doneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            doneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            doneButton.TouchUpInside      += HidePicker;
            doneButton.Hidden          = true;
            doneButton.BackgroundColor = UIColor.FromRGB(246, 246, 246);
            selectionPicker1.ShowSelectionIndicator = true;
            selectionPicker1.Hidden = true;

            Node node1  = new Node();
            Node node2  = new Node();
            Node node3  = new Node();
            Node node4  = new Node();
            Node node5  = new Node();
            Node node6  = new Node();
            Node node7  = new Node();
            Node node8  = new Node();
            Node node9  = new Node();
            Node node10 = new Node();
            Node node11 = new Node();

            diagram.IsReadOnly = true;

            node1  = AddNode(456, 180, "CEO", UIColor.FromRGB(201, 32, 61));
            node2  = AddNode(286, 396, "Manager", UIColor.FromRGB(23, 132, 206));
            node3  = AddNode(646, 396, "Manager", UIColor.FromRGB(23, 132, 206));
            node4  = AddNode(204, 612, "Team Lead", UIColor.FromRGB(4, 142, 135));
            node5  = AddNode(384, 612, "Team Lead", UIColor.FromRGB(4, 142, 135));
            node6  = AddNode(564, 612, "Team Lead", UIColor.FromRGB(4, 142, 135));
            node7  = AddNode(744, 612, "Team Lead", UIColor.FromRGB(4, 142, 135));
            node8  = AddNode(108, 828, "Trainee", UIColor.FromRGB(206, 98, 9));
            node9  = AddNode(324, 828, "Trainee", UIColor.FromRGB(206, 98, 9));
            node10 = AddNode(648, 828, "Trainee", UIColor.FromRGB(206, 98, 9));
            node11 = AddNode(864, 828, "Trainee", UIColor.FromRGB(206, 98, 9));


            diagram.AddNode(node1);
            diagram.AddNode(node2);
            diagram.AddNode(node3);
            diagram.AddNode(node4);
            diagram.AddNode(node5);
            diagram.AddNode(node6);
            diagram.AddNode(node7);
            diagram.AddNode(node8);
            diagram.AddNode(node9);
            diagram.AddNode(node10);
            diagram.AddNode(node11);
            diagram.AddConnector(AddConnector(node1, node2));
            diagram.AddConnector(AddConnector(node1, node3));
            diagram.AddConnector(AddConnector(node2, node4));
            diagram.AddConnector(AddConnector(node2, node5));
            diagram.AddConnector(AddConnector(node3, node6));
            diagram.AddConnector(AddConnector(node3, node7));
            diagram.AddConnector(AddConnector(node4, node8));
            diagram.AddConnector(AddConnector(node4, node9));
            diagram.AddConnector(AddConnector(node7, node10));
            diagram.AddConnector(AddConnector(node7, node11));
            diagram.Loaded += Diagram_Loaded;
            this.AddSubview(diagram);
            HeaderBar.Frame = new CGRect(0, 0, UIScreen.MainScreen.Bounds.Width, 60);
            this.AddSubview(HeaderBar);
            model.PickerChanged += SelectedIndexChanged;
        }
        public void loadOptionView()
        {
            subView             = new UIScrollView();
            subView.ContentSize = new CGSize(Frame.Width, 400);

            //autoReverse
            autoReverse                 = new UILabel();
            autoReverse.TextColor       = UIColor.Black;
            autoReverse.BackgroundColor = UIColor.Clear;
            autoReverse.Text            = @"Auto Reverse";
            autoReverse.TextAlignment   = UITextAlignment.Left;
            autoReverse.Font            = UIFont.FromName("Helvetica", 14f);
            contentView.AddSubview(autoReverse);

            //autoSwitch
            autoSwitch = new UISwitch();
            autoSwitch.ValueChanged += autoReverseToggleChanged;
            autoSwitch.On            = false;
            autoSwitch.OnTintColor   = UIColor.FromRGB(50, 150, 221);
            contentView.AddSubview(autoSwitch);

            //spinLabel
            spinLabel                 = new UILabel();
            spinLabel.TextColor       = UIColor.Black;
            spinLabel.BackgroundColor = UIColor.Clear;
            spinLabel.Text            = @"Spin Alignment";
            spinLabel.TextAlignment   = UITextAlignment.Left;
            spinLabel.Font            = UIFont.FromName("Helvetica", 14f);
            contentView.AddSubview(spinLabel);

            //spinAlignmentButton
            spinAlignmentButton = new UIButton();
            spinAlignmentButton.SetTitle("Right", UIControlState.Normal);
            spinAlignmentButton.Font = UIFont.FromName("Helvetica", 14f);
            spinAlignmentButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            spinAlignmentButton.BackgroundColor     = UIColor.Clear;
            spinAlignmentButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            spinAlignmentButton.Hidden             = false;
            spinAlignmentButton.Layer.BorderColor  = UIColor.FromRGB(246, 246, 246).CGColor;
            spinAlignmentButton.Layer.BorderWidth  = 4;
            spinAlignmentButton.Layer.CornerRadius = 8;
            spinAlignmentButton.TouchUpInside     += ShowSpinPicker;
            contentView.AddSubview(spinAlignmentButton);

            //minimumLabel
            minimumLabel               = new UILabel();
            minimumLabel.Text          = "Minimum";
            minimumLabel.TextColor     = UIColor.Black;
            minimumLabel.TextAlignment = UITextAlignment.Left;
            minimumLabel.Font          = UIFont.FromName("Helvetica", 14f);

            //maximumLabel
            maximumLabel               = new UILabel();
            maximumLabel.Text          = "Maximum";
            maximumLabel.TextColor     = UIColor.Black;
            maximumLabel.TextAlignment = UITextAlignment.Left;
            maximumLabel.Font          = UIFont.FromName("Helvetica", 14f);
            contentView.AddSubview(minimumLabel);
            contentView.AddSubview(maximumLabel);

            //minimumText
            minimumText = new UITextView();
            minimumText.TextAlignment     = UITextAlignment.Center;
            minimumText.Layer.BorderColor = UIColor.Black.CGColor;
            minimumText.BackgroundColor   = UIColor.FromRGB(246, 246, 246);
            minimumText.KeyboardType      = UIKeyboardType.NumberPad;
            minimumText.Text     = "0";
            minimumText.Font     = UIFont.FromName("Helvetica", 14f);
            minimumText.Changed += (object sender, EventArgs e) =>
            {
                if (minimumText.Text.Length > 0)
                {
                    adultNumericUpDown.Minimum   = nfloat.Parse(minimumText.Text);
                    infantsNumericUpDown.Minimum = nfloat.Parse(minimumText.Text);
                }
            };
            contentView.AddSubview(minimumText);

            //maximumText
            maximumText = new UITextView();
            maximumText.TextAlignment     = UITextAlignment.Center;
            maximumText.Layer.BorderColor = UIColor.Black.CGColor;
            maximumText.BackgroundColor   = UIColor.FromRGB(246, 246, 246);
            maximumText.KeyboardType      = UIKeyboardType.NumberPad;
            maximumText.Text     = "100";
            maximumText.Font     = UIFont.FromName("Helvetica", 14f);
            maximumText.Changed += (object sender, EventArgs e) =>
            {
                if (maximumText.Text.Length > 0)
                {
                    adultNumericUpDown.Maximum   = nfloat.Parse(maximumText.Text);
                    infantsNumericUpDown.Maximum = nfloat.Parse(maximumText.Text);
                }
            };
            contentView.AddSubview(maximumText);

            //spinPicker
            PickerModel culturePickermodel = new PickerModel(this.cultureList);

            culturePickermodel.PickerChanged += (sender, e) =>
            {
                this.cultureSelectedType = e.SelectedValue;
                spinAlignmentButton.SetTitle(cultureSelectedType, UIControlState.Normal);
                if (cultureSelectedType == "Right")
                {
                    adultNumericUpDown.SpinButtonAlignment   = SFNumericUpDownSpinButtonAlignment.Right;
                    infantsNumericUpDown.SpinButtonAlignment = SFNumericUpDownSpinButtonAlignment.Right;
                    adultNumericUpDown.TextAlignment         = UITextAlignment.Left;
                    infantsNumericUpDown.TextAlignment       = UITextAlignment.Left;
                }
                else if (cultureSelectedType == "Left")
                {
                    adultNumericUpDown.SpinButtonAlignment   = SFNumericUpDownSpinButtonAlignment.Left;
                    infantsNumericUpDown.SpinButtonAlignment = SFNumericUpDownSpinButtonAlignment.Left;
                    adultNumericUpDown.TextAlignment         = UITextAlignment.Right;
                    infantsNumericUpDown.TextAlignment       = UITextAlignment.Right;
                }
                else if (cultureSelectedType == "Both")
                {
                    adultNumericUpDown.SpinButtonAlignment   = SFNumericUpDownSpinButtonAlignment.Both;
                    infantsNumericUpDown.SpinButtonAlignment = SFNumericUpDownSpinButtonAlignment.Both;
                    adultNumericUpDown.TextAlignment         = UITextAlignment.Center;
                    infantsNumericUpDown.TextAlignment       = UITextAlignment.Center;
                }
            };
            spinPicker = new UIPickerView();
            spinPicker.ShowSelectionIndicator = true;
            spinPicker.Hidden          = true;
            spinPicker.Model           = culturePickermodel;
            spinPicker.BackgroundColor = UIColor.Gray;
            contentView.AddSubview(spinPicker);

            //cultureDoneButton
            cultureDoneButton = new UIButton();
            cultureDoneButton.SetTitle("Done\t", UIControlState.Normal);
            cultureDoneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            cultureDoneButton.BackgroundColor     = UIColor.FromRGB(240, 240, 240);
            cultureDoneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            cultureDoneButton.Hidden         = true;
            cultureDoneButton.Font           = UIFont.FromName("Helvetica", 14f);
            cultureDoneButton.TouchUpInside += HideSpinPicker;
            contentView.AddSubview(cultureDoneButton);

            //propertyLabel
            propertyLabel      = new UILabel();
            propertyLabel.Text = "OPTIONS";
            subView.AddSubview(propertyLabel);
            subView.BackgroundColor     = UIColor.FromRGB(230, 230, 230);
            contentView.BackgroundColor = UIColor.FromRGB(240, 240, 240);
            subView.AddSubview(contentView);
            this.AddSubview(subView);

            //ShowPropertyButton
            showPropertyButton        = new UIButton();
            showPropertyButton.Hidden = true;
            showPropertyButton.SetTitle(" OPTIONS\t", UIControlState.Normal);
            showPropertyButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            showPropertyButton.BackgroundColor     = UIColor.FromRGB(230, 230, 230);
            showPropertyButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            showPropertyButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                subView.Hidden            = false;
                showPropertyButton.Hidden = true;
            };
            this.AddSubview(showPropertyButton);


            //closeButton
            closeButton = new UIButton();
            closeButton.SetTitle("X\t", UIControlState.Normal);
            closeButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            closeButton.BackgroundColor     = UIColor.FromRGB(230, 230, 230);
            closeButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            closeButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                subView.Hidden            = true;
                showPropertyButton.Hidden = false;;
            };
            subView.AddSubview(closeButton);

            //Adding Gesture
            UITapGestureRecognizer tapgesture = new UITapGestureRecognizer(() =>
            {
                subView.Hidden            = true;
                showPropertyButton.Hidden = false;
            }
                                                                           );

            propertyLabel.UserInteractionEnabled = true;
            propertyLabel.AddGestureRecognizer(tapgesture);
        }
        public void mainPageDesign()
        {
            //headingLabel
            headingLabel.Text = "RangeSlider";
            headingLabel.Font = UIFont.FromName("Helvetica", 20f);

            //departureLabel
            departureLabel               = new UILabel();
            departureLabel.Text          = "Departure";
            departureLabel.TextColor     = UIColor.Black;
            departureLabel.TextAlignment = UITextAlignment.Left;
            departureLabel.Font          = UIFont.FromName("Helvetica", 18f);

            //tickLabel
            ticksLabel               = new UILabel();
            ticksLabel.Text          = "Tick Placement";
            ticksLabel.Font          = UIFont.FromName("Helvetica", 14f);
            ticksLabel.TextColor     = UIColor.Black;
            ticksLabel.TextAlignment = UITextAlignment.Left;

            //PlacementLabel
            placementLabel               = new UILabel();
            placementLabel.Text          = "Label Placement";
            placementLabel.Font          = UIFont.FromName("Helvetica", 14f);
            placementLabel.TextColor     = UIColor.Black;
            placementLabel.TextAlignment = UITextAlignment.Left;

            //TimeLabel 1
            timeLabel1               = new UILabel();
            timeLabel1.Text          = "(in Hours)";
            timeLabel1.TextColor     = UIColor.Gray;
            timeLabel1.TextAlignment = UITextAlignment.Left;
            timeLabel1.Font          = UIFont.FromName("Helvetica", 14f);

            //TimeLabel 2
            timeLabel2               = new UILabel();
            timeLabel2.Text          = "(in Hours)";
            timeLabel2.TextColor     = UIColor.Gray;
            timeLabel2.TextAlignment = UITextAlignment.Left;
            timeLabel2.Font          = UIFont.FromName("Helvetica", 14f);

            //SnapsToLabel
            snapsToLabel               = new UILabel();
            snapsToLabel.Text          = "Snap To Tick";
            snapsToLabel.Font          = UIFont.FromName("Helvetica", 14f);
            snapsToLabel.TextColor     = UIColor.Black;
            snapsToLabel.TextAlignment = UITextAlignment.Left;

            //TimeLabel 2
            timeLabel2               = new UILabel();
            timeLabel2.Text          = "Time: 12 AM - 12 PM";
            timeLabel2.TextColor     = UIColor.Gray;
            timeLabel2.TextAlignment = UITextAlignment.Left;
            timeLabel2.Font          = UIFont.FromName("Helvetica", 14f);

            //TimleLabel 3
            timeLabel3               = new UILabel();
            timeLabel3.Text          = "Time: 12 AM - 12 PM";
            timeLabel3.TextColor     = UIColor.Gray;
            timeLabel3.TextAlignment = UITextAlignment.Left;
            timeLabel3.Font          = UIFont.FromName("Helvetica", 14f);

            //PositionButtton
            positionbutton = new UIButton();
            positionbutton.SetTitle("BottomRight", UIControlState.Normal);
            positionbutton.Font = UIFont.FromName("Helvetica", 14f);
            positionbutton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            positionbutton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            positionbutton.Layer.CornerRadius  = 8;
            positionbutton.Layer.BorderWidth   = 2;
            positionbutton.TouchUpInside      += ShowPicker1;
            positionbutton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;

            //PositionButton 1
            positionbutton1 = new UIButton();
            positionbutton1.SetTitle("BottomRight", UIControlState.Normal);
            positionbutton1.Font = UIFont.FromName("Helvetica", 14f);
            positionbutton1.SetTitleColor(UIColor.Black, UIControlState.Normal);
            positionbutton1.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            positionbutton1.Layer.CornerRadius  = 8;
            positionbutton1.Layer.BorderWidth   = 2;
            positionbutton1.TouchUpInside      += ShowPicker2;
            positionbutton1.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;

            //DoneButton
            doneButton.SetTitle("Done\t", UIControlState.Normal);
            doneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            doneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            doneButton.TouchUpInside      += HidePicker;
            doneButton.Hidden          = true;
            doneButton.Font            = UIFont.FromName("Helvetica", 14f);
            doneButton.BackgroundColor = UIColor.FromRGB(240, 240, 240);

            //ShowLabel
            showLabel               = new UILabel();
            showLabel.Text          = "Show Label";
            showLabel.Font          = UIFont.FromName("Helvetica", 14f);
            showLabel.TextColor     = UIColor.Black;
            showLabel.TextAlignment = UITextAlignment.Left;

            //LabelSwitch
            labelswitch               = new UISwitch();
            labelswitch.On            = true;
            labelswitch.OnTintColor   = UIColor.FromRGB(50, 150, 221);
            labelswitch.ValueChanged += toggleChanged;

            //LabelSwitch 1
            labelswitch1               = new UISwitch();
            labelswitch1.OnTintColor   = UIColor.FromRGB(50, 150, 221);
            labelswitch1.On            = false;
            labelswitch1.ValueChanged += toggleChanged1;

            //ArrivalLabel
            arrivalLabel               = new UILabel();
            arrivalLabel.Text          = "Arrival";
            arrivalLabel.TextColor     = UIColor.Black;
            arrivalLabel.TextAlignment = UITextAlignment.Left;
            arrivalLabel.Font          = UIFont.FromName("Helvetica", 18f);

            //PositionPicker 1
            positionPicker1 = new UIPickerView();
            PickerModel model = new PickerModel(TAlignment);

            model.PickerChanged  += SelectedIndexChanged;
            positionPicker1.Model = model;
            positionPicker1.ShowSelectionIndicator = true;
            positionPicker1.Hidden          = true;
            positionPicker1.BackgroundColor = UIColor.Gray;

            //PositionPicker 2
            positionPicker2 = new UIPickerView();
            PickerModel model1 = new PickerModel(LAlignment);

            model1.PickerChanged += SelectedIndexChanged1;
            positionPicker2.Model = model1;
            positionPicker2.ShowSelectionIndicator = true;
            positionPicker2.BackgroundColor        = UIColor.Gray;
            positionPicker2.Hidden = true;

            //Adding to control view
            controlView.AddSubview(departureLabel);
            controlView.AddSubview(arrivalLabel);
            controlView.AddSubview(timeLabel1);
            controlView.AddSubview(timeLabel2);
            controlView.AddSubview(timeLabel2);
            controlView.AddSubview(timeLabel3);
        }