Created
August 13, 2011 18:53
-
-
Save clausjoergensen/1144157 to your computer and use it in GitHub Desktop.
LoadingPivotItem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void PivotLayout_LoadingPivotItem(object sender, PivotItemEventArgs e) | |
{ | |
if (e.Item.Content != null) | |
return; | |
var pivot = (Pivot)sender; | |
if (e.Item == WeatherPivotItem) | |
e.Item.Content = new WeatherPivotItemControl(); | |
else if (e.Item == RegionalPivotItem) | |
e.Item.Content = new RegionalPivotItemControl(); | |
else if (e.Item == CountryPivotItem) | |
e.Item.Content = new CountryPivotItemControl(); | |
else if (e.Item == PollenPivotItem) | |
e.Item.Content = new PollenPivotItemControl(); | |
else if (e.Item == DiversePivotItem) | |
e.Item.Content = new DiversePivotItemControl(); | |
else if (e.Item == FavoritesPivotItem) | |
e.Item.Content = new FavoritesPivotItemControl(); | |
else if (e.Item == NewsPivotItem) | |
e.Item.Content = new NewsPivotItemControl(); | |
if (e.Item.Content != null) | |
(e.Item.Content as FrameworkElement).DataContext = this.DataContext; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment