Ejemplo n.º 1
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			// Perform any additional setup after loading the view, typically from a nib.

			List<string> DataSourceList = new List<string> () {"itme1", "itme2", "itme3",
				"itme4", "itme5", "itme6", "itme7","itme8", "itme9", "itme10", "itme11"
			};

			this.myTableView.Source = new CustomerDataSource (DataSourceList);

			List<string> titleList = new List<string> (){ "A-Z", "a-z", "0-9","I-VVI" };
			List<string> Alist = new List<string> (){ "A", "B", "C", "D", "E" };
			List<string> NumList = new List<string> (){ "0", "1", "2", "3", "4" };
			List<string> MIList = new List<string> (){ "I", "II", "III", "VI", "VII" };

			this.customerStyleTableView = new UITableView (new CoreGraphics.CGRect (300, 50, 200, 600), UITableViewStyle.Grouped);
			this.customerStyleTableView.Source = new CustomerGroupSource (titleList, Alist, NumList,MIList);

			this.View.AddSubview(this.customerStyleTableView);

			this.customerAccessory = new UITableView (new CoreGraphics.CGRect (600, 50, 400, 600), UITableViewStyle.Grouped);
			this.customerAccessory.Source = new CustomerGroupSource (titleList, Alist, NumList,MIList);
			this.View.AddSubview (this.customerAccessory);

			usw = new UISwitch (new CoreGraphics.CGRect (820, 50, 50, 20));

			usw.ValueChanged += CSw_ValueChange;
			this.View.AddSubview (usw);
		}
		public BoolFormatCell ()
		{
			swicth = new UISwitch ();
			swicth.ValueChanged += Swicth_ValueChanged;
			this.CanRenderUnLoad = false;
			this.AddSubview (swicth);
		}
Ejemplo n.º 3
0
 public BooleanCellView()
     : base(UITableViewCellStyle.Default, "boolean_element")
 {
     Switch = new UISwitch();
     Switch.BackgroundColor = UIColor.Clear;
     SelectionStyle = UITableViewCellSelectionStyle.None;
 }
		public override UITableViewCell GetCell (UITableView tv)
		{
			if (sw == null){
				sw = new UISwitch (){
					BackgroundColor = UIColor.Clear,
					Tag = 1,
					On = Value
				};
				sw.AddTarget (delegate {
					Value = sw.On;
				}, UIControlEvent.ValueChanged);
			} else
				sw.On = Value;
			
			var cell = tv.DequeueReusableCell (CellKey);
			if (cell == null){
				cell = new UITableViewCell (UITableViewCellStyle.Default, CellKey);
				cell.SelectionStyle = UITableViewCellSelectionStyle.None;
			} else
				RemoveTag (cell, 1);
		
			cell.TextLabel.Text = Caption;
			cell.AccessoryView = sw;

			return cell;
		}
Ejemplo n.º 5
0
 void ReleaseDesignerOutlets()
 {
     if (florianSwitch != null) {
         florianSwitch.Dispose ();
         florianSwitch = null;
     }
 }
Ejemplo n.º 6
0
        public override UITableViewCell GetCell(UITableView tv)
        {
            if (_switch == null)
            {
                _switch = new UISwitch
                {
                    BackgroundColor = UIColor.Clear,
                    Tag = 1,
                    On = Value
                };
                _switch.AddTarget(delegate
                {
                    Value = _switch.On;
                }, UIControlEvent.ValueChanged);
            }
            else
            {
                _switch.On = Value;
            }

            var cell = tv.DequeueReusableCell ("boolean_element");
            if (cell == null){
                cell = new UITableViewCell (UITableViewCellStyle.Default, "boolean_element");
                cell.SelectionStyle = UITableViewCellSelectionStyle.None;
            }

            cell.BackgroundColor = StringElement.BgColor;
            cell.TextLabel.Font = StringElement.DefaultTitleFont.WithSize(StringElement.DefaultTitleFont.PointSize);
            cell.TextLabel.TextColor = StringElement.DefaultTitleColor;
            cell.TextLabel.Text = Caption;
            cell.AccessoryView = _switch;
            return cell;
        }
		public void Include (UISwitch sw)
		{
			sw.On = !sw.On;
			sw.ValueChanged += (sender, args) => {
				sw.On = false;
			};
		}
		void ReleaseDesignerOutlets ()
		{
			if (slider != null) {
				slider.Dispose ();
				slider = null;
			}
			if (sliderLabel != null) {
				sliderLabel.Dispose ();
				sliderLabel = null;
			}
			if (stepper != null) {
				stepper.Dispose ();
				stepper = null;
			}
			if (stepperLabel != null) {
				stepperLabel.Dispose ();
				stepperLabel = null;
			}
			if (switchLabel != null) {
				switchLabel.Dispose ();
				switchLabel = null;
			}
			if (thisSwitch != null) {
				thisSwitch.Dispose ();
				thisSwitch = null;
			}
		}
		void toggleAutomaticWaiting (UISwitch sender)
		{
			// Check for the new value of the switch and update AVPlayer property and user defaults
			if(Player != null)
				Player.AutomaticallyWaitsToMinimizeStalling = AutomaticWaitingSwitch.On;
			NSUserDefaults.StandardUserDefaults.SetBool (AutomaticWaitingSwitch.On, "disableAutomaticWaiting");
		}
Ejemplo n.º 10
0
		public override void LoadView ()
		{
			base.LoadView ();
			
			var camera = CameraPosition.FromCamera (latitude: 30.2652898, 
			                                        longitude: -97.7386826, 
			                                        zoom: 17,
			                                        bearing: 15,
			                                        viewingAngle: 15);
			mapView = MapView.FromCamera (View.Bounds, camera);
			mapView.MapType = MapViewType.Normal;
			mapView.MyLocationEnabled = true;
			//mapView.Frame = View.Frame;

			var hiltonOptions = new MarkerOptions();

			hiltonOptions.Position = new MonoTouch.CoreLocation.CLLocationCoordinate2D(30.2652898, -97.7386826);
			hiltonOptions.Title = "Evolve 2013";
			hiltonOptions.Snippet = "Austin, TX";
			mapView.AddMarker(hiltonOptions);

			View.Add (mapView);

			satelliteSwitch = new UISwitch ();
			satelliteSwitch.Frame = new RectangleF(11.0f, 11.0f, satelliteSwitch.Frame.Width, satelliteSwitch.Frame.Height);
			satelliteSwitch.On = false;
			View.Add (satelliteSwitch);

			currentLocNow = UIButton.FromType (UIButtonType.RoundedRect);
			currentLocNow.Frame = new RectangleF(50, 100, 100, 20);
			currentLocNow.Center = new PointF (View.Frame.Width/2, View.Frame.Height - 20.0f);
			currentLocNow.SetTitle ("ShowMyLoc", UIControlState.Normal);
			View.AddSubview (currentLocNow);
		}
 public ProductViewControllerToggleTableViewCell(IntPtr handle)
     : base(handle)
 {
     SelectionStyle = UITableViewCellSelectionStyle.None;
     toggleSwitch = new UISwitch ();
     AccessoryView = toggleSwitch;
 }
        public override void ViewDidLoad()
        {
            View = new UIView(){ BackgroundColor = UIColor.White};
            base.ViewDidLoad();

            // ios7 layout
            if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
                EdgesForExtendedLayout = UIRectEdge.None;

            var textFieldTitle = new UITextField(new RectangleF(10, 10, 300, 30));
            Add(textFieldTitle);
            var picker = new UIPickerView();
            var pickerViewModel = new MvxPickerViewModel(picker);
            picker.Model = pickerViewModel;
            picker.ShowSelectionIndicator = true; 
            textFieldTitle.InputView = picker;

            var textFieldFirstName = new UITextField(new RectangleF(10, 40, 300, 30));
            Add(textFieldFirstName);
            var textFieldLastName = new UITextField(new RectangleF(10, 70, 300, 30));
            Add(textFieldLastName);
            var acceptedLabel = new UILabel(new RectangleF(10, 100, 200, 30));
            acceptedLabel.Text = "Accepted?";
            Add(acceptedLabel);
            var accepted = new UISwitch(new RectangleF(210, 100, 100, 30));
            Add(accepted);
            var add = new UIButton(UIButtonType.RoundedRect);
            add.SetTitle("Add", UIControlState.Normal);
            add.TintColor = UIColor.Purple;
            add.Frame = new RectangleF(10,130,300,30);
            Add(add);

            var table = new UITableView(new RectangleF(10, 160, 300, 300));
            Add(table);
            var source = new MvxStandardTableViewSource(table, "TitleText FirstName");
            table.Source = source;

            var set = this.CreateBindingSet<FirstView, Core.ViewModels.FirstViewModel>();
            set.Bind(textFieldFirstName).To(vm => vm.FirstName);
            set.Bind(textFieldLastName).To(vm => vm.LastName);
            set.Bind(pickerViewModel).For(p => p.ItemsSource).To(vm => vm.Titles);
            set.Bind(pickerViewModel).For(p => p.SelectedItem).To(vm => vm.Title);
            set.Bind(textFieldTitle).To(vm => vm.Title);
            set.Bind(accepted).To(vm => vm.Accepted);
            set.Bind(add).To("Add");
            set.Bind(source).To(vm => vm.People);
            set.Apply();

            var tap = new UITapGestureRecognizer(() =>
                {
                    foreach (var view in View.Subviews)
                    {
                        var text = view as UITextField;
                        if (text != null)
                            text.ResignFirstResponder();
                    }
                });
            View.AddGestureRecognizer(tap);
        }
		partial void SubscriptionPreferenceUpdated (UISwitch sender)
		{
			if (sender.On) {
				CloudManager.Subscribe ();
			} else {
				CloudManager.Unsubscribe ();
			}
		}
Ejemplo n.º 14
0
		protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				Switch.Dispose();
				Switch = null;
			}
		}
Ejemplo n.º 15
0
        public void AddSubCatItem(iProPQRSPortableLib.Type item)
        {
            AttribType SelectedItem=SelectedAllType.Find(u=>u.ProcAttribTypeID == item.ProcAttribTypeID );
            UIView uvblock=new UIView(new CoreGraphics.CGRect(0,Ycord,380,60));
            UISwitch usOption=new UISwitch(new CoreGraphics.CGRect(8,10,51,31));
            usOption.Tag = item.ProcAttribTypeID;
            if (SelectedItem != null) {
                usOption.On = true;
                SaveAttribTypeList.Add (SelectedItem);
                SubCattextvalue.Add(item.Label);
            }
            usOption.ValueChanged += (object sender, EventArgs e) => {
                AttribType additem=new AttribType();
                additem.IsHighLighted=false;
                additem.ProcAttribTypeID= item.ProcAttribTypeID;
                additem.ProcID=ProcID;
                additem.Value=item.Label;

                AttribType existingitem= SelectedAllType.Find(u=>u.ProcAttribTypeID == item.ProcAttribTypeID );
                if(usOption.On)
                {
                    if(existingitem == null)
                        SaveAttribTypeList.Add (additem);

                    SubCattextvalue.Add(item.Label);
                }
                else
                {
                    SubCattextvalue.Remove(item.Label);
                    if(existingitem != null)
                    {
                        existingitem.Value="";
                        SaveAttribTypeList.Remove (existingitem);
                        SaveAttribTypeList.Add (existingitem);
                    }

                }
            };
            UILabel lbldesc=new UILabel(new CoreGraphics.CGRect(78,10,300,50));
            lbldesc.Lines = 2;
            lbldesc.Text = item.Label;
            uslist.Add (usOption);

            UIView uvbreackline=new UIView(new CoreGraphics.CGRect(0,60,380,1));
            uvbreackline.BackgroundColor = UIColor.Gray;

            uvblock.Add (usOption);
            uvblock.Add (lbldesc);
            uvblock.Add (uvbreackline);

            usSubCatView.Add (uvblock);

            Ycord = Ycord + 61;

            usSubCatView.SizeToFit ();
            usSubCatView.ContentSize = new SizeF (float.Parse (usSubCatView.Frame.Width.ToString ()), float.Parse (usSubCatView.Frame.Height.ToString ()) + (float)Ycord-100 );
        }
		protected override void Dispose (bool disposing)
		{
			if (disposing){
				if (sw != null){
					sw.Dispose ();
					sw = null;
				}
			}
		}
            public SwitchCell()
                : base(UITableViewCellStyle.Default, MultipleItemSelectionWithSwitchesViewController.ReuseIdentifier)
            {
                _switch = new UISwitch();

                AccessoryView = _switch;

                SelectionStyle = UITableViewCellSelectionStyle.None;
            }
Ejemplo n.º 18
0
 public LabelSwitchView ()
 {
     Add (label = new UILabel () {
         TranslatesAutoresizingMaskIntoConstraints = false,
     });
     Add (toggle = new UISwitch () {
         TranslatesAutoresizingMaskIntoConstraints = false,
     });
 }
Ejemplo n.º 19
0
		public override void ViewDidLoad ()
		{	
			base.ViewDidLoad ();
			
			#region UI Controls (you could do this in XIB if you want)
			saveButton = UIButton.FromType(UIButtonType.RoundedRect);
			saveButton.Frame = new RectangleF(10,10,145,50);
			saveButton.SetTitle("Save", UIControlState.Normal);
			saveButton.SetTitle("waiting...", UIControlState.Disabled);
			saveButton.Enabled = false;
			
			doneSwitch = new UISwitch();
			doneSwitch.Frame = new RectangleF(180, 25, 145, 50);
			doneSwitch.Enabled = false;
			doneLabel = new UILabel();
			doneLabel.Frame = new RectangleF(200, 10, 145, 15);
			doneLabel.Text = "Done?";

			titleText = new UITextView(new RectangleF(10, 70, 300, 40));
			titleText.BackgroundColor = UIColor.FromRGB(240,240,240);
			titleText.Editable = true;
			titleText.BackgroundColor = UIColor.FromRGB(240,240,240);

			descriptionText = new UITextView(new RectangleF(10, 130, 300, 180));
			descriptionText.BackgroundColor = UIColor.FromRGB(240,240,240);
			descriptionText.Editable = true;
			descriptionText.ScrollEnabled = true;
			descriptionText.AutoresizingMask = UIViewAutoresizing.FlexibleHeight;

			// Add the controls to the view
			this.Add(saveButton);
			this.Add(doneLabel);
			this.Add(doneSwitch);
			this.Add(descriptionText);
			this.Add(titleText);
			#endregion

			saveButton.TouchUpInside += (sender, e) => {

				doc.TheTask.Title = titleText.Text;
				doc.TheTask.Description = descriptionText.Text;
				doc.TheTask.IsDone = doneSwitch.On;

				doc.UpdateChangeCount (UIDocumentChangeKind.Done);	// tell UIDocument it needs saving
				descriptionText.ResignFirstResponder ();			// hide keyboard
				titleText.ResignFirstResponder ();
			};
			
			LoadData ();

			NSNotificationCenter.DefaultCenter.AddObserver (this
				, new Selector("dataReloaded:")
				, new NSString("taskModified"),
				null);

		}
Ejemplo n.º 20
0
		protected override void Dispose(bool disposing)
		{
			if (disposing && Switch != null)
			{
				Switch.Dispose();
				Switch = null;
			}
			
			base.Dispose(disposing);
		}
Ejemplo n.º 21
0
		partial void SecureSwitchChanged (UISwitch sender)
		{
			var uri = new UriBuilder (locationTextField.Text);
			if (sender.On) {
				uri.Scheme = "wss";
			} else {
				uri.Scheme = "ws";
			}
			locationTextField.Text = uri.ToString ();
		}
Ejemplo n.º 22
0
		private void prepareCell(){
			_switch = new UISwitch (){
				BackgroundColor = UIColor.Clear
			};
			_switch.AddTarget (delegate {
				_element.Value = _switch.On;
			}, UIControlEvent.ValueChanged);
			
			AccessoryView = _switch;
		}
Ejemplo n.º 23
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            _switch = new UISwitch();

            View.AddSubview(_switch);

            View.SetStyleClass("sample-background");
            _switch.SetStyleId("sample-switch");
        }
Ejemplo n.º 24
0
//		public BooleanElement(RectangleF frame) : this("")
//		{
//			Frame = frame;
//		}
		
		public override void InitializeContent()
		{
			if (Switch == null)
			{
				Switch = new UISwitch { BackgroundColor = UIColor.Clear, Tag = 1 };
				
				Switch.AddTarget(delegate { DataBinding.UpdateDataContext(); }, UIControlEvent.ValueChanged);
			}
			
			Cell.AccessoryView = Switch;
		}
 void ReleaseDesignerOutlets()
 {
     if (enterSwitch != null) {
         enterSwitch.Dispose ();
         enterSwitch = null;
     }
     if (exitSwitch != null) {
         exitSwitch.Dispose ();
         exitSwitch = null;
     }
 }
		partial void switchChanged(UISwitch sender)
		{
			int index = (int)sender.Tag;
			if (sender.On)
			{
				chart.Series[index].Visibility = SeriesVisibility.Visible;
			}
			else
			{
				chart.Series[index].Visibility = SeriesVisibility.Hidden;
			}

		}
 void ReleaseDesignerOutlets()
 {
     if (LabelTime != null) {
         LabelTime.Dispose ();
         LabelTime = null;
     }
     if (NearablePicker != null) {
         NearablePicker.Dispose ();
         NearablePicker = null;
     }
     if (SwitchEnable != null) {
         SwitchEnable.Dispose ();
         SwitchEnable = null;
     }
 }
        void Initialize()
        {
            BackgroundColor = UIColor.LightGray;

            for (var i = 0; i < 4; i++)
            {
                var box = new UISwitch(new RectangleF(10, 30*i, 300, 30));
                AddSubview(box);
                _boxes.Add(box);
                box.ValueChanged += (sender, args) =>
                {
                    UpdateCount();
                };
            }
        }
Ejemplo n.º 29
0
		public override void InitializeCell(UITableView tableView)
		{
			RemoveTag(1);
			if (Switch == null)
			{
				Switch = new UISwitch { BackgroundColor = UIColor.Clear, Tag = 1, On = Value };
				Switch.AddTarget(delegate
				{
					Value = Switch.On;
				}, UIControlEvent.ValueChanged);
			}

			Cell.TextLabel.Text = Caption;
			Cell.AccessoryView = Switch;
		}
Ejemplo n.º 30
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			Title = "Buttons";
			View.BackgroundColor = UIColor.White;
			
			buttonStarRect = UIButton.FromType(UIButtonType.RoundedRect);
			buttonStarRect.SetImage (UIImage.FromFile ("star-gold45.png"), UIControlState.Normal);
			buttonStarRect.SetImage (UIImage.FromFile ("star-grey45.png"), UIControlState.Disabled);

			buttonStarRect.Frame = new CGRect(160, 20, 45, 42);
			buttonStarRect.TouchUpInside += HandleTouchUpInside;
			

			buttonStarCustom = UIButton.FromType(UIButtonType.Custom);
			buttonStarCustom.SetImage (UIImage.FromFile ("star-gold45.png"), UIControlState.Normal);
			buttonStarCustom.SetImage (UIImage.FromFile ("star-gold45_sel.png"), UIControlState.Highlighted);
			buttonStarCustom.SetImage (UIImage.FromFile ("star-grey45.png"), UIControlState.Disabled);

			buttonStarCustom.Frame = new CGRect(160, 70, 45, 42);
			buttonStarCustom.TouchUpInside += HandleTouchUpInside;


			switchEnabled = new UISwitch(new CGRect(140, 130, 50, 30));
			switchEnabled.ValueChanged += (sender, e) => {
				buttonStarRect.Enabled = switchEnabled.On;
				buttonStarCustom.Enabled = switchEnabled.On;
			};
			switchEnabled.On = true;


			#region Not related to sample
			rectLabel = new UILabel(new CGRect(10, 20, 150, 30));
			rectLabel.Text = "RoundedRect:";
			customLabel = new UILabel(new CGRect(10, 70, 150, 30));
			customLabel.Text = "Custom:";
			switchLabel = new UILabel(new CGRect(10, 130, 150, 30));
			switchLabel.Text = "Enabled:";
			View.AddSubview (rectLabel);
			View.AddSubview (customLabel);
			View.AddSubview (switchLabel);
			#endregion

			View.AddSubview (buttonStarRect);
			View.AddSubview (buttonStarCustom);
			View.AddSubview (switchEnabled);

		}
Ejemplo n.º 31
0
        void getPropertiesInitialization()
        {
            navigationModePicker      = new UIPickerView();
            navigationDirectionPicker = new UIPickerView();
            tabStripPicker            = new UIPickerView();
            PickerModel navigationModeModel = new PickerModel(navigationModeList);

            navigationModePicker.Model = navigationModeModel;
            PickerModel navigationDirectionModel = new PickerModel(navigationDirectionList);

            navigationDirectionPicker.Model = navigationDirectionModel;
            PickerModel tabStripModel = new PickerModel(tabStripPositionList);

            tabStripPicker.Model = tabStripModel;

            //navigationModeLabel
            navigationModeLabel                    = new UILabel();
            navigationModeLabel.Text               = "NavigationStrip Mode";
            navigationModeLabel.Font               = UIFont.FromName("Helvetica", 14f);
            navigationModeLabel.TextColor          = UIColor.Black;
            navigationModeLabel.TextAlignment      = UITextAlignment.Left;
            navigationDirectionLabel               = new UILabel();
            navigationDirectionLabel.Text          = "Navigation Direction";
            navigationDirectionLabel.Font          = UIFont.FromName("Helvetica", 14f);
            navigationDirectionLabel.TextColor     = UIColor.Black;
            navigationDirectionLabel.TextAlignment = UITextAlignment.Left;
            tabStripLabel               = new UILabel();
            tabStripLabel.Text          = "NavigationStrip Position";
            tabStripLabel.Font          = UIFont.FromName("Helvetica", 14f);
            tabStripLabel.TextColor     = UIColor.Black;
            tabStripLabel.TextAlignment = UITextAlignment.Left;

            //navigationModeButton
            navigationModeButton = new UIButton();
            navigationModeButton.SetTitle("Dots", UIControlState.Normal);
            navigationModeButton.Font = UIFont.FromName("Helvetica", 14f);
            navigationModeButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            navigationModeButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            navigationModeButton.Layer.CornerRadius  = 8;
            navigationModeButton.Layer.BorderWidth   = 2;

            navigationModeButton.Layer.BorderColor = UIColor.FromRGB(246, 246, 246).CGColor;

            //navigationDirectionButton
            navigationDirectionButton = new UIButton();
            navigationDirectionButton.SetTitle("Horizontal", UIControlState.Normal);
            navigationDirectionButton.Font = UIFont.FromName("Helvetica", 14f);
            navigationDirectionButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            navigationDirectionButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            navigationDirectionButton.Layer.CornerRadius  = 8;
            navigationDirectionButton.Layer.BorderWidth   = 2;

            navigationDirectionButton.Layer.BorderColor = UIColor.FromRGB(246, 246, 246).CGColor;

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

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

            //picker
            navigationModeModel.PickerChanged               += navigationModeSelectedIndexChanged;
            navigationDirectionModel.PickerChanged          += navigationDirectionSelectedIndexChanged;
            tabStripModel.PickerChanged                     += tabStripSelectedIndexChanged;
            navigationModePicker.ShowSelectionIndicator      = true;
            navigationModePicker.Hidden                      = true;
            navigationModePicker.BackgroundColor             = UIColor.Gray;
            navigationDirectionPicker.BackgroundColor        = UIColor.Gray;
            navigationDirectionPicker.ShowSelectionIndicator = true;
            navigationDirectionPicker.Hidden                 = true;
            tabStripPicker.BackgroundColor                   = UIColor.Gray;
            tabStripPicker.ShowSelectionIndicator            = true;
            tabStripPicker.Hidden = true;

            //autoPlayLabel
            autoPlayLabel                 = new UILabel();
            autoPlayLabel.TextColor       = UIColor.Black;
            autoPlayLabel.BackgroundColor = UIColor.Clear;
            autoPlayLabel.Text            = @"Enable AutoPlay";
            autoPlayLabel.TextAlignment   = UITextAlignment.Left;
            autoPlayLabel.Font            = UIFont.FromName("Helvetica", 14f);
            //allowSwitch
            autoPlaySwitch = new UISwitch();
            autoPlaySwitch.ValueChanged += autoPlayToggleChanged;
            autoPlaySwitch.On            = false;
            autoPlaySwitch.OnTintColor   = UIColor.FromRGB(50, 150, 221);

            controlView.AddSubview(rotator);
            this.AddSubview(controlView);

            sub_View           = new UIView();
            propertiesLabel    = new UILabel();
            closeButton        = new UIButton();
            showPropertyButton = new UIButton();

            //adding to content view
            contentView.AddSubview(navigationModeLabel);
            contentView.AddSubview(navigationModeButton);
            contentView.AddSubview(navigationDirectionLabel);
            contentView.AddSubview(navigationDirectionButton);
            contentView.AddSubview(tabStripLabel);
            contentView.AddSubview(tabStripButton);
            contentView.AddSubview(autoPlayLabel);
            contentView.AddSubview(autoPlaySwitch);
            contentView.AddSubview(doneButton);
            contentView.AddSubview(navigationModePicker);
            contentView.AddSubview(tabStripPicker);
            contentView.AddSubview(navigationDirectionPicker);
            contentView.BackgroundColor = UIColor.FromRGB(240, 240, 240);

            //adding to sub_view
            sub_View.AddSubview(contentView);
            sub_View.AddSubview(closeButton);
            sub_View.AddSubview(propertiesLabel);
            sub_View.BackgroundColor = UIColor.FromRGB(230, 230, 230);
            this.AddSubview(sub_View);
            propertiesLabel.Text = "OPTIONS";

            //showPropertyButton
            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) => {
                sub_View.Hidden           = false;
                showPropertyButton.Hidden = true;
            };
            this.AddSubview(showPropertyButton);

            //CloseButton
            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) => {
                sub_View.Hidden           = true;
                showPropertyButton.Hidden = false;
            };

            //AddingGesture
            UITapGestureRecognizer tapgesture = new UITapGestureRecognizer(() => {
                sub_View.Hidden           = true;
                showPropertyButton.Hidden = false;
            }
                                                                           );

            propertiesLabel.UserInteractionEnabled = true;
            propertiesLabel.AddGestureRecognizer(tapgesture);
        }
Ejemplo n.º 32
0
        public override void ViewDidLoad()
        {
            View = new UIView()
            {
                BackgroundColor = UIColor.White
            };
            base.ViewDidLoad();

            // ios7 layout
            if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
            {
                EdgesForExtendedLayout = UIRectEdge.None;
            }

            var textFieldTitle = new UITextField(new RectangleF(10, 10, 300, 30));

            Add(textFieldTitle);
            var picker          = new UIPickerView();
            var pickerViewModel = new MvxPickerViewModel(picker);

            picker.Model = pickerViewModel;
            picker.ShowSelectionIndicator = true;
            textFieldTitle.InputView      = picker;

            var textFieldFirstName = new UITextField(new RectangleF(10, 40, 300, 30));

            Add(textFieldFirstName);
            var textFieldLastName = new UITextField(new RectangleF(10, 70, 300, 30));

            Add(textFieldLastName);
            var acceptedLabel = new UILabel(new RectangleF(10, 100, 200, 30));

            acceptedLabel.Text = "Accepted?";
            Add(acceptedLabel);
            var accepted = new UISwitch(new RectangleF(210, 100, 100, 30));

            Add(accepted);
            var add = new UIButton(UIButtonType.RoundedRect);

            add.SetTitle("Add", UIControlState.Normal);
            add.Frame = new RectangleF(10, 130, 300, 30);
            Add(add);
            var debugView = new UILabel(new RectangleF(10, 130, 300, 30));

            Add(debugView);

            var table = new UITableView(new RectangleF(10, 160, 300, 300));

            Add(table);
            var source = new MvxStandardTableViewSource(table, "TitleText FirstName");

            table.Source = source;

            var set = this.CreateBindingSet <FirstView, Core.ViewModels.FirstViewModel>();

            set.Bind(textFieldFirstName).To(vm => vm.FirstName);
            set.Bind(textFieldLastName).To(vm => vm.LastName);
            set.Bind(pickerViewModel).For(p => p.ItemsSource).To(vm => vm.Titles);
            set.Bind(pickerViewModel).For(p => p.SelectedItem).To(vm => vm.Title);
            set.Bind(textFieldTitle).To(vm => vm.Title);
            set.Bind(accepted).To(vm => vm.Accepted);
            set.Bind(add).To(vm => vm.AddCommand);
            set.Bind(source).To(vm => vm.People);

            //set.Bind(debugView).To("If(Accepted, Format('{0} {1} ({2})', FirstName, LastName, Title), 'nada')");
            set.Bind(debugView).To("Strip(FirstName, 'S') + Strip(LastName,'S')");
            set.Apply();

            var tap = new UITapGestureRecognizer(() =>
            {
                foreach (var view in View.Subviews)
                {
                    var text = view as UITextField;
                    if (text != null)
                    {
                        text.ResignFirstResponder();
                    }
                }
            });

            View.AddGestureRecognizer(tap);
        }
Ejemplo n.º 33
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            #region UI Controls (you could do this in XIB if you want)
            saveButton       = UIButton.FromType(UIButtonType.RoundedRect);
            saveButton.Frame = new RectangleF(10, 10, 145, 40);
            saveButton.SetTitle("Save", UIControlState.Normal);
            saveButton.SetTitle("waiting...", UIControlState.Disabled);
            saveButton.Enabled = false;

            deleteButton       = UIButton.FromType(UIButtonType.RoundedRect);
            deleteButton.Frame = new RectangleF(10, 150, 145, 40);
            deleteButton.SetTitle("Delete", UIControlState.Normal);
            deleteButton.Enabled = false;

            doneSwitch         = new UISwitch();
            doneSwitch.Frame   = new RectangleF(185, 30, 145, 50);
            doneSwitch.Enabled = false;
            doneLabel          = new UILabel();
            doneLabel.Frame    = new RectangleF(200, 10, 145, 15);
            doneLabel.Text     = "Done?";

            titleText = new UITextView(new RectangleF(10, 70, 300, 40));
            titleText.BackgroundColor = UIColor.FromRGB(240, 240, 240);
            titleText.Editable        = true;
            titleText.BackgroundColor = UIColor.FromRGB(240, 240, 240);

            descriptionText = new UITextView(new RectangleF(10, 130, 300, 180));
            descriptionText.BackgroundColor  = UIColor.FromRGB(240, 240, 240);
            descriptionText.Editable         = true;
            descriptionText.ScrollEnabled    = true;
            descriptionText.AutoresizingMask = UIViewAutoresizing.FlexibleHeight;

            // Add the controls to the view
            this.Add(saveButton);
            this.Add(deleteButton);
            this.Add(doneLabel);
            this.Add(doneSwitch);
            //this.Add(descriptionText);   // disabled for Azure demo (for now...)
            this.Add(titleText);
            #endregion

            LoadData();

            saveButton.TouchUpInside += (sender, e) => {
                task.Title       = titleText.Text;
                task.Description = descriptionText.Text;
                task.IsDone      = doneSwitch.On;

                // save to Azure
                AzureWebService.UpdateTodo(task);

                descriptionText.ResignFirstResponder();                                         // hide keyboard
                titleText.ResignFirstResponder();

                NavigationController.PopToRootViewController(true);
            };

            deleteButton.TouchUpInside += (sender, e) => {
                // save to Azure
                AzureWebService.DeleteTodo(task);

                descriptionText.ResignFirstResponder();                                         // hide keyboard
                titleText.ResignFirstResponder();

                NavigationController.PopToRootViewController(true);                  // doesn't reflect deletion yet
            };
        }
Ejemplo n.º 34
0
            public EqualizerView(EqualizerViewController eqvc)
            {
                BackgroundColor = UIColor.White;
                Parent          = eqvc;

                line1 = new UIView()
                {
//						BackgroundColor =Style.Current.Equalizer.LineColor.Value,
                };
                this.AddSubview(line1);
                line2 = new UIView()
                {
//						BackgroundColor =Style.Current.Equalizer.LineColor.Value,
                };
                this.AddSubview(line2);
                active.Text = Strings.Active;
//				active.Font =Style.Current.Equalizer.TitleFont.Value;
//				active.TextColor =Style.Current.Equalizer.TitleFontColor.Value;
                active.SizeToFit();
                this.AddSubview(active);


                preset.Text = Strings.DefaultPreset;
//				preset.Font =Style.Current.Equalizer.TitleFont.Value;
//				preset.TextColor =Style.Current.Equalizer.TitleFontColor.Value;
                preset.SizeToFit();
                this.AddSubview(preset);


                onSwitch    = new UISwitch(new CGRect(0, 0, 47, 10)).StyleSwitch();
                onSwitch.On = Settings.EqualizerEnabled;
//				onSwitch.TintColor = UIColor.FromPatternImage(Images.SwitchOffBackground.Value);
//				onSwitch.OnTintColor = UIColor.FromPatternImage(Images.SwitchOnBackground.Value);
//				onSwitch.ThumbTintColor =Style.Current.Equalizer.SwitchOnThumbColor.Value;

                onSwitch.ValueChanged += delegate
                {
                    Equalizer.Shared.Active = onSwitch.On;
                    updateImages();
                };
                //onLabel = new UILabel(new CGRect(0,0,100,22)){Text = "On".Translate(), BackgroundColor = UIColor.Clear};
                this.AddSubview(onSwitch);
                //this.AddSubview(onLabel);


                init();

                combobox = new UIComboBox
                {
                    Items         = Equalizer.Shared.Presets.ToArray(),
                    DisplayMember = "Name",
                    ViewForPicker = Parent,
                    TextColor     = textColor,
//					Font =Style.Current.Equalizer.PresetFont.Value,
                    TextAlignment = UITextAlignment.Right
                };


                combobox.ValueChanged += delegate { SetPreset((EqualizerPreset)combobox.SelectedItem); };
                this.AddSubview(combobox);
                SetCombobox();

                toolbar = new UIToolbar();
//				toolbar.SetBackgroundImage(Images.ToolbarBackground.Value, UIToolbarPosition.Any, UIBarMetrics.Default);
                toolbar.SetItems(new UIBarButtonItem[]
                {
                    new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace)
                    {
                        Width = 10
                    },
                    new UIBarButtonItem(Images.GetEditIcon(25), UIBarButtonItemStyle.Plain, (sender, args) => Rename()),

                    new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                    new UIBarButtonItem(Images.GetCopyIcon(25), UIBarButtonItemStyle.Plain, (sender, args) => Duplicate()),

                    new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                    new UIBarButtonItem(Images.GetDeleteIcon(25), UIBarButtonItemStyle.Plain, (sender, args) => Delete()),

                    new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                    new UIBarButtonItem(Images.GetUndoImage(25), UIBarButtonItemStyle.Plain, (sender, args) => Undo()),

                    new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace)
                    {
                        Width = 10
                    },
                }, false);

                this.AddSubview(toolbar);
            }
Ejemplo n.º 35
0
        public void loadOptionView()
        {
            contentView = new UIView();

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

            //allowSwitch
            allowSwitch               = new UISwitch();
            allowSwitch.OnTintColor   = UIColor.FromRGB(50, 150, 221);
            allowSwitch.ValueChanged += allowNullToggleChanged;
            allowSwitch.On            = true;
            contentView.AddSubview(allowSwitch);

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

            //adding locale to culture listt
            this.cultureList.Add((NSString)"United States");
            this.cultureList.Add((NSString)"United Kingdom");
            this.cultureList.Add((NSString)"Japan");
            this.cultureList.Add((NSString)"France");
            this.cultureList.Add((NSString)"Italy");

            //cultureButton
            cultureButton = new UIButton();
            cultureButton.SetTitle("United States", UIControlState.Normal);
            cultureButton.Font = UIFont.FromName("Helvetica", 14f);
            cultureButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            cultureButton.BackgroundColor     = UIColor.Clear;
            cultureButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            cultureButton.Hidden             = false;
            cultureButton.Layer.BorderColor  = UIColor.FromRGB(246, 246, 246).CGColor;
            cultureButton.Layer.BorderWidth  = 4;
            cultureButton.Layer.CornerRadius = 8;
            cultureButton.TouchUpInside     += (object sender, EventArgs e) =>
            {
                cultureDoneButton.Hidden = false;
                culturePicker.Hidden     = false;
                allowNullLabel.Hidden    = true;
                allowSwitch.Hidden       = true;
            };
            contentView.AddSubview(cultureButton);

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

            culturePickermodel.PickerChanged += (sender, e) =>
            {
                this.cultureSelectedType = e.SelectedValue;
                cultureButton.SetTitle(cultureSelectedType, UIControlState.Normal);
                if (cultureSelectedType == "United States")
                {
                    principalNumericTextBox.CultureInfo    = new NSLocale("en_US");
                    interestRateNumericTextBox.CultureInfo = new NSLocale("en_US");
                    periodNumericTextBox.CultureInfo       = new NSLocale("en_US");
                    outputNumericTextBox.CultureInfo       = new NSLocale("en_US");
                }
                else if (cultureSelectedType == "United Kingdom")
                {
                    principalNumericTextBox.CultureInfo    = new NSLocale("en_UK");
                    interestRateNumericTextBox.CultureInfo = new NSLocale("en_UK");
                    periodNumericTextBox.CultureInfo       = new NSLocale("en_UK");
                    outputNumericTextBox.CultureInfo       = new NSLocale("en_UK");
                }
                else if (cultureSelectedType == "Japan")
                {
                    principalNumericTextBox.CultureInfo    = new NSLocale("jp_JP");
                    interestRateNumericTextBox.CultureInfo = new NSLocale("jp_JP");
                    periodNumericTextBox.CultureInfo       = new NSLocale("jp_JP");
                    outputNumericTextBox.CultureInfo       = new NSLocale("jp_JP");
                }
                else if (cultureSelectedType == "France")
                {
                    principalNumericTextBox.CultureInfo    = new NSLocale("fr_FR");
                    interestRateNumericTextBox.CultureInfo = new NSLocale("fr_FR");
                    periodNumericTextBox.CultureInfo       = new NSLocale("fr_FR");
                    outputNumericTextBox.CultureInfo       = new NSLocale("fr_FR");
                }
                else if (cultureSelectedType == "Italy")
                {
                    principalNumericTextBox.CultureInfo    = new NSLocale("it_IT");
                    interestRateNumericTextBox.CultureInfo = new NSLocale("it_IT");
                    periodNumericTextBox.CultureInfo       = new NSLocale("it_IT");
                    outputNumericTextBox.CultureInfo       = new NSLocale("it_IT");
                }
            };

            //culturePicker
            culturePicker = new UIPickerView();
            culturePicker.ShowSelectionIndicator = true;
            culturePicker.Hidden          = true;
            culturePicker.Model           = culturePickermodel;
            culturePicker.BackgroundColor = UIColor.Gray;
            contentView.AddSubview(culturePicker);

            //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 += HideCulturePicker;
            contentView.AddSubview(cultureDoneButton);

            //propertiesLabel
            propertiesLabel      = new UILabel();
            propertiesLabel.Text = "OPTIONS";


            //showPropertyButton
            showPropertyButton        = new UIButton();
            showPropertyButton.Hidden = true;
            showPropertyButton.SetTitle(" OPTIONS\t", UIControlState.Normal);
            showPropertyButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
            showPropertyButton.BackgroundColor     = UIColor.FromRGB(240, 240, 240);
            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;
            };

            //subVieww
            subView.AddSubview(closeButton);
            subView.AddSubview(propertiesLabel);
            subView.BackgroundColor     = UIColor.FromRGB(230, 230, 230);
            contentView.BackgroundColor = UIColor.FromRGB(240, 240, 240);
            subView.AddSubview(contentView);
            this.AddSubview(subView);


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

            propertiesLabel.UserInteractionEnabled = true;
            propertiesLabel.AddGestureRecognizer(tapgesture);
        }
 /// <summary>
 /// Includes the specified UI switch.
 /// </summary>
 /// <param name="uiSwitch">The UI switch.</param>
 public void Include(UISwitch uiSwitch)
 {
     uiSwitch.On            = !uiSwitch.On;
     uiSwitch.ValueChanged += (sender, args) => { uiSwitch.On = false; };
 }
Ejemplo n.º 37
0
 private void ToggleAllControlsEnabled(bool enabled, List <EOSSandboxDropDown> spinners, UIButton resetUIButton, UISwitch enabledSwitch)
 {
     spinners.ToList().ForEach(s => s.Enabled = enabled);
     resetUIButton.Enabled = enabled;
     enabledSwitch.Enabled = enabled;
 }
Ejemplo n.º 38
0
 partial void PWSwitchAction(UISwitch sender)
 {
     NSUserDefaults.StandardUserDefaults.SetBool(sender.On, "is_save_password");
 }
Ejemplo n.º 39
0
 partial void IDSwitchAction(UISwitch sender)
 {
     NSUserDefaults.StandardUserDefaults.SetBool(sender.On, "is_save_loginid");
 }
Ejemplo n.º 40
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.White;
            _key = new UITextField {
                Placeholder            = "Key",
                ShouldReturn           = ShouldReturn,
                KeyboardType           = UIKeyboardType.Default,
                ClearButtonMode        = UITextFieldViewMode.Always,
                ReturnKeyType          = UIReturnKeyType.Default,
                ShouldClear            = field => true,
                AutocapitalizationType = UITextAutocapitalizationType.None,
            };
            _value = new UITextField
            {
                Placeholder            = "Value",
                ShouldReturn           = ShouldReturn,
                KeyboardType           = UIKeyboardType.Default,
                ClearButtonMode        = UITextFieldViewMode.Always,
                ReturnKeyType          = UIReturnKeyType.Default,
                ShouldClear            = field => true,
                AutocapitalizationType = UITextAutocapitalizationType.None,
            };
            _keyLabel = new UILabel {
                Text = "Key"
            };
            _valueLabel = new UILabel {
                Text = "Value"
            };
            _saveSetting = UIButton.FromType(UIButtonType.RoundedRect);
            _saveSetting.SetTitle("Save", UIControlState.Normal);
            _retrieveSetting = UIButton.FromType(UIButtonType.RoundedRect);
            _retrieveSetting.SetTitle("Get", UIControlState.Normal);

            _boolLabel = new UILabel {
                Text = "Bool Value"
            };
            _restoredBoolLabel = new UILabel {
                Text = "Restored Bool Value"
            };
            _restoredBoolValue = new UILabel();
            _boolSwitch        = new UISwitch();

            var bSet = this.CreateBindingSet <TestView, TestViewModel>();

            bSet.Bind(_key).To(vm => vm.StringKey).TwoWay();
            bSet.Bind(_value).To(vm => vm.StringSetting);
            bSet.Bind(_saveSetting).To(vm => vm.SaveSettingsCommand);
            bSet.Bind(_retrieveSetting).To(vm => vm.RestoreSettingsCommand);
            bSet.Bind(_boolSwitch).To(vm => vm.BoolSetting).TwoWay();
            bSet.Bind(_restoredBoolValue).To(vm => vm.RestoredBoolSetting);
            bSet.Apply();

            Add(_keyLabel);
            Add(_key);
            Add(_valueLabel);
            Add(_value);
            Add(_saveSetting);
            Add(_retrieveSetting);
            Add(_boolLabel);
            Add(_boolSwitch);
            Add(_restoredBoolLabel);
            Add(_restoredBoolValue);

            View.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();
        }
Ejemplo n.º 41
0
        public override void LoadView()
        {
            // Create the views.
            View = new UIView {
                BackgroundColor = UIColor.White
            };

            _outerStackView = new UIStackView();
            _outerStackView.TranslatesAutoresizingMaskIntoConstraints = false;
            _outerStackView.Axis         = UILayoutConstraintAxis.Vertical;
            _outerStackView.Distribution = UIStackViewDistribution.FillEqually;

            _myMapView = new MapView();
            _myMapView.TranslatesAutoresizingMaskIntoConstraints = false;

            _transformToolsView = new UIStackView();
            _transformToolsView.TranslatesAutoresizingMaskIntoConstraints = false;
            _transformToolsView.Axis    = UILayoutConstraintAxis.Vertical;
            _transformToolsView.Spacing = 8;
            _transformToolsView.LayoutMarginsRelativeArrangement = true;
            _transformToolsView.LayoutMargins = new UIEdgeInsets(8, 8, 8, 8);

            _inWkidLabel = new UILabel();
            _inWkidLabel.TranslatesAutoresizingMaskIntoConstraints = false;
            _outWkidLabel = new UILabel();
            _outWkidLabel.TranslatesAutoresizingMaskIntoConstraints = false;

            UIStackView labelsRow = new UIStackView(new[] { _inWkidLabel, _outWkidLabel });

            labelsRow.TranslatesAutoresizingMaskIntoConstraints = false;
            labelsRow.Axis         = UILayoutConstraintAxis.Horizontal;
            labelsRow.Distribution = UIStackViewDistribution.FillEqually;
            _transformToolsView.AddArrangedSubview(labelsRow);

            _useExtentSwitch = new UISwitch();
            _useExtentSwitch.TranslatesAutoresizingMaskIntoConstraints = false;
            UILabel useExtentSwitchLabel = new UILabel();

            useExtentSwitchLabel.TranslatesAutoresizingMaskIntoConstraints = false;
            useExtentSwitchLabel.Text = "Use extent";

            UIStackView switchRow = new UIStackView(new UIView[] { _useExtentSwitch, useExtentSwitchLabel });

            switchRow.TranslatesAutoresizingMaskIntoConstraints = false;
            switchRow.Axis    = UILayoutConstraintAxis.Horizontal;
            switchRow.Spacing = 8;
            _transformToolsView.AddArrangedSubview(switchRow);

            _transformationsPicker = new UIPickerView();
            _transformationsPicker.TranslatesAutoresizingMaskIntoConstraints = false;
            _transformationsPicker.SetContentCompressionResistancePriority((float)UILayoutPriority.DefaultLow, UILayoutConstraintAxis.Vertical);
            _transformToolsView.AddArrangedSubview(_transformationsPicker);

            _messagesTextView = new UITextView();
            _messagesTextView.TranslatesAutoresizingMaskIntoConstraints = false;
            _messagesTextView.SetContentCompressionResistancePriority((float)UILayoutPriority.Required, UILayoutConstraintAxis.Vertical);
            _messagesTextView.ScrollEnabled = false;
            _transformToolsView.AddArrangedSubview(_messagesTextView);

            _outerStackView.AddArrangedSubview(_myMapView);
            _outerStackView.AddArrangedSubview(_transformToolsView);

            // Add the views.
            View.AddSubviews(_outerStackView);

            // Lay out the views.
            NSLayoutConstraint.ActivateConstraints(new[]
            {
                _outerStackView.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor),
                _outerStackView.LeadingAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.LeadingAnchor),
                _outerStackView.TrailingAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TrailingAnchor),
                _outerStackView.BottomAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.BottomAnchor)
            });
        }
Ejemplo n.º 42
0
 //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 partial void onlMySwitchChanged(UISwitch sender)
 {
     DataManager.onlyMyMachines = OnlyMyButton.On;
     Application.StoreValues();
 }
Ejemplo n.º 43
0
 /// <summary>
 /// Apply this theme to a specific view.
 /// </summary>
 public static void Apply(UISwitch view, string options = null)
 {
 }
Ejemplo n.º 44
0
        void getPropertiesInitialization()
        {
            navigationModePicker      = new UIPickerView();
            navigationDirectionPicker = new UIPickerView();
            tabStripPicker            = new UIPickerView();
            PickerModel navigationModeModel = new PickerModel(navigationModeList);

            navigationModePicker.Model = navigationModeModel;
            PickerModel navigationDirectionModel = new PickerModel(navigationDirectionList);

            navigationDirectionPicker.Model = navigationDirectionModel;
            PickerModel tabStripModel = new PickerModel(tabStripPositionList);

            tabStripPicker.Model = tabStripModel;

            //navigationModeLabel
            navigationModeLabel                    = new UILabel();
            navigationModeLabel.Text               = "NavigationStrip Mode";
            navigationModeLabel.TextColor          = UIColor.Black;
            navigationModeLabel.TextAlignment      = UITextAlignment.Left;
            navigationDirectionLabel               = new UILabel();
            navigationDirectionLabel.Text          = "Navigation Direction";
            navigationDirectionLabel.TextColor     = UIColor.Black;
            navigationDirectionLabel.TextAlignment = UITextAlignment.Left;
            tabStripLabel               = new UILabel();
            tabStripLabel.Text          = "NavigationStrip Position";
            tabStripLabel.TextColor     = UIColor.Black;
            tabStripLabel.TextAlignment = UITextAlignment.Left;

            //navigationModeButton
            navigationModeButton = new UIButton();
            navigationModeButton.SetTitle("Dots", UIControlState.Normal);
            navigationModeButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            navigationModeButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            navigationModeButton.Layer.CornerRadius  = 8;
            navigationModeButton.Layer.BorderWidth   = 2;
            navigationModeButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;

            //navigationDirectionButton
            navigationDirectionButton = new UIButton();
            navigationDirectionButton.SetTitle("Horizontal", UIControlState.Normal);
            navigationDirectionButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            navigationDirectionButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            navigationDirectionButton.Layer.CornerRadius  = 8;
            navigationDirectionButton.Layer.BorderWidth   = 2;
            navigationDirectionButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;

            //tabStripButton
            tabStripButton = new UIButton();
            tabStripButton.SetTitle("Bottom", UIControlState.Normal);
            tabStripButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            tabStripButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            tabStripButton.Layer.CornerRadius  = 8;
            tabStripButton.Layer.BorderWidth   = 2;
            tabStripButton.TouchUpInside      += ShowtabStripPicker;
            tabStripButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;

            doneButton = new UIButton();
            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);
            navigationModeModel.PickerChanged               += navigationModeSelectedIndexChanged;
            navigationDirectionModel.PickerChanged          += navigationDirectionSelectedIndexChanged;
            tabStripModel.PickerChanged                     += tabStripSelectedIndexChanged;
            navigationModePicker.ShowSelectionIndicator      = true;
            navigationModePicker.Hidden                      = true;
            navigationModePicker.BackgroundColor             = UIColor.Gray;
            navigationDirectionPicker.BackgroundColor        = UIColor.Gray;
            navigationDirectionPicker.ShowSelectionIndicator = true;
            navigationDirectionPicker.Hidden                 = true;
            tabStripPicker.BackgroundColor                   = UIColor.Gray;
            tabStripPicker.ShowSelectionIndicator            = true;
            tabStripPicker.Hidden                            = true;

            //autoPlayLabel
            autoPlayLabel                 = new UILabel();
            autoPlayLabel.TextColor       = UIColor.Black;
            autoPlayLabel.BackgroundColor = UIColor.Clear;
            autoPlayLabel.Text            = @"Enable AutoPlay";
            autoPlayLabel.TextAlignment   = UITextAlignment.Left;
            autoPlayLabel.Font            = UIFont.FromName("Helvetica", 16f);
            //allowSwitch
            autoPlaySwitch = new UISwitch();
            autoPlaySwitch.ValueChanged += autoPlayToggleChanged;
            autoPlaySwitch.On            = false;

            //adding to mainview
            main_view = new UIView();
            main_view.AddSubview(rotator);
            main_view.AddSubview(doneButton);
            main_view.AddSubview(navigationDirectionPicker);
            main_view.AddSubview(navigationModePicker);
            main_view.AddSubview(tabStripPicker);

            sub_View = new UIScrollView();
            sub_View.AddSubview(navigationModeLabel);
            sub_View.AddSubview(navigationModeButton);
            sub_View.AddSubview(navigationDirectionLabel);
            sub_View.AddSubview(navigationDirectionButton);
            sub_View.AddSubview(tabStripLabel);
            sub_View.AddSubview(tabStripButton);
            sub_View.AddSubview(autoPlayLabel);
            sub_View.AddSubview(autoPlaySwitch);
            main_view.AddSubview(sub_View);
        }
        /// <summary>
        /// The cell is filled with a switch or slider and the name of the activator.
        /// </summary>
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            UITableViewCell cell = tableView.DequeueReusableCell(strings.activatorCell);

            Backend.Models.Activator act = activators[indexPath.Row];
            if (cell == null)
            {
                cell = new UITableViewCell(UITableViewCellStyle.Default, strings.activatorCell);
            }
            if (act.State.Type == "bool")
            {
                UISwitch DeviceSwitch = new UISwitch();

                // Set the switch's state to that of the device.
                DeviceSwitch.On             = (bool)act.State.RawState;
                DeviceSwitch.TouchUpInside += delegate
                {
                    try
                    {
                        act.State = new ActivatorState(DeviceSwitch.On, "bool");
                    }
                    catch (ServerInteractionException ex)
                    {
                        Console.WriteLine("Exception while changing activator state");
                        Console.WriteLine(ex);
                        WarningMessage.Display("Could not set activator", "An exception occurred when changing the state of the activator on the server", owner);

                        // Reset back the switch
                        DeviceSwitch.On = (bool)act.State.RawState;
                    }
                };
                // Replace the cell's AccessoryView with the new UISwitch
                cell.AccessoryView = DeviceSwitch;

                // Keep a reference to the UISwitch - note using a Hashtable to ensure
                // we only have one for any given row
                actAccessories[indexPath.Row] = cell.AccessoryView;
            }
            else if (act.State.Type == "float")
            {
                UISlider slider = new UISlider();

                // Set the switch's state to that of the device.
                slider.Value          = (float)act.State.RawState;
                slider.TouchUpInside += delegate
                {
                    try
                    {
                        act.State = new ActivatorState(slider.Value, "float");
                    }
                    catch (ServerInteractionException ex)
                    {
                        Console.WriteLine("Exception while changing activator state");
                        Console.WriteLine(ex);
                        WarningMessage.Display("Could not set activator", "An exception occurred when changing the state of the activator on the server", owner);

                        // Reset back the slider
                        slider.Value = (float)act.State.RawState;
                    }
                };

                // Replace the cell's AccessoryView with the new UISwitch
                cell.AccessoryView = slider;

                // Keep a reference to the UISwitch - note using a Hashtable to ensure
                // we only have one for any given row
                actAccessories[indexPath.Row] = cell.AccessoryView;
            }
            cell.TextLabel.Text = act.Name;

            return(cell);
        }
Ejemplo n.º 46
0
        internal void CreateEditor()
        {
            ButtonCancel        = new UIButton();
            ButtonSave          = new UIButton();
            LabelSubject        = new UITextView();
            LabelLocation       = new UITextView();
            LabelEnds           = new UILabel();
            LabelStarts         = new UILabel();
            ButtonStartDate     = new UIButton();
            ButtonEndDate       = new UIButton();
            StartTimeZoneLabel  = new UILabel();
            EndTimeZoneLabel    = new UILabel();
            StartTimeZoneButton = new UIButton();
            EndTimeZoneButton   = new UIButton();
            PickerStartDate     = new UIDatePicker();
            PickerEndDate       = new UIDatePicker();
            DoneButton          = new UIButton();
            ScrollView          = new UIScrollView();
            StartTimeZonePicker = new UIPickerView();
            EndTimeZonePicker   = new UIPickerView();
            AllDaySwitch        = new UISwitch();
            AllDaylabel         = new UILabel();

            ScrollView.BackgroundColor = UIColor.White;

            LabelSubject.Font        = UIFont.SystemFontOfSize(14);
            LabelLocation.Font       = UIFont.SystemFontOfSize(14);
            LabelStarts.Font         = UIFont.SystemFontOfSize(15);
            LabelEnds.Font           = UIFont.SystemFontOfSize(15);
            StartTimeZoneLabel.Font  = UIFont.SystemFontOfSize(15);
            EndTimeZoneLabel.Font    = UIFont.SystemFontOfSize(15);
            AllDaylabel.Font         = UIFont.SystemFontOfSize(15);
            StartTimeZoneButton.Font = UIFont.SystemFontOfSize(15);
            EndTimeZoneButton.Font   = UIFont.SystemFontOfSize(15);
            ButtonStartDate.Font     = UIFont.SystemFontOfSize(15);
            ButtonEndDate.Font       = UIFont.SystemFontOfSize(15);

            ButtonCancel.BackgroundColor = UIColor.FromRGB(229, 229, 229);
            ButtonCancel.Font            = UIFont.SystemFontOfSize(15);
            ButtonSave.Font                    = UIFont.SystemFontOfSize(15);
            ButtonSave.BackgroundColor         = UIColor.FromRGB(33, 150, 243);
            ButtonCancel.Layer.CornerRadius    = 6;
            ButtonSave.Layer.CornerRadius      = 6;
            ButtonStartDate.Layer.CornerRadius = 6;
            ButtonEndDate.Layer.CornerRadius   = 6;

            StartTimeZoneLabel.Text      = "Start Time Zone";
            StartTimeZoneLabel.TextColor = UIColor.Black;

            EndTimeZoneLabel.Text      = "End Time Zone";
            EndTimeZoneLabel.TextColor = UIColor.Black;

            AllDaylabel.Text      = "All Day";
            AllDaylabel.TextColor = UIColor.Black;

            AllDaySwitch.On            = false;
            AllDaySwitch.OnTintColor   = UIColor.FromRGB(33, 150, 243);
            AllDaySwitch.ValueChanged += AllDaySwitch_ValueChanged;

            StartTimeZoneButton.SetTitle("Default", UIControlState.Normal);
            StartTimeZoneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            StartTimeZoneButton.Layer.BorderWidth   = 2;
            StartTimeZoneButton.Layer.CornerRadius  = 4;
            StartTimeZoneButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;
            StartTimeZoneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            StartTimeZoneButton.TouchUpInside      += (object sender, EventArgs e) =>
            {
                StartTimeZonePicker.Hidden = false;
                DoneButton.Hidden          = false;

                AllDaylabel.Hidden       = true;
                AllDaySwitch.Hidden      = true;
                ButtonCancel.Hidden      = true;
                ButtonSave.Hidden        = true;
                EndTimeZoneLabel.Hidden  = true;
                EndTimeZoneButton.Hidden = true;
                Editor.EndEditing(true);
            };

            EndTimeZoneButton.SetTitle("Default", UIControlState.Normal);
            EndTimeZoneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            EndTimeZoneButton.Layer.BorderWidth   = 2;
            EndTimeZoneButton.Layer.CornerRadius  = 4;
            EndTimeZoneButton.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;
            EndTimeZoneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            EndTimeZoneButton.TouchUpInside      += (object sender, EventArgs e) =>
            {
                EndTimeZonePicker.Hidden = false;
                DoneButton.Hidden        = false;
                AllDaylabel.Hidden       = true;
                AllDaySwitch.Hidden      = true;
                ButtonCancel.Hidden      = true;
                ButtonSave.Hidden        = true;
                EndTimeZoneLabel.Hidden  = true;
                EndTimeZoneButton.Hidden = true;
                Editor.EndEditing(true);
            };

            //cancel button
            ButtonCancel.SetTitle("Cancel", UIControlState.Normal);
            ButtonCancel.SetTitleColor(UIColor.FromRGB(59, 59, 59), UIControlState.Normal);
            ButtonCancel.TouchUpInside += (object sender, EventArgs e) =>
            {
                Editor.Hidden   = true;
                schedule.Hidden = false;
                Editor.EndEditing(true);
                scheduleViews.HeaderView.Hidden = false;
            };

            //save button
            ButtonSave.SetTitle("Save", UIControlState.Normal);
            ButtonSave.SetTitleColor(UIColor.White, UIControlState.Normal);
            ButtonSave.TouchUpInside += (object sender, EventArgs e) =>
            {
                scheduleViews.HeaderView.Hidden = false;
                if (scheduleViews.IndexOfAppointment != -1)
                {
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>)[int.Parse(scheduleViews.IndexOfAppointment.ToString())].Subject   = (NSString)LabelSubject.Text;
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>)[int.Parse(scheduleViews.IndexOfAppointment.ToString())].Location  = (NSString)LabelLocation.Text;
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>)[int.Parse(scheduleViews.IndexOfAppointment.ToString())].StartTime = PickerStartDate.Date;
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>)[int.Parse(scheduleViews.IndexOfAppointment.ToString())].EndTime   = PickerEndDate.Date;
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>)[int.Parse(scheduleViews.IndexOfAppointment.ToString())].IsAllDay  = AllDaySwitch.On;
                }
                else
                {
                    ScheduleAppointment appointment = new ScheduleAppointment();
                    appointment.Subject               = (NSString)LabelSubject.Text;
                    appointment.Location              = (NSString)LabelLocation.Text;
                    appointment.StartTime             = PickerStartDate.Date;
                    appointment.EndTime               = PickerEndDate.Date;
                    appointment.AppointmentBackground = UIColor.FromRGB(0xA2, 0xC1, 0x39);
                    appointment.IsAllDay              = AllDaySwitch.On;
                    (schedule.ItemsSource as ObservableCollection <ScheduleAppointment>).Add(appointment);
                }

                Editor.Hidden   = true;
                schedule.Hidden = false;
                schedule.ReloadData();
                Editor.EndEditing(true);
            };

            //subject label
            LabelSubject.TextColor          = UIColor.Black;
            LabelSubject.TextAlignment      = UITextAlignment.Left;
            LabelSubject.Layer.CornerRadius = 8;
            LabelSubject.Layer.BorderWidth  = 2;
            LabelSubject.Layer.BorderColor  = UIColor.FromRGB(246, 246, 246).CGColor;

            //location label
            LabelLocation.TextColor          = UIColor.Black;
            LabelLocation.TextAlignment      = UITextAlignment.Left;
            LabelLocation.Layer.CornerRadius = 8;
            LabelLocation.Layer.BorderWidth  = 2;
            LabelLocation.Layer.BorderColor  = UIColor.FromRGB(246, 246, 246).CGColor;

            //starts time
            LabelStarts.Text      = "Start Time";
            LabelStarts.TextColor = UIColor.Black;

            ButtonStartDate.SetTitle("Start time", UIControlState.Normal);
            ButtonStartDate.Layer.BorderWidth  = 2;
            ButtonStartDate.Layer.CornerRadius = 4;
            ButtonStartDate.Layer.BorderColor  = UIColor.FromRGB(246, 246, 246).CGColor;
            ButtonStartDate.SetTitleColor(UIColor.Black, UIControlState.Normal);
            ButtonStartDate.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            ButtonStartDate.TouchUpInside      += (object sender, EventArgs e) =>
            {
                PickerStartDate.Hidden = false;
                DoneButton.Hidden      = false;

                AllDaylabel.Hidden       = true;
                AllDaySwitch.Hidden      = true;
                ButtonCancel.Hidden      = true;
                ButtonSave.Hidden        = true;
                EndTimeZoneLabel.Hidden  = true;
                EndTimeZoneButton.Hidden = true;
                Editor.EndEditing(true);
            };

            //end time
            LabelEnds.Text      = "End Time";
            LabelEnds.TextColor = UIColor.Black;

            //end date
            ButtonEndDate.SetTitle("End time", UIControlState.Normal);
            ButtonEndDate.SetTitleColor(UIColor.Black, UIControlState.Normal);
            ButtonEndDate.Layer.BorderWidth   = 2;
            ButtonEndDate.Layer.CornerRadius  = 4;
            ButtonEndDate.Layer.BorderColor   = UIColor.FromRGB(246, 246, 246).CGColor;
            ButtonEndDate.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            ButtonEndDate.TouchUpInside      += (object sender, EventArgs e) =>
            {
                PickerEndDate.Hidden     = false;
                DoneButton.Hidden        = false;
                AllDaylabel.Hidden       = true;
                AllDaySwitch.Hidden      = true;
                ButtonCancel.Hidden      = true;
                ButtonSave.Hidden        = true;
                EndTimeZoneLabel.Hidden  = true;
                EndTimeZoneButton.Hidden = true;

                Editor.EndEditing(true);
            };

            //date and time pickers
            PickerStartDate.Hidden     = true;
            PickerEndDate.Hidden       = true;
            StartTimeZonePicker.Hidden = true;
            EndTimeZonePicker.Hidden   = true;
            DoneButton.Hidden          = true;

            //done button
            DoneButton.SetTitle("Done", UIControlState.Normal);
            DoneButton.SetTitleColor(UIColor.Blue, UIControlState.Normal);
            DoneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            DoneButton.TouchUpInside      += (object sender, EventArgs e) =>
            {
                PickerStartDate.Hidden     = true;
                PickerEndDate.Hidden       = true;
                StartTimeZonePicker.Hidden = true;
                EndTimeZonePicker.Hidden   = true;
                DoneButton.Hidden          = true;

                LabelEnds.Hidden           = false;
                ButtonEndDate.Hidden       = false;
                ButtonStartDate.Hidden     = false;
                LabelStarts.Hidden         = false;
                EndTimeZoneLabel.Hidden    = false;
                StartTimeZoneLabel.Hidden  = false;
                AllDaylabel.Hidden         = false;
                AllDaySwitch.Hidden        = false;
                StartTimeZoneButton.Hidden = false;
                EndTimeZoneButton.Hidden   = false;
                ButtonCancel.Hidden        = false;
                ButtonSave.Hidden          = false;

                String _sDate = DateTime.Parse(PickerStartDate.Date.ToString()).ToString();
                ButtonStartDate.SetTitle(_sDate, UIControlState.Normal);

                String _eDate = DateTime.Parse(PickerEndDate.Date.ToString()).ToString();
                ButtonEndDate.SetTitle(_eDate, UIControlState.Normal);
                Editor.EndEditing(true);
            };

            SchedulePickerModel model = new SchedulePickerModel(TimeZoneCollection.TimeZoneList);

            model.PickerChanged += (sender, e) =>
            {
                if (e.SelectedValue != "Default" && scheduleViews.SelectedAppointment != null)
                {
                    scheduleViews.SelectedAppointment.StartTimeZone = e.SelectedValue;
                }

                StartTimeZoneButton.SetTitle(e.SelectedValue, UIControlState.Normal);
            };

            SchedulePickerModel model2 = new SchedulePickerModel(TimeZoneCollection.TimeZoneList);

            model2.PickerChanged += (sender, e) =>
            {
                if (e.SelectedValue != "Default" && scheduleViews.SelectedAppointment != null)
                {
                    scheduleViews.SelectedAppointment.EndTimeZone = e.SelectedValue;
                }

                EndTimeZoneButton.SetTitle(e.SelectedValue, UIControlState.Normal);
            };

            StartTimeZonePicker.Model = model;
            EndTimeZonePicker.Model   = model2;
            StartTimeZonePicker.ShowSelectionIndicator = true;
            EndTimeZonePicker.ShowSelectionIndicator   = true;

            ScrollView.Add(LabelSubject);
            ScrollView.Add(LabelLocation);
            ScrollView.Add(LabelStarts);
            ScrollView.Add(ButtonStartDate);
            ScrollView.Add(StartTimeZoneLabel);
            ScrollView.Add(StartTimeZoneButton);
            ScrollView.Add(LabelEnds);
            ScrollView.Add(ButtonEndDate);
            ScrollView.Add(EndTimeZoneLabel);
            ScrollView.Add(EndTimeZoneButton);
            ScrollView.Add(StartTimeZonePicker);
            ScrollView.Add(EndTimeZonePicker);
            ScrollView.Add(PickerEndDate);
            ScrollView.Add(PickerStartDate);
            ScrollView.Add(DoneButton);
            ScrollView.Add(AllDaylabel);
            ScrollView.Add(AllDaySwitch);
            ScrollView.Add(ButtonCancel);
            ScrollView.Add(ButtonSave);

            Editor.Add(ScrollView);
        }
Ejemplo n.º 47
0
 partial void ShwichAutoChange(UISwitch sender)
 {
     save.Savegerlly = ShwichAuto.On;
     //  throw new NotImplementedException();
 }
Ejemplo n.º 48
0
        public override void LoadView()
        {
            // Create the views.
            View = new UIView {
                BackgroundColor = UIColor.White
            };

            _myMapView = new MapView();
            _myMapView.TranslatesAutoresizingMaskIntoConstraints = false;

            _toggleAxisOrderSwitch = new UISwitch();

            UILabel axisOrderLabel = new UILabel();

            axisOrderLabel.Text = "Swap coordinates";

            _chooseLayersButton         = new UIBarButtonItem();
            _chooseLayersButton.Title   = "Choose layer";
            _chooseLayersButton.Enabled = false;

            _loadServiceButton = new UIBarButtonItem();

            UIToolbar loadBar = new UIToolbar();

            loadBar.TranslatesAutoresizingMaskIntoConstraints = false;
            loadBar.Items = new[]
            {
                _loadServiceButton
            };

            UIToolbar toolbar = new UIToolbar();

            toolbar.TranslatesAutoresizingMaskIntoConstraints = false;
            toolbar.Items = new[]
            {
                new UIBarButtonItem(_toggleAxisOrderSwitch),
                new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace)
                {
                    Width = 8
                },
                new UIBarButtonItem(axisOrderLabel),
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                _chooseLayersButton
            };

            _loadingProgressBar = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge);
            _loadingProgressBar.TranslatesAutoresizingMaskIntoConstraints = false;
            _loadingProgressBar.HidesWhenStopped = true;
            _loadingProgressBar.BackgroundColor  = UIColor.FromWhiteAlpha(0, .6f);

            // Add the views.
            View.AddSubviews(_myMapView, loadBar, toolbar, _loadingProgressBar);

            // Lay out the views.
            NSLayoutConstraint.ActivateConstraints(new[]
            {
                _myMapView.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor),
                _myMapView.BottomAnchor.ConstraintEqualTo(loadBar.TopAnchor),
                _myMapView.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor),
                _myMapView.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor),

                loadBar.TopAnchor.ConstraintEqualTo(_myMapView.BottomAnchor),
                loadBar.BottomAnchor.ConstraintEqualTo(toolbar.TopAnchor),
                loadBar.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor),
                loadBar.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor),

                toolbar.TopAnchor.ConstraintEqualTo(loadBar.BottomAnchor),
                toolbar.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor),
                toolbar.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor),
                toolbar.BottomAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.BottomAnchor),

                _loadingProgressBar.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor),
                _loadingProgressBar.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor),
                _loadingProgressBar.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor),
                _loadingProgressBar.BottomAnchor.ConstraintEqualTo(View.BottomAnchor)
            });
        }
Ejemplo n.º 49
0
        public override void LoadView()
        {
            // Create the views.
            View = new UIView {
                BackgroundColor = UIColor.White
            };

            _mapView = new MapView();
            _mapView.TranslatesAutoresizingMaskIntoConstraints = false;

            _transactionButton = new UIBarButtonItem("Start transaction", UIBarButtonItemStyle.Plain, HandleTransaction_Click);
            _syncButton        = new UIBarButtonItem("Sync", UIBarButtonItemStyle.Plain, SynchronizeEdits);
            _addButton         = new UIBarButtonItem(UIBarButtonSystemItem.Add, HandleAddButton_Click)
            {
                Enabled = false
            };

            UIToolbar toolbar = new UIToolbar();

            toolbar.TranslatesAutoresizingMaskIntoConstraints = false;
            toolbar.Items = new[]
            {
                _transactionButton,
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                _syncButton,
                _addButton
            };

            _transactionSwitch = new UISwitch();
            _transactionSwitch.TranslatesAutoresizingMaskIntoConstraints = false;
            _transactionSwitch.ValueChanged += RequireTransactionChanged;
            _transactionSwitch.On            = true;

            _statusLabel = new UILabel
            {
                Text = "Preparing sample data...",
                AdjustsFontSizeToFitWidth = true,
                TextAlignment             = UITextAlignment.Center,
                BackgroundColor           = UIColor.FromWhiteAlpha(0, .6f),
                TextColor = UIColor.White,
                Lines     = 2,
                TranslatesAutoresizingMaskIntoConstraints = false
            };
            _statusLabel.TranslatesAutoresizingMaskIntoConstraints = false;

            UILabel requireTransactionsLabel = new UILabel();

            requireTransactionsLabel.TranslatesAutoresizingMaskIntoConstraints = false;
            requireTransactionsLabel.Text          = "Require transaction";
            requireTransactionsLabel.TextAlignment = UITextAlignment.Right;
            requireTransactionsLabel.SetContentCompressionResistancePriority((float)UILayoutPriority.DefaultHigh, UILayoutConstraintAxis.Horizontal);

            UIStackView requireTransactionRow = new UIStackView(new UIView[] { requireTransactionsLabel, _transactionSwitch });

            requireTransactionRow.TranslatesAutoresizingMaskIntoConstraints = false;
            requireTransactionRow.Axis         = UILayoutConstraintAxis.Horizontal;
            requireTransactionRow.Distribution = UIStackViewDistribution.Fill;
            requireTransactionRow.Spacing      = 8;
            requireTransactionRow.LayoutMarginsRelativeArrangement = true;
            requireTransactionRow.LayoutMargins = new UIEdgeInsets(8, 8, 8, 8);

            _progressBar = new UIProgressView(UIProgressViewStyle.Bar);
            _progressBar.TranslatesAutoresizingMaskIntoConstraints = false;

            // Add the views.
            View.AddSubviews(_mapView, _statusLabel, requireTransactionRow, toolbar, _progressBar);

            // Lay out the views.
            NSLayoutConstraint.ActivateConstraints(new[]
            {
                _mapView.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor),
                _mapView.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor),
                _mapView.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor),
                _mapView.BottomAnchor.ConstraintEqualTo(requireTransactionRow.TopAnchor),

                toolbar.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor),
                toolbar.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor),
                toolbar.BottomAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.BottomAnchor),

                requireTransactionRow.LeadingAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.LeadingAnchor),
                requireTransactionRow.TrailingAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TrailingAnchor),
                requireTransactionRow.BottomAnchor.ConstraintEqualTo(toolbar.TopAnchor),

                _statusLabel.TopAnchor.ConstraintEqualTo(_mapView.TopAnchor),
                _statusLabel.LeadingAnchor.ConstraintEqualTo(_mapView.LeadingAnchor),
                _statusLabel.TrailingAnchor.ConstraintEqualTo(_mapView.TrailingAnchor),
                _statusLabel.HeightAnchor.ConstraintEqualTo(80),

                _progressBar.TopAnchor.ConstraintEqualTo(_statusLabel.BottomAnchor),
                _progressBar.LeadingAnchor.ConstraintEqualTo(_statusLabel.LeadingAnchor),
                _progressBar.TrailingAnchor.ConstraintEqualTo(_statusLabel.TrailingAnchor),
                _progressBar.HeightAnchor.ConstraintEqualTo(8)
            });
        }
Ejemplo n.º 50
0
        void LoadAllowedTextsLabel()
        {
            #region Description Label

            UILabel label = new UILabel();
            label.Frame         = frameRect;
            label.TextColor     = UIColor.FromRGB(38 / 255.0f, 38 / 255.0f, 38 / 255.0f);
            label.Text          = "This sample demonstrates how to filter data within a range of Excel worksheet.";
            label.Font          = UIFont.SystemFontOfSize(15);
            label.Lines         = 0;
            label.LineBreakMode = UILineBreakMode.WordWrap;
            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                label.Font  = UIFont.SystemFontOfSize(18);
                label.Frame = new CGRect(5, 5, frameRect.Location.X + frameRect.Size.Width, 35);
            }
            else
            {
                label.Frame = new CGRect(5, 5, frameRect.Location.X + frameRect.Size.Width, 50);
            }
            this.AddSubview(label);
            #endregion

            #region Layout Region
            layoutLabel      = new UILabel();
            layoutDoneButton = new UIButton();
            layoutButton     = new UIButton();
            layoutPicker     = new UIPickerView();
            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                layoutLabel.Font   = UIFont.SystemFontOfSize(18);
                layoutLabel.Frame  = new CGRect(10, 45, this.Frame.Size.Width / 2, 50);
                layoutButton.Frame = new CGRect(150, 45, this.Frame.Size.Width / 2, 40);
            }
            else
            {
                layoutLabel.Frame  = new CGRect(10, 50, this.Frame.Size.Width / 2, 50);
                layoutButton.Frame = new CGRect(150, 50, this.Frame.Size.Width / 2, 40);
            }

            //filter Label
            layoutLabel.TextColor       = UIColor.Black;
            layoutLabel.BackgroundColor = UIColor.Clear;
            layoutLabel.Text            = @"Layout Options";
            layoutLabel.TextAlignment   = UITextAlignment.Left;
            layoutLabel.Font            = UIFont.FromName("Helvetica", 16f);
            this.AddSubview(layoutLabel);

            //filter button
            layoutButton.SetTitle("Default", UIControlState.Normal);
            layoutButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
            layoutButton.BackgroundColor     = UIColor.Clear;
            layoutButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            layoutButton.Hidden             = false;
            layoutButton.Layer.BorderColor  = UIColor.FromRGB(246, 246, 246).CGColor;
            layoutButton.Layer.BorderWidth  = 4;
            layoutButton.Layer.CornerRadius = 8;
            layoutButton.Font = UIFont.FromName("Helvetica", 16f);
            this.AddSubview(layoutButton);
            layoutButton.TouchUpInside += ShowLayoutPicker;

            //filterpicker
            PickerModel layoutPickermodel = new PickerModel(this.layoutList);
            layoutPickermodel.PickerChanged += (sender, e) =>
            {
                this.selectedLayout = e.SelectedValue;
                layoutButton.SetTitle(selectedLayout, UIControlState.Normal);
            };
            layoutPicker = new UIPickerView();
            layoutPicker.ShowSelectionIndicator = true;
            layoutPicker.Hidden          = true;
            layoutPicker.Model           = layoutPickermodel;
            layoutPicker.BackgroundColor = UIColor.White;

            //filterDoneButtonn
            layoutDoneButton = new UIButton();
            layoutDoneButton.SetTitle("Done\t", UIControlState.Normal);
            layoutDoneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            layoutDoneButton.BackgroundColor     = UIColor.FromRGB(240, 240, 240);
            layoutDoneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            layoutDoneButton.Hidden         = true;
            layoutDoneButton.TouchUpInside += HideLayoutPicker;

            layoutPicker.Frame     = new CGRect(150, 50, this.Frame.Size.Width / 2, this.Frame.Size.Height / 3);
            layoutDoneButton.Frame = new CGRect(150, 55, this.Frame.Size.Width / 2, 40);
            this.AddSubview(layoutPicker);
            this.AddSubview(layoutDoneButton);
            #endregion

            #region Group Region

            //unique records label
            groupLabel                 = new UILabel();
            groupLabel.TextColor       = UIColor.Black;
            groupLabel.BackgroundColor = UIColor.Clear;
            groupLabel.Text            = @"Group";
            groupLabel.TextAlignment   = UITextAlignment.Left;
            groupLabel.Font            = UIFont.FromName("Helvetica", 16f);
            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                groupLabel.Frame = new CGRect(60, 105, this.Frame.Size.Width / 2, 40);
            }
            else
            {
                groupLabel.Frame = new CGRect(60, 110, this.Frame.Size.Width / 2, 40);
            }
            this.AddSubview(groupLabel);

            //unique records switch
            groupSwitch    = new UISwitch();
            groupSwitch.On = false;
            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                groupSwitch.Frame = new CGRect(150, 105, this.Frame.Size.Width / 2, 40);
            }
            else
            {
                groupSwitch.Frame = new CGRect(150, 110, this.Frame.Size.Width / 2, 40);
            }

            groupSwitch.TouchUpInside += ShowGroupOptions;
            this.AddSubview(groupSwitch);

            #endregion

            #region Group Options Region

            //filter Label
            groupOptionsLabel                 = new UILabel();
            groupOptionsLabel.TextColor       = UIColor.Black;
            groupOptionsLabel.BackgroundColor = UIColor.Clear;
            groupOptionsLabel.Text            = "Options";
            groupOptionsLabel.TextAlignment   = UITextAlignment.Left;
            groupOptionsLabel.Font            = UIFont.FromName("Helvetica", 16f);

            this.AddSubview(groupOptionsLabel);
            groupOptionsLabel.Hidden = true;

            radioGroup.Axis = UILayoutConstraintAxis.Vertical;
            expandButton.SetTitle("Expand", UIControlState.Normal);
            radioGroup.AddArrangedSubview(expandButton);
            collapseButton.SetTitle("Group at Level", UIControlState.Normal);
            radioGroup.AddArrangedSubview(collapseButton);
            expandButton.IsChecked  = true;
            radioGroup.Distribution = UIStackViewDistribution.FillProportionally;

            this.AddSubview(radioGroup);
            radioGroup.Hidden = true;

            expandButton.StateChanged   += ShowHideTextField;
            collapseButton.StateChanged += ShowHideTextField;

            textField                 = new UITextField();
            textField.TextColor       = UIColor.Black;
            textField.BackgroundColor = UIColor.Clear;
            textField.Text            = "1";
            textField.TextAlignment   = UITextAlignment.Left;
            textField.Font            = UIFont.FromName("Helvetica", 16f);

            this.AddSubview(textField);
            textField.Hidden = true;

            #endregion

            #region Button Region
            //button
            button = new UIButton(UIButtonType.System);
            button.SetTitle("Generate Excel", UIControlState.Normal);
            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                button.Frame = new CGRect(0, 155, frameRect.Location.X + frameRect.Size.Width, 20);
            }
            else
            {
                button.Frame = new CGRect(0, 160, frameRect.Location.X + frameRect.Size.Width, 20);
            }
            button.TouchUpInside += OnButtonClicked;
            this.AddSubview(button);
            #endregion

            isLoaded = true;
        }
Ejemplo n.º 51
0
 partial void OnToggleDynamic(UISwitch sender);
 public void Include(UISwitch sw)
 {
     sw.On = !sw.On;
 }
        private void InitAdvanced()
        {
            // Single image
            StyleItem item1 = new StyleItem("Image", "", UITableViewCellStyle.Default, UITableViewCellAccessory.None);

            item1.Image = UIImage.FromFile("bulb_on.png");

            //
            // Two images
            //
            StyleItem item2 = new StyleItem("Two images", "", UITableViewCellStyle.Default, UITableViewCellAccessory.DisclosureIndicator);

            item2.Image = UIImage.FromFile("bulb_on.png");

            // This is the easiest way to set the right image if you don't want to trap it being clicked in the delegate
            UIImageView imageView = new UIImageView(UIImage.FromFile("bulb_off.png"), UIImage.FromFile("bulb_off.png"));

            item2.AccessoryView = imageView;

            // If you want to trap AccessoryButtonTapped in the delegate, you need to use a UIButton
            UIButton button = UIButton.FromType(UIButtonType.Custom);

/* pep temp commented			button.TouchDown += delegate {
 *                              UITableViewController nextController = new CheckmarkDemoTableController(UITableViewStyle.Grouped);
 *                              _parentController.NavigationController.PushViewController(nextController,true);
 *                      };*/

            button.SetBackgroundImage(UIImage.FromFile("bulb_off.png"), UIControlState.Normal);
            button.SetBackgroundImage(UIImage.FromFile("bulb_off.png"), UIControlState.Selected);
            button.Frame        = new System.Drawing.RectangleF(0, 0, 26, 26);
            item2.AccessoryView = button;

            //
            // Two images + custom control
            //
            StyleItem item3 = new StyleItem("", "", UITableViewCellStyle.Default, UITableViewCellAccessory.DisclosureIndicator);

            item3.Image = UIImage.FromFile("bulb_on.png");

            UISlider slider = new UISlider();

            slider.MaxValue   = 100f;
            slider.Value      = 50f;
            slider.MinValue   = 0f;
            slider.Frame      = new RectangleF(50, 9, 215, 23);
            item3.ContentView = slider;

            UIImageView imageView1 = new UIImageView(UIImage.FromFile("bulb_off.png"), UIImage.FromFile("bulb_off.png"));

            item3.AccessoryView = imageView1;

            // A switcher
            StyleItem item4    = new StyleItem("Free beer?", "", UITableViewCellStyle.Default, UITableViewCellAccessory.None);
            UISwitch  switcher = new UISwitch();

            item4.AccessoryView = switcher;

            _items.Add(item1);
            _items.Add(item2);
            _items.Add(item3);
            _items.Add(item4);
        }
 public void Include(UISwitch sw)
 {
     sw.On            = !sw.On;
     sw.ValueChanged += (sender, args) => { sw.On = false; };
 }
Ejemplo n.º 55
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            #region UI Controls (you could do this in XIB if you want)
            saveButton       = UIButton.FromType(UIButtonType.RoundedRect);
            saveButton.Frame = new RectangleF(10, 240, 145, 40);
            saveButton.SetTitle("Save", UIControlState.Normal);
            saveButton.SetTitle("waiting...", UIControlState.Disabled);
            saveButton.Enabled = false;

            deleteButton       = UIButton.FromType(UIButtonType.RoundedRect);
            deleteButton.Frame = new RectangleF(160, 240, 145, 40);
            deleteButton.SetTitle("Delete", UIControlState.Normal);
            deleteButton.Enabled = false;

            doneSwitch         = new UISwitch();
            doneSwitch.Frame   = new RectangleF(10, 205, 145, 50);
            doneSwitch.Enabled = false;
            doneLabel          = new UILabel();
            doneLabel.Frame    = new RectangleF(100, 210, 100, 15);
            doneLabel.Text     = "Done";

            titleText = new UITextView(new RectangleF(10, 10, 300, 40));
            titleText.BackgroundColor  = UIColor.FromRGB(240, 240, 240);
            titleText.Editable         = true;
            titleText.Font             = UIFont.SystemFontOfSize(20f);
            titleText.BackgroundColor  = UIColor.FromRGB(240, 240, 240);
            titleText.ReturnKeyType    = UIReturnKeyType.Next;
            titleText.ShouldChangeText = (t, c, r) => {
                if (r == "\n")
                {
                    descriptionText.BecomeFirstResponder();
                    return(false);
                }
                return(true);
            };

            descriptionText = new UITextView(new RectangleF(10, 60, 300, 180));
            descriptionText.BackgroundColor  = UIColor.FromRGB(240, 240, 240);
            descriptionText.Editable         = true;
            descriptionText.ScrollEnabled    = true;
            descriptionText.AutoresizingMask = UIViewAutoresizing.FlexibleHeight;
            descriptionText.ReturnKeyType    = UIReturnKeyType.Done;
            descriptionText.ShouldChangeText = (t, c, r) => {
                if (r == "\n")
                {
                    descriptionText.ResignFirstResponder();
                    return(false);
                }
                return(true);
            };

            // Add the controls to the view
            this.Add(saveButton);
            this.Add(deleteButton);
            this.Add(doneLabel);
            this.Add(doneSwitch);
            this.Add(descriptionText);               // disabled for Azure demo (for now...)
            this.Add(titleText);
            #endregion

            LoadData();

            saveButton.TouchUpInside += (sender, e) => {
                task.Title       = titleText.Text;
                task.Description = descriptionText.Text;
                task.IsDone      = doneSwitch.On;

                // save to Dropbox
                DropboxDatabase.Shared.Update(task);

                descriptionText.ResignFirstResponder();                                         // hide keyboard
                titleText.ResignFirstResponder();

                NavigationController.PopToRootViewController(true);
            };

            deleteButton.TouchUpInside += (sender, e) => {
                // delete to Dropbox
                DropboxDatabase.Shared.Delete(task);

                descriptionText.ResignFirstResponder();                                         // hide keyboard
                titleText.ResignFirstResponder();

                NavigationController.PopToRootViewController(true);                  // doesn't reflect deletion yet
            };
        }
Ejemplo n.º 56
0
        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);
        }
Ejemplo n.º 57
0
 public static string BindAnimatedOn(this UISwitch self)
 => SwitchAnimatedOnTargetBinding.BindingName;
Ejemplo n.º 58
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            var cell = tableView.DequeueReusableCell(OptionsViewControllerCell.Key) as OptionsViewControllerCell;

            if (cell == null)
            {
                cell = new OptionsViewControllerCell();
            }

            uint flags = WritePadAPI.recoGetFlags();
            var  sw    = new UISwitch();

            sw.ValueChanged += (object sender, EventArgs e) => {
                UISwitch swit = (UISwitch)sender;
                flags = WritePadAPI.recoGetFlags();
                switch (swit.Tag)
                {
                case (int)WritePadOptions.kWritePadOptionsSepLetters:
                    flags = WritePadAPI.setRecoFlag(flags, swit.On, WritePadAPI.FLAG_SEPLET);
                    break;

                case (int)WritePadOptions.kWritePadOptionsSingleWord:
                    flags = WritePadAPI.setRecoFlag(flags, swit.On, WritePadAPI.FLAG_SINGLEWORDONLY);
                    break;

                case (int)WritePadOptions.kWritePadOptionsLearner:
                    flags = WritePadAPI.setRecoFlag(flags, swit.On, WritePadAPI.FLAG_ANALYZER);
                    break;

                case (int)WritePadOptions.kWritePadOptionsAutcorrector:
                    flags = WritePadAPI.setRecoFlag(flags, swit.On, WritePadAPI.FLAG_CORRECTOR);
                    break;

                case (int)WritePadOptions.kWritePadOptionsUserDict:
                    flags = WritePadAPI.setRecoFlag(flags, swit.On, WritePadAPI.FLAG_USERDICT);
                    break;

                case (int)WritePadOptions.kWritePadOptionsDictionaryOnly:
                    flags = WritePadAPI.setRecoFlag(flags, swit.On, WritePadAPI.FLAG_ONLYDICT);
                    break;
                }
                WritePadAPI.recoSetFlags(flags);
            };
            sw.Tag             = indexPath.Row;
            cell.AccessoryView = sw;
            switch (indexPath.Row)
            {
            case (int)WritePadOptions.kWritePadOptionsSepLetters:
                sw.On = WritePadAPI.isRecoFlagSet(flags, WritePadAPI.FLAG_SEPLET);
                cell.TextLabel.Text = "Separate letters mode (PRINT)";
                break;

            case (int)WritePadOptions.kWritePadOptionsSingleWord:
                sw.On = WritePadAPI.isRecoFlagSet(flags, WritePadAPI.FLAG_SINGLEWORDONLY);
                cell.TextLabel.Text = "Disable word segmentation (single word)";
                break;

            case (int)WritePadOptions.kWritePadOptionsLearner:
                sw.On = WritePadAPI.isRecoFlagSet(flags, WritePadAPI.FLAG_ANALYZER);
                cell.TextLabel.Text = "Enable Automatic learner";
                break;

            case (int)WritePadOptions.kWritePadOptionsAutcorrector:
                sw.On = WritePadAPI.isRecoFlagSet(flags, WritePadAPI.FLAG_CORRECTOR);
                cell.TextLabel.Text = "Enable Autocorrector";
                break;

            case (int)WritePadOptions.kWritePadOptionsUserDict:
                sw.On = WritePadAPI.isRecoFlagSet(flags, WritePadAPI.FLAG_USERDICT);
                cell.TextLabel.Text = "Enable User Dictionary";
                break;

            case (int)WritePadOptions.kWritePadOptionsDictionaryOnly:
                sw.On = WritePadAPI.isRecoFlagSet(flags, WritePadAPI.FLAG_ONLYDICT);
                cell.TextLabel.Text = "Recognize Dictionary Words Only";
                break;
            }

            return(cell);
        }
        private void CreateLayout()
        {
            // Place the map view in the upper half of the display.
            _myMapView.Frame = new CGRect(0, 0, View.Bounds.Width, _mapViewHeight);

            // Place the transformations UI in the bottom half.
            _transformToolsView.Axis  = UILayoutConstraintAxis.Vertical;
            _transformToolsView.Frame = new CGRect(0, _mapViewHeight, View.Bounds.Width, _transformToolsHeight);

            // View for the input/output wkid labels.
            UIStackView wkidLabelsStackView = new UIStackView(new CGRect(10, 5, View.Bounds.Width - 10, 35))
            {
                Axis = UILayoutConstraintAxis.Horizontal
            };

            // Create a label for the input spatial reference.
            _inWkidLabel = new UILabel(new CGRect(5, 0, (View.Bounds.Width / 2) - 15, 30))
            {
                Text          = "In WKID = ",
                TextAlignment = UITextAlignment.Left,
                TextColor     = UIColor.Blue
            };

            // Create a label for the output spatial reference.
            _outWkidLabel = new UILabel(new CGRect((View.Bounds.Width / 2) + 5, 0, (View.Bounds.Width / 2) - 15, 30))
            {
                Text          = "Out WKID = ",
                TextAlignment = UITextAlignment.Left,
                TextColor     = UIColor.Blue
            };

            // Add the Wkid labels to the stack view.
            wkidLabelsStackView.Add(_inWkidLabel);
            wkidLabelsStackView.Add(_outWkidLabel);

            // Create a horizontal stack view for the 'use extent' switch and label.
            UIStackView extentSwitchRow = new UIStackView(new CGRect(20, 35, View.Bounds.Width - 20, 35))
            {
                Axis = UILayoutConstraintAxis.Horizontal
            };

            _useExtentSwitch = new UISwitch
            {
                On = false
            };
            _useExtentSwitch.ValueChanged += UseExtentSwitch_ValueChanged;

            // Create a label for the use extent switch.
            UILabel useExtentLabel = new UILabel(new CGRect(70, 0, View.Bounds.Width - 70, 30))
            {
                Text          = "Use extent",
                TextAlignment = UITextAlignment.Left,
                TextColor     = UIColor.Blue
            };

            // Add the switch and the label to the horizontal stack view.
            extentSwitchRow.Add(_useExtentSwitch);
            extentSwitchRow.Add(useExtentLabel);

            // Create a picker for datum transformations.
            _transformationsPicker = new UIPickerView(new CGRect(20, 70, View.Bounds.Width - 20, 120));

            // Create a text view to show messages.
            _messagesTextView = new UITextView(new CGRect(20, 200, View.Bounds.Width - 20, 60));

            // Add the controls to the transform UI (stack view).
            _transformToolsView.AddSubviews(wkidLabelsStackView, extentSwitchRow, _transformationsPicker, _messagesTextView);

            // Add the map view and tools subviews to the view.
            View.AddSubviews(_myMapView, _transformToolsView);

            // Set the view background color.
            View.BackgroundColor = UIColor.White;
        }
Ejemplo n.º 60
0
        public void mainPageDesign()
        {
            this.OptionView = new UIView();
            controlView     = new UIView();
            this.addingSourceList();
            isEditableSwitch         = new UISwitch();
            diacriticsSwitch         = new UISwitch();
            suggestionModePicker     = new UIPickerView();
            comboBoxModePicker       = new UIPickerView();
            sizePicker               = new UIPickerView();
            textColorPicker          = new UIPickerView();
            backColorPicker          = new UIPickerView();
            sizeDoneButton           = new UIButton();
            textColorDoneButton      = new UIButton();
            backColorDoneButton      = new UIButton();
            comboBoxModel            = new PickerModel(comboBoxModeList);
            comboBoxModePicker.Model = comboBoxModel;
            comboBoxModePicker.Select(1, 0, false);
            sizeModel        = new PickerModel(sizeList);
            sizePicker.Model = sizeModel;
            sizePicker.Select(2, 0, false);
            textColorModel        = new PickerModel(textColorList);
            textColorPicker.Model = textColorModel;
            textColorPicker.Select(0, 0, false);
            backColorModel        = new PickerModel(backColorList);
            backColorPicker.Model = backColorModel;
            backColorPicker.Select(0, 0, false);
            isEditableLabel     = new UILabel();
            diacriticModeLabel  = new UILabel();
            comboBoxModeLabel   = new UILabel();
            sizeLabel           = new UILabel();
            textColorLabel      = new UILabel();
            backColorLabel      = new UILabel();
            waterMarkLabel      = new UILabel();
            spaceLabel          = new UILabel();
            comboBoxButton      = new UIButton();
            sizeButton          = new UIButton();
            textColorButton     = new UIButton();
            backColorButton     = new UIButton();
            comboBoxHeaderLabel = new UILabel();
            sizetextLabel       = new UILabel();
            resolutionLabel     = new UILabel();
            orientationLabel    = new UILabel();
            //searchButton = new UIButton();

            //comboBoxHeaderLabell
            comboBoxHeaderLabel.Text          = "Scale And Layout";
            comboBoxHeaderLabel.TextColor     = UIColor.Black;
            comboBoxHeaderLabel.TextAlignment = UITextAlignment.Left;
            comboBoxHeaderLabel.Font          = UIFont.FromName("Helvetica-Bold", 15f);

            //sizetextLabell
            sizetextLabel.Text          = "Change the size of text, apps and other items";
            sizetextLabel.Lines         = 2;
            sizetextLabel.LineBreakMode = UILineBreakMode.WordWrap;
            sizetextLabel.TextColor     = UIColor.Black;
            sizetextLabel.TextAlignment = UITextAlignment.Left;
            sizetextLabel.Font          = UIFont.FromName("Helvetica", 16f);

            //resolutionLabell
            resolutionLabel.Text          = "Resolution";
            resolutionLabel.TextColor     = UIColor.Black;
            resolutionLabel.TextAlignment = UITextAlignment.Left;
            resolutionLabel.Font          = UIFont.FromName("Helvetica", 16f);

            //orientationLabell
            orientationLabel.Text          = "Orientation";
            orientationLabel.TextColor     = UIColor.Black;
            orientationLabel.TextAlignment = UITextAlignment.Left;
            orientationLabel.Font          = UIFont.FromName("Helvetica", 16f);

            //experienceButtonn
            orientationComboBox = new SfComboBox();
            orientationComboBox.ComboBoxSource       = orientationDetails;
            orientationComboBox.IsEditable           = false;
            orientationComboBox.Text                 = (NSString)"Landscape";
            orientationComboBox.SuggestionMode       = SuggestionMode.StartsWith;
            orientationComboBox.MaxDropDownHeight    = 160;
            orientationComboBox.ItemHeight           = 40;
            orientationComboBox.DropDownCornerRadius = 5;
            orientationComboBox.Watermark            = (NSString)"Search Here";
            if ((UIDevice.CurrentDevice).UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                this.controlView.AddSubview(orientationComboBox);
            }
            else
            {
                this.AddSubview(orientationComboBox);
            }
            //comboBoxDoneButtonn
            comboBoxDoneButton.SetTitle("Done\t", UIControlState.Normal);
            comboBoxDoneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            comboBoxDoneButton.BackgroundColor     = UIColor.FromRGB(240, 240, 240);
            comboBoxDoneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            comboBoxDoneButton.Hidden         = true;
            comboBoxDoneButton.TouchUpInside += HideexperiencePicker;

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

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

            backColorDoneButton.SetTitle("Done\t", UIControlState.Normal);
            backColorDoneButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Right;
            backColorDoneButton.BackgroundColor     = UIColor.FromRGB(240, 240, 240);
            backColorDoneButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            backColorDoneButton.Hidden         = true;
            backColorDoneButton.TouchUpInside += HideexperiencePicker;
            //add vieww
            if ((UIDevice.CurrentDevice).UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                this.controlView.AddSubview(comboBoxDoneButton);
                this.controlView.AddSubview(sizeDoneButton);
                this.controlView.AddSubview(textColorDoneButton);
                this.controlView.AddSubview(backColorDoneButton);

                this.controlView.AddSubview(comboBoxHeaderLabel);
                this.controlView.AddSubview(sizetextLabel);
                this.controlView.AddSubview(resolutionLabel);
                this.controlView.AddSubview(orientationLabel);
            }
            else
            {
                this.AddSubview(comboBoxDoneButton);
                this.AddSubview(sizeDoneButton);
                this.AddSubview(textColorDoneButton);
                this.AddSubview(backColorDoneButton);

                this.AddSubview(comboBoxHeaderLabel);
                this.AddSubview(sizetextLabel);
                this.AddSubview(resolutionLabel);
                this.AddSubview(orientationLabel);
            }
        }