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

            _mainViewModel = Resolver.Resolve<MainViewModel>();
            await _mainViewModel.Initialize();

            TableView.ReloadData();
        }
Ejemplo n.º 2
0
        protected async override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            Bootstrapper.Initialize();

            ViewModel = Resolver.Resolve<MainViewModel>();

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            ActionBar.NavigationMode = ActionBarNavigationMode.Tabs;

            _viewPager = FindViewById<ViewPager>(Resource.Id.pager);

            var adapter = new FragmentPagerAdapter(SupportFragmentManager);


            adapter.Add(new ViewPagerFragment(((i, v, b) =>
            {
                _shl = new ListView(this);

                var layout = new LinearLayout(this);
                layout.AddView(_shl);

                return layout;
            })));

            adapter.Add(new ViewPagerFragment(((i, v, b) =>
            {
                _ha = new ListView(this);


                var layout = new LinearLayout(this);
                layout.AddView(_ha);

                return layout;
            })));

            ViewModel.PropertyChanged += ViewModel_PropertyChanged;
            ViewModel.Initialize();

            _viewPager.Adapter = adapter;
            _viewPager.AddOnPageChangeListener(this);

            var tab1 = ActionBar.NewTab();
            tab1.SetText("SHL");
            tab1.TabSelected += Tab_TabSelected;

            var tab2 = ActionBar.NewTab();
            tab2.SetText("Hockeyallsvenskan");
            tab2.TabSelected += Tab_TabSelected;

            ActionBar.AddTab(tab1);
            ActionBar.AddTab(tab2);
        }