Exemplo n.º 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            if (RespondsToSelector(new Selector("setEdgesForExtendedLayout:")))
            {
                EdgesForExtendedLayout = UIRectEdge.None;
            }

            var removeButton = new UIBarButtonItem(UIBarButtonSystemItem.Trash);

            removeButton.Clicked += (sender, args) => ViewModel.RemovePageCommand.Execute(null);

            var addButton = new UIBarButtonItem(UIBarButtonSystemItem.Add);

            addButton.Clicked += (sender, args) => ViewModel.AddPageCommand.Execute(null);

            NavigationItem.LeftBarButtonItem  = removeButton;
            NavigationItem.RightBarButtonItem = addButton;

            var dataSource = new DataSource(this, ViewModel.Pages);

            var bset = this.CreateBindingSet <FirstView, FirstViewModel>();

            bset.Bind(dataSource).For(v => v.NumberOfViewControllers).To(vm => vm.PageCount);
            bset.Apply();

            Datasource          = dataSource;
            TabColor            = UIColorHelpers.GetRandomColor();
            HeaderFont          = UIFont.SystemFontOfSize(25);
            HeaderColor         = UIColor.DarkGray;
            SelectedHeaderFont  = UIFont.BoldSystemFontOfSize(25);
            SelectedHeaderColor = UIColor.Black;
            BottomLineColor     = UIColor.White;
            IconSpacing         = 15;
            TabSpacing          = 20;
            //StaticTabBar = true;
            Title = "MvxSGTabbedPager Sample";

            IconAlignment = IconAlignment.Right;
        }
Exemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColorHelpers.GetRandomColor();

            var label = new UILabel();

            var bset = this.CreateBindingSet <PageViewController, PageViewModel>();

            bset.Bind(label).To(vm => vm.Hello);
            bset.Apply();

            Add(label);

            View.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            View.AddConstraints(
                label.AtTopOf(View, 10f),
                label.AtLeftOf(View, 10f),
                label.AtRightOf(View, 10f));
        }