public HomeDetailPage() { InitializeComponent(); HomeViewModel = new ViewModels.HomeViewListViewModel(""); HomeView = new Views.HomeView(HomeViewModel); RepportViewModel = new ViewModels.RepportViewViewModel(); RepportView = new Views.RepportView(RepportViewModel); MineViewModel = new ViewModels.MineViewViewModel(); MineView = new Views.MineView(MineViewModel); #region ThreeViews Views = new List <TabViewChildren>() { new TabViewChildren() { Text = "主页", UnSelectImageSource = "tab0.png", SelectedTextColor = TabBarColorFilter, ImageColorFilter = TabBarColorFilter, View = HomeView, }, new TabViewChildren() { Text = "记录", UnSelectImageSource = "tab1.png", SelectedTextColor = TabBarColorFilter, ImageColorFilter = TabBarColorFilter, View = RepportView, }, new TabViewChildren() { Text = "我的", UnSelectImageSource = "tab2.png", SelectedTextColor = TabBarColorFilter, ImageColorFilter = TabBarColorFilter, View = MineView, } }; tabView.AddChildrenViews(Views); #endregion tabView.SelectedChanged += TabView_SelectedChanged; }
public HomeView(ViewModels.HomeViewListViewModel pViewModel) { InitializeComponent(); ListViewModel = pViewModel; this.BindingContext = ListViewModel; }