EventIndexPage.xaml.cs CampusAppWP8::Pages::Events::EventIndexPage CampusAppWP8::Pages::Events //----------------------------------------------------------------------------- //<copyrightfile="EventIndexPage.xaml.cs"company="BTU/IIT"> //Companycopyrighttag. //</copyright> //<author>fiedlchr</author> //<sience>03.05.2013</sience> //----------------------------------------------------------------------------- namespaceCampusAppWP8.Pages.Events { usingSystem; usingSystem.Windows; usingSystem.Windows.Navigation; usingCampusAppWP8.Feed.Events; usingCampusAppWP8.Resources; usingCampusAppWP8.Utility.Lui.MessageBoxes; usingMicrosoft.Phone.Controls; usingMicrosoft.Phone.Shell; publicpartialclassEventIndexPage:PhoneApplicationPage { privatestaticEventFeedeventFeed=null; publicEventIndexPage() { this.InitializeComponent(); ApplicationBarIconButtonupdateBtn=newApplicationBarIconButton(); updateBtn.IconUri=newUri(Icons.Update,UriKind.Relative); updateBtn.Text=AppResources.UpdateBtn; updateBtn.Click+=newEventHandler(this.EventForceUpdate_Click); ApplicationBar.Buttons.Add(updateBtn); if(EventIndexPage.eventFeed==null) { EventIndexPage.eventFeed=newEventFeed(false); } EventIndexPage.eventFeed.onLoaded+=newEventFeed.OnLoaded(this.SetupEventPageList); EventIndexPage.eventFeed.onFailedWeb+=newEventFeed.OnFailed(this.FeedIsFailWeb); EventIndexPage.eventFeed.onFailedFile+=newEventFeed.OnFailed(this.FeedIsFailFile); EventIndexPage.eventFeed.LoadData(); } publicstaticEventFeedFeed { get { returnEventIndexPage.eventFeed; } set { if(EventIndexPage.eventFeed!=value) { EventIndexPage.eventFeed=value; } } } publicstaticEventFeedGetEventFeed() { returnEventIndexPage.eventFeed; } protectedoverridevoidOnNavigatedTo(NavigationEventArgse) { base.OnNavigatedTo(e); } privatevoidSetupEventPageList() { this.EventList.ItemsSource=EventIndexPage.eventFeed.Model.Channel[0].Item; } privatevoidEventForceUpdate_Click(objectsender,EventArgse) { EventIndexPage.eventFeed.ForceWebUpdate(); } privatevoidFeedIsFailWeb() { MessageBoxResultresult=MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadWeb); EventIndexPage.eventFeed.ForceReadFile(); } privatevoidFeedIsFailFile() { MessageBoxResultresult=MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile); } } }