private void prepareBackbutton() { var image = UIImage .FromBundle("icBackNoPadding") .ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate); var color = Foundation.MvvmCross.Helper.Color.NavigationBar.BackButton.ToNativeColor(); var backButton = new UIButton(); backButton.TintColor = color; backButton.SetImage(image, UIControlState.Normal); backButton.SetTitleColor(color, UIControlState.Normal); backButton.SetTitle(Resources.Back, UIControlState.Normal); backButton.TitleLabel.Font = UIFont.SystemFontOfSize(backButtonFontSize, UIFontWeight.Medium); backButton.Rx() .BindAction(ViewModel.Close) .DisposedBy(DisposeBag); //Spacing between button image and title var spacing = 6; backButton.ImageEdgeInsets = new UIEdgeInsets(0, 0, 0, spacing); backButton.TitleEdgeInsets = new UIEdgeInsets(0, spacing, 0, 0); NavigationItem.HidesBackButton = true; NavigationItem.LeftItemsSupplementBackButton = false; NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(backButton), true); //Otherwise title gets clipped var frame = backButton.Frame; frame.Width = 90; backButton.Frame = frame; backButton.HorizontalAlignment = UIControlContentHorizontalAlignment.Left; }
public override void ViewDidLoad() { base.ViewDidLoad(); Title = NSBundle.MainBundle.GetLocalizedString(ConstantsHelper.Maps, ConstantsHelper.Maps); _sideMenuManager = new SideMenuManager(); NavigationItem.SetLeftBarButtonItem( new UIBarButtonItem(ConstantsHelper.Menu, UIBarButtonItemStyle.Plain, (sender, e) => { PresentViewController(_sideMenuManager.LeftNavigationController, true, null); }), false); SetupSideMenu(); var mapsView = new MKMapView(); mapsView.MapType = MKMapType.Hybrid; mapsView.ZoomEnabled = true; mapsView.ScrollEnabled = true; mapsView.TranslatesAutoresizingMaskIntoConstraints = false; CLLocationManager locationManager = new CLLocationManager(); locationManager.RequestWhenInUseAuthorization(); mapsView.ShowsUserLocation = true; View.AddSubview(mapsView); View.AddConstraints(mapsView.WithSameTop(View), mapsView.WithSameBottom(View), mapsView.WithSameLeft(View), mapsView.WithSameRight(View)); }
public override void ViewDidLoad() { base.ViewDidLoad(); var backbutton = new UIBarButtonItem("Back", UIBarButtonItemStyle.Done, null) { TintColor = UIColor.White }; backbutton.Clicked += (sender, e) => NavigationController.PopViewControllerAnimated(true); NavigationItem.SetLeftBarButtonItem(backbutton, false); Title = Organizationpage.Model.Name + "'s Expenses"; var restClient = new RestClient("https://intense-escarpment-3682.herokuapp.com/"); var request = new RestRequest("expenses/" + Organizationpage.Model.Id); timer = NSTimer.CreateRepeatingScheduledTimer(2, () => restClient.ExecuteAsync(request, response => InvokeOnMainThread(() => { var results = JsonConvert.DeserializeObject <X> (response.Content).Items; var source = new SpentTableSource(results); TableView.Source = source; TableView.ReloadData(); }))); }
public NativeListViewController() : base(UITableViewStyle.Plain) { Title = "HybridNativeTodo"; webViewController = new RazorViewController(); NavigationItem.SetRightBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Add), false); NavigationItem.RightBarButtonItem.Clicked += (sender, e) => { var template = new TodoView() { Model = new TodoItem() }; var page = template.GenerateString(); webViewController.webView.LoadHtmlString(page, NSBundle.MainBundle.BundleUrl); NavigationController.PushViewController(webViewController, true); }; NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Play), false); NavigationItem.LeftBarButtonItem.Clicked += (sender, e) => { var todos = App.Database.GetItemsNotDone(); var tospeak = ""; foreach (var t in todos) { tospeak += t.Name + " "; } if (tospeak == "") { tospeak = "there are no tasks to do"; } Speech.Speak(tospeak); }; }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); var longPressGesture = new UILongPressGestureRecognizer(gestureRecognizer => { if (gestureRecognizer.State == UIGestureRecognizerState.Began) { Editing = !Editing; } }); View.AddGestureRecognizer(longPressGesture); Title = Localization.VacationsPageTitle; var barItem = new UIBarButtonItem(UIImage.FromBundle("add"), UIBarButtonItemStyle.Plain, async(sender, args) => { var vac = new VacationModel(); vac.Id = await Context.App.Factory.Resolve <IVacationProvider>().AddAsync(vac); _itemsSource.Add(vac); ((UITableView)View).ReloadData(); } ); NavigationItem.SetLeftBarButtonItem(barItem, true); TableView.RegisterClassForCellReuse(typeof(VacationInfoCell), ReuseId); }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); //ThemeManager.Current.Apply(tracksTable); tracksTable.WeakDelegate = this; tracksTable.WeakDataSource = this; SetNavigationBarBackground(this.InterfaceOrientation); SetBackgroundImage(this.InterfaceOrientation); tracksTable.SeparatorStyle = UITableViewCellSeparatorStyle.None; tracksTable.SelectRow(NSIndexPath.FromItemSection(0, 0), true, UITableViewScrollPosition.None); RowSelected(tracksTable, NSIndexPath.FromItemSection(0, 0)); var itemBtn = new UIBarButtonItem("Elements", UIBarButtonItemStyle.Plain, null); itemBtn.Clicked += (object sender, EventArgs e) => { var elements = (ElementsFormController)this.Storyboard.InstantiateViewController(@"elementsForm"); // var elements = new ElementThemeController(); elements.ModalPresentationStyle = UIModalPresentationStyle.FormSheet; var nav = new UINavigationController(elements); nav.ModalPresentationStyle = UIModalPresentationStyle.FormSheet; this.PresentViewController(nav, true, null); }; NavigationItem.SetLeftBarButtonItem(itemBtn, false); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(Catalog.GetString("Back"), UIBarButtonItemStyle.Plain, (sender, args) => { ctrl.ButtonPressed(null); ctrl.RemoveScreen(type); }), false); if (type == ScreenType.Locations || type == ScreenType.Items) { NavigationItem.SetRightBarButtonItem(new UIBarButtonItem(Catalog.GetString("Map"), UIBarButtonItemStyle.Plain, (sender, args) => { ctrl.ButtonPressed(null); ctrl.ShowScreen(ScreenType.Map, null); }), false); } NavigationItem.LeftBarButtonItem.TintColor = Colors.NavBarButton; NavigationItem.SetHidesBackButton(false, false); // Create table view Table = new UITableView() { Source = screenListSource, AutoresizingMask = UIViewAutoresizing.All, AutosizesSubviews = true }; // Reposition and resize the receiver Table.Frame = new RectangleF(0, 0, View.Frame.Width, View.Frame.Height); // Add the table view as a subview View.AddSubview(this.Table); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. // Get all commands for this object // Show back button NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(Catalog.GetString("Back"), UIBarButtonItemStyle.Plain, (sender, args) => { ctrl.ButtonPressed(null); ctrl.RemoveScreen(ScreenType.Details); }), false); NavigationItem.LeftBarButtonItem.TintColor = Colors.NavBarButton; NavigationItem.SetHidesBackButton(false, false); commands = null; targets = null; if (!(activeObject is Task)) { commands = ((Thing)activeObject).ActiveCommands; // foreach(Command c in ((Thing)obj).ActiveCommands) // commands.Add (c); } // Create view CreateViews(); }
public override void ViewDidLoad() { base.ViewDidLoad(); NavigationItem.SetLeftBarButtonItem( new UIBarButtonItem(UIImage.FromBundle("menu.png"), UIBarButtonItemStyle.Plain, (s, e) => NavigationController.PopViewController(true)), true); locations = new AvailableLocations(); state = locations.States.ElementAt(0); currentSelected = locations.PotentialLocations.Where(loc => loc.State == state).ElementAt(0); stateTableSource = new StateTableSource(locations); cityTableSource = new CityTableSource(locations, locations.States.ElementAt(0)); StateTableView.Source = stateTableSource; CityTableView.Source = cityTableSource; StateTableView.SelectRow(NSIndexPath.FromRowSection(0, 0), false, UITableViewScrollPosition.None); stateTableSource.ValueChanged += StateTable_Changed; cityTableSource.ValueChange += CityTable_Changed; RecentCitiesButton.TouchUpInside += (object sender, EventArgs e) => { var storyboard = UIStoryboard.FromName("Main", null); var recentCitiesViewController = (RecentCitiesTableViewController)storyboard.InstantiateViewController("RecentCitiesTableViewController"); recentCitiesViewController.FromMenu = false; this.ShowViewController(recentCitiesViewController, this); }; }
public override void ViewDidLoad() { base.ViewDidLoad(); this.Title = "Artists"; tracks = DataLoader.LoadSampleData(); tableListView.WeakDelegate = this; tableListView.WeakDataSource = this; tableListView.BackgroundColor = UIColor.Clear; tableListView.SeparatorStyle = UITableViewCellSeparatorStyle.None; var itemBtn = new UIBarButtonItem("Elements", UIBarButtonItemStyle.Plain, null); itemBtn.Clicked += (object sender, EventArgs e) => { UINavigationController nav = (UINavigationController)this.Storyboard.InstantiateViewController(@"ElemNav"); this.PresentViewController(nav, true, null); }; NavigationItem.SetLeftBarButtonItem(itemBtn, false); ThemeManager.Current.Apply(View); }
void SetUpUI() { Title = new CultureInfo("en-US").TextInfo.ToTitleCase(viewModel.Name); NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(UIImage.FromFile("NavigationBar_Back.png"), UIBarButtonItemStyle.Plain, (sender, args) => { NavigationController.PopViewController(true); }), true); btnCheckIn.Layer.CornerRadius = 4; btnCheckIn.Layer.MasksToBounds = true; headerView = BeerDescriptionHeaderView.Create(); headerView.SetBeer(viewModel.Beer); tableView.TableHeaderView = null; tableView.AddSubview(headerView); tableView.ContentInset = new UIEdgeInsets(headerViewHeight, 0, 0, 0); tableView.BackgroundColor = UIColor.Clear; //Add Cells AddRating(); AddDescription(); //Update Tableview tableView.Source = new BeerDescriptionDataSource(ref cells); var deleg = new DescriptionDelegate(ref cells); deleg.DidScroll += UpdateHeaderView; tableView.Delegate = deleg; tableView.ReloadData(); View.SetNeedsDisplay(); }
public override void ViewDidLoad() { base.ViewDidLoad(); commonHelper = new CommonHelper(); this.NavigationItem.Title = "Last Worn Date"; // create next button nextButton = new UIBarButtonItem("Other Details", UIBarButtonItemStyle.Plain, NextButtonClickAction); NavigationItem.SetRightBarButtonItem(nextButton, true); // create previous button prevButton = new UIBarButtonItem("ItemType", UIBarButtonItemStyle.Plain, PrevButtonClickAction); NavigationItem.SetLeftBarButtonItem(prevButton, true); var calendar = new NSCalendar(NSCalendarType.Gregorian); var currentDate = NSDate.Now; var components = new NSDateComponents(); components.Year = -60; NSDate minDate = calendar.DateByAddingComponents(components, NSDate.Now, NSCalendarOptions.None); Console.WriteLine("ViewDidLoad, before AddScreenLayout wardrobeObj" + wardrobeObj.ItemType); AddScreenLayout(); }
public override void ViewDidLoad() { base.ViewDidLoad(); NavigationItem.SetLeftBarButtonItem( new UIBarButtonItem(UIImage.FromBundle("threelines.png") , UIBarButtonItemStyle.Plain , (sender, args) => { SidebarController.ToggleMenu(); }), true); //PreferenceHandler prefHandler = new PreferenceHandler(); UserDetails userDetail = PreferenceHandler.GetUserDetails(); if (PreferenceHandler.GetUserDetails().RoleId == (int)USER_ROLE.ADMIN) { btnBadge = new UIButton() { Frame = new CGRect(0, 0, 25, 25), }; btnBadge.SetBackgroundImage(UIImage.FromBundle("Notification_Icon.png"), UIControlState.Normal); btnBadge.SetTitleColor(UIColor.White, UIControlState.Normal); btnBadge.TouchUpInside += BtnBadge_TouchUpInside; btnAlertsBadge = new BadgeBarButtonItem(btnBadge); btnAlertsBadge.BadgeValue = UIApplication.SharedApplication.ApplicationIconBadgeNumber.ToString(); btnAlertsBadge.Style = UIBarButtonItemStyle.Plain; btnAlertsBadge.ShouldHideBadgeAtZero = true; btnAlertsBadge.BadgeOriginX = 10; NavigationItem.SetRightBarButtonItem(btnAlertsBadge, true); } }
/// <remarks> /// Background image idea from /// http://mikebluestein.wordpress.com/2009/10/05/setting-an-image-background-on-a-uitableview-using-monotouch/ /// </remarks> public override void ViewDidLoad() { base.ViewDidLoad(); Title = "Speakers"; //_speakerData = AppDelegate.ConferenceData.Speakers; speakerData = MonkeySpace.Core.ConferenceManager.Speakers.Values.ToList(); UIImageView imageView = new UIImageView(UIImage.FromFile("Background.png")); imageView.Frame = new RectangleF(0, 0, View.Frame.Width, View.Frame.Height); imageView.UserInteractionEnabled = true; tableView = new UITableView { Source = new TableViewSource(this, speakerData) , AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth , BackgroundColor = UIColor.Clear , Frame = new RectangleF(0, 0, View.Frame.Width, View.Frame.Height - 44) , ShowsVerticalScrollIndicator = true }; imageView.AddSubview(tableView); View.AddSubview(imageView); // SLIDEOUT BUTTON NavigationController.NavigationBar.SetTitleTextAttributes(AppDelegate.Current.FontTitleTextAttributes); var bbi = new UIBarButtonItem(UIImage.FromBundle("Images/slideout"), UIBarButtonItemStyle.Plain, (sender, e) => { AppDelegate.Current.FlyoutNavigation.ToggleMenu(); }); NavigationItem.SetLeftBarButtonItem(bbi, false); tableView.BackgroundView = new UIImageView(UIImage.FromBundle("Images/Background")); }
private void SetupNavigationItems() { // Add back button using ( var closeImage = UIImage.FromBundle("Icons/close.png").ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)) { _closeButton = new UIBarButtonItem(closeImage, UIBarButtonItemStyle.Plain, null, null); } NavigationController.InteractivePopGestureRecognizer.Delegate = new SwipeGestureDelegate(); NavigationItem.SetLeftBarButtonItem(_closeButton, true); // Add Post button _postMenuItem = new UIBarButtonItem { Title = Settings.GetResource(ResKeys.mobile_post_btn_post), }; var icoFontAttribute = new UITextAttributes { Font = Appearance.Fonts.LatoBoldWithSize(24), TextColor = Appearance.Colors.BisnerBlue }; _postMenuItem.SetTitleTextAttributes(icoFontAttribute, UIControlState.Application); _postMenuItem.Style = UIBarButtonItemStyle.Done; // Post indicator _postingIndicator = new UIActivityIndicatorView { Color = Appearance.Colors.BisnerBlue }; _postIndicatorItem = new UIBarButtonItem(_postingIndicator); _postingIndicator.StartAnimating(); NavigationItem.SetRightBarButtonItems(new[] { _postMenuItem }, true); }
public HomeViewController() : base(UITableViewStyle.Plain, null, true) { if (UIDevice.CurrentDevice.CheckSystemVersion(6, 0)) { // UIRefreshControl iOS6 RefreshControl = new UIRefreshControl(); RefreshControl.ValueChanged += HandleValueChanged; AppDelegate.Conference.OnDownloadSucceeded += (jsonString) => { Console.WriteLine("OnDownloadSucceeded"); InvokeOnMainThread(() => { RefreshControl.EndRefreshing(); }); }; AppDelegate.Conference.OnDownloadFailed += (err) => { Console.WriteLine("OnDownloadFailed"); InvokeOnMainThread(() => { RefreshControl.EndRefreshing(); }); }; } else { // old style refresh button and no PassKit for older iOS NavigationItem.SetRightBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Refresh), false); NavigationItem.RightBarButtonItem.Clicked += (sender, e) => { Refresh(); }; } bbi = new UIBarButtonItem(UIImage.FromBundle("Images/slideout"), UIBarButtonItemStyle.Plain, (sender, e) => { AppDelegate.Current.FlyoutNavigation.ToggleMenu(); }); NavigationItem.SetLeftBarButtonItem(bbi, false); }
public override void ViewDidLoad() { base.ViewDidLoad(); NewList = new List <NewsEntity>(); //NewListPerWeek = new List<NewsEntity>(); CreateData(List); _todayweek = DateTime.Today.ToIso8601Weeknumber(); tableView.Source = new DetailTableSource(NewListPerWeek, this); _cellDelegate = new CellDelegate(NewListPerWeek, tableView, this); FilterDataByWeek(_todayweek); NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(UIImage.FromBundle("IconBack"), UIBarButtonItemStyle.Plain, (sender, args) => { NavigationController.PopViewController(true); }), true); NavigationItem.SetRightBarButtonItem(new UIBarButtonItem(UIImage.FromBundle("Add"), UIBarButtonItemStyle.Plain, (sender, args) => { var editVc = Storyboard.InstantiateViewController("CreateEditNewsViewController") as CreateEditNewsViewController; if (editVc == null) { return; } var createEditNavigationController = new UINavigationController(editVc); NavigationController.PresentViewController(createEditNavigationController, true, null); }), true); }
public override void ViewDidLoad() { base.ViewDidLoad(); _sideMenuManager = new SideMenuManager(); NavigationItem.SetLeftBarButtonItem( new UIBarButtonItem(ConstantsHelper.Menu, UIBarButtonItemStyle.Plain, (sender, e) => { PresentViewController(_sideMenuManager.LeftNavigationController, true, null); }), false); SetupSideMenu(); var addButton = new UIBarButtonItem(UIBarButtonSystemItem.Add, NavigateToEditToDoController) { AccessibilityLabel = ConstantsHelper.AddNewToDoButtonAccessibilityLabel }; NavigationItem.RightBarButtonItem = addButton; Repository = new ToDoRepository(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), ConstantsHelper.DatabaseName)); _activeTab = new ToDoActiveViewController(Repository); _doneTab = new ToDoDoneViewController(Repository); ViewControllers = new[] { _activeTab, _doneTab }; SelectedIndex = 1; }
/// <summary> /// Views the did load. /// </summary> /// <returns>The did load.</returns> public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. UIBarButtonItem backButton = new UIBarButtonItem("< Back", UIBarButtonItemStyle.Bordered, HandleSignout); NavigationItem.SetLeftBarButtonItem(backButton, false); View.BackgroundColor = UIColor.White; _presenter.SetView(this); var width = View.Bounds.Width; var height = View.Bounds.Height; Title = "Clients"; var titleLabel = new UILabel() { TranslatesAutoresizingMaskIntoConstraints = false, Text = "Connected Clients", Font = UIFont.FromName("Helvetica-Bold", 22), TextAlignment = UITextAlignment.Center }; var descriptionLabel = new UILabel() { TranslatesAutoresizingMaskIntoConstraints = false, Text = "Select a client you would like to chat with", Font = UIFont.FromName("Helvetica", 18), TextAlignment = UITextAlignment.Center }; _tableView = new UITableView(new CGRect(0, 0, width, height)) { TranslatesAutoresizingMaskIntoConstraints = false }; _tableView.AutoresizingMask = UIViewAutoresizing.All; _tableView.Source = _source; Add(titleLabel); Add(descriptionLabel); Add(_tableView); var views = new DictionaryViews() { { "titleLabel", titleLabel }, { "descriptionLabel", descriptionLabel }, { "tableView", _tableView }, }; View.AddConstraints( NSLayoutConstraint.FromVisualFormat("V:|-100-[titleLabel(30)]-[descriptionLabel(30)]-[tableView]|", NSLayoutFormatOptions.DirectionLeftToRight, null, views) .Concat(NSLayoutConstraint.FromVisualFormat("H:|[tableView]|", NSLayoutFormatOptions.AlignAllTop, null, views)) .Concat(NSLayoutConstraint.FromVisualFormat("H:|-10-[titleLabel]-10-|", NSLayoutFormatOptions.AlignAllTop, null, views)) .Concat(NSLayoutConstraint.FromVisualFormat("H:|-10-[descriptionLabel]-10-|", NSLayoutFormatOptions.AlignAllTop, null, views)) .ToArray()); }
private void SetNavigationItems() { _cancelButton = new UIBarButtonItem(UIBarButtonSystemItem.Cancel); _doneButton = new UIBarButtonItem(UIBarButtonSystemItem.Done); NavigationItem.SetLeftBarButtonItem(_cancelButton, true); NavigationItem.SetRightBarButtonItem(_doneButton, true); }
private void SetBackButton() { var leftBarButton = new UIBarButtonItem(UIImage.FromBundle("ic_back_arrow"), UIBarButtonItemStyle.Plain, GoBack); NavigationItem.SetLeftBarButtonItem(leftBarButton, true); NavigationController.NavigationBar.TintColor = Helpers.Constants.R15G24B30; NavigationItem.Title = Localization.Texts.PasswordViewTitleText; }
private void SetBackButton() { var leftBarButton = new UIBarButtonItem(UIImage.FromBundle("ic_back_arrow"), UIBarButtonItemStyle.Plain, GoBack); NavigationItem.SetLeftBarButtonItem(leftBarButton, true); NavigationController.NavigationBar.TintColor = Helpers.Constants.R15G24B30; NavigationItem.Title = "Your account name"; }
public void SetMenuNavigationButton() { _menuButton = new UIBarButtonItem(UIImage.FromBundle("hamburger_menu_white.png") , UIBarButtonItemStyle.Plain , (sender, args) => { SidebarMenuController.ToggleMenu(); }); NavigationItem.SetLeftBarButtonItem(_menuButton, false); }
private void SetBackButton() { var leftBarButton = new UIBarButtonItem(UIImage.FromBundle("ic_back_arrow"), UIBarButtonItemStyle.Plain, GoBack); NavigationItem.SetLeftBarButtonItem(leftBarButton, true); NavigationController.NavigationBar.TintColor = Constants.R15G24B30; NavigationItem.Title = AppSettings.LocalizationManager.GetText(_powerAction == PowerAction.PowerUp ? LocalizationKeys.PowerUp : LocalizationKeys.PowerDown); NavigationController.NavigationBar.Translucent = false; }
protected void SetUpCloseNavigationBar() { Title = "TaskyDrop"; NavigationController.Toolbar.BackgroundColor = UIColor.Blue; NavigationController.NavigationBar.BarTintColor = UIColor.Purple; NavigationController.NavigationBar.TintColor = UIColor.Black; _btnBack = new UIBarButtonItem(UIBarButtonSystemItem.Reply, null); NavigationItem.SetLeftBarButtonItem(_btnBack, false); }
public override void ViewDidLoad() { base.ViewDidLoad(); tableSource.Services = services; ServicesTableView.Source = tableSource; NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem("Disconnect", UIBarButtonItemStyle.Plain, (s, e) => { BluetoothLEManager.Current.DisconnectPeripheral(connectedPeripheral); }), false); }
private void SetVisibleCancelButton() { NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Cancel, (s, args) => { SmartLearningApplication.Instance.RandomTestViewModel.Finish(); SmartLearningApplication.Instance.RandomTestViewModel.SetBadgeValueAction(); NavigationItem.SetLeftBarButtonItem(null, true); Title = SmartLearningApplication.Instance.RandomTestViewModel.ViewTitle = "Training"; }), true); SmartLearningApplication.Instance.RandomTestViewModel.SetHideCanCelButton = SetHideCancelButton; }
public override void ViewDidLoad() { base.ViewDidLoad(); NavigationItem.Title = Title; NavigationItem.SetLeftBarButtonItem( new UIBarButtonItem(UIImage.FromBundle("threelines") , UIBarButtonItemStyle.Plain , (sender, args) => { SidebarController.ToggleMenu(); }), true); }
public override void ViewDidLoad() { base.ViewDidLoad(); View.BackgroundColor = UIColor.Clear; _imgBackground = new UIImageView(UIImage.FromBundle("Background.jpg")) { ContentMode = UIViewContentMode.ScaleAspectFill }; Title = Strings.Statistics; _btnClose = new UIBarButtonItem(UIBarButtonSystemItem.Cancel); NavigationItem.SetLeftBarButtonItem(_btnClose, false); _lblTitle = new UILabel { Font = UIFont.SystemFontOfSize(28f, UIFontWeight.Bold), TextColor = AppColors.AccentColor.ToNativeColor(), Text = Strings.DeathStarStatus }; _plotView = new PlotView(); _plotView.BackgroundColor = UIColor.Clear; View.AddSubviews(_imgBackground, _lblTitle, _plotView); View.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints(); View.AddConstraints( _imgBackground.AtLeftOf(View), _imgBackground.AtTopOf(View), _imgBackground.AtBottomOf(View), _imgBackground.AtRightOf(View), _lblTitle.AtLeftOf(View, 12f), _lblTitle.AtTopOf(View, 8f), _lblTitle.AtRightOf(View, 12f), _plotView.Below(_lblTitle), _plotView.AtLeftOf(View), _plotView.AtRightOf(View), _plotView.AtBottomOf(View) ); View.BringSubviewToFront(_plotView); var set = this.CreateBindingSet <StatusView, StatusViewModel>(); set.Bind(_plotView).For(v => v.Model).To(vm => vm.PlotModel); set.Bind(_btnClose).For("Clicked").To(vm => vm.CloseCommand); set.Apply(); }
private void SetupNavigationsBar() { _backButton.Frame = new CGRect(0, 0, 40, 40); _backButton.SetImage(UIImage.FromBundle("BackButton"), UIControlState.Normal); _logoutButton.Frame = new CGRect(0, 0, 40, 40); _logoutButton.SetImage(UIImage.FromBundle("LogOutButton"), UIControlState.Normal); NavigationItem.SetRightBarButtonItem(new UIBarButtonItem(_logoutButton), false); NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(_backButton), false); }