public void GoToPage(MPageType pageType) { if(_currentPageType == pageType) return; //we're already on the same page, so don't bother doing anything MPage pageToCreate = null; if(pageType == MPageType.TitlePage) { pageToCreate = new MTitlePage(); } else if (pageType == MPageType.InGamePage) { pageToCreate = new MInGamePage(); } else if (pageType == MPageType.ScorePage) { pageToCreate = new MScorePage(); } if(pageToCreate != null) //destroy the old page and create a new one { _currentPageType = pageType; if(_currentPage != null) { Futile.stage.RemoveChild(_currentPage); } _currentPage = pageToCreate; Futile.stage.AddChild(_currentPage); _currentPage.Start(); } }
/// <summary> /// 分页查询 /// </summary /// <param name="whereLambd"></param> /// <param name="orderLambd"></param> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <param name="sort"></param> /// <returns></returns> public virtual MPage <TEntity> GetPageList(Expression <Func <TEntity, bool> > whereLambd, Expression <Func <TEntity, bool> > orderLambd, int pageIndex, int pageSize, bool sort = true) { var result = new MPage <TEntity>(); var entites = GetQueryable(whereLambd, orderLambd, sort); result.TotalCount = entites.Count(); result.RowEntities = entites.Skip(pageSize * (pageIndex - 1)).Take(pageSize); return(result); }
public MainPage() { MessagingCenter.Subscribe <MainPageModel>(this, "Click", async(sender) => { await MPage.Animate(new ScaleToAnimation { Duration = "4000", Scale = 200 }); sender.tcs.SetResult(true); }); InitializeComponent(); }