async Task initView() { vm = ViewModel as LOViewModel; //init data await vm.InitLoad(); indexView = new IpadIndexView(); indexView.LOsInCircle = vm.LOsInCircle; indexView.PageIndexSelected += IndexView_PageIndexSelected; View.Add(indexView); UITapGestureRecognizer tapp = new UITapGestureRecognizer(() => { UIView.Animate(0.35, () => { readerview.Frame = new CGRect(0, 0, 1024, 768); readerview.ResetPositions(); }); }); indexView.AddGestureRecognizer(tapp); addBackButton(); loadPagesDataSource(); initLoad.Hide(); }
async Task ini() { _mainLayout = new RelativeLayout(this); _mainLayout.LayoutParameters = new RelativeLayout.LayoutParams(-1, -1); _mainLayout.SetBackgroundColor(Color.ParseColor("#ffffff")); mainLayoutIndice = new RelativeLayout(this); mainLayoutIndice.LayoutParameters = new RelativeLayout.LayoutParams(-1, -1); mainLayoutPages = new RelativeLayout(this); mainLayoutPages.LayoutParameters = new RelativeLayout.LayoutParams(-1, Configuration.getWidth(1136 - 85)); mainLayoutPages.SetBackgroundColor(Color.ParseColor("#ffffff")); viewPager = new ViewPager(this); viewPagerIni = new ViewPager(this); mainLayoutIndice.SetX(0); mainLayoutIndice.SetY(0); _mainLayout.AddView(mainLayoutIndice); await vm.InitLoad(); LoadPagesDataSource(); viewPagerIni.SetOnPageChangeListener(new MyPageChangeListener(this, listFront)); viewPager.SetOnPageChangeListener(new MyPageChangeListenerPager(this, listFrontPager)); vm.PropertyChanged += Vm_PropertyChanged; }
async Task ini() { _mainLayout = new RelativeLayout(this); _mainLayout.LayoutParameters = new RelativeLayout.LayoutParams(-1, -1); _mainLayout.SetBackgroundColor(Color.ParseColor("#ffffff")); mainLayoutIndice = new RelativeLayout(this); mainLayoutIndice.LayoutParameters = new RelativeLayout.LayoutParams(-1, -1); mainLayoutIndice.SetBackgroundColor(Color.ParseColor("#ffffff")); mainLayoutPages = new RelativeLayout(this); mainLayoutPages.LayoutParameters = new RelativeLayout.LayoutParams(-1, Configuration.getWidth(1136 - 85)); mainLayoutPages.SetBackgroundColor(Color.ParseColor("#ffffff")); viewPager = new ViewPager(this); viewPagerIni = new ViewPager(this); /* layoutPanelScroll = new LinearLayout (this); * layoutPanelScroll.LayoutParameters = new LinearLayout.LayoutParams (-1,-2); * layoutPanelScroll.SetBackgroundColor(Color.ParseColor("#ffffff")); * layoutPanelScroll.Orientation = Orientation.Vertical; */ /* scrollVertical = new VerticalScrollView (this); * scrollVertical.setOnScrollViewListener (this); * scrollVertical.LayoutParameters = new ViewGroup.LayoutParams (-1, -1); * * scrollVertical.SetX (0); scrollVertical.SetY (0); * * * scrollVertical.AddView (layoutPanelScroll);*/ //mainLayoutIndice.AddView (scrollVertical); mainLayoutIndice.SetX(0); mainLayoutIndice.SetY(0); _mainLayout.AddView(mainLayoutIndice); //mainLayout.AddView (scrollVertical); //var vm = this.ViewModel as LOViewModel; await vm.InitLoad(); //loadLOsInCircle(0); LoadPagesDataSource(); viewPagerIni.SetOnPageChangeListener(new MyPageChangeListener(this, listFront)); viewPager.SetOnPageChangeListener(new MyPageChangeListenerPager(this, listFrontPager)); vm.PropertyChanged += Vm_PropertyChanged; }