// Constructor public EditEventScreen() { this.venues = model.DomainModels.VenueModel.getAll(); InitializeComponent(); this.DataContext = this; // Set the title according to current action (Edit or Add). this.Title = "Create Event"; this._curEvent = new model.Event(); // Set the ID to -1 since it's a new Event. this._curEvent.Id = -1; }
private void NavigationService_LoadCompleted(object sender, NavigationEventArgs e) { this.NavigationService.LoadCompleted -= NavigationService_LoadCompleted; NavigationData navData = (NavigationData)e.ExtraData; if (navData != null) { if (navData.loggedInUser == null) { this.NavigationService.Navigate(new Uri("LoginScreen.xaml", UriKind.Relative)); } else { this._loggedInUser = navData.loggedInUser; this.loggedInUserLabel.Content = this._loggedInUser.Name; } // If eventID from navData exists, it means that we need to edit the event! if (navData.eventID != -1) { this.Title = "Edit Event"; // Load event data from database and its data will bind onto the form. this._curEvent = model.DomainModels.EventModel.getByID(navData.eventID); } } }
// Constructor public EventItem(Event e, bool isOwner, bool isRegistered) { this.CurEvent = e; this.IsOwner = isOwner; this.IsRegistered = isRegistered; }