/// <summary> /// Creates a new <see cref="Home"/> instance. /// </summary> public Home() { InitializeComponent(); this.Title = ApplicationStrings.HomePageTitle; this.domainContext = new SchedulerDomainContext(); this.SelectResource = (Application.Current.RootVisual as MainPage).SelectResource; this.LoadResources(); Scheduler.AppointmentEdited += Scheduler_AppointmentEdited; Scheduler.AppointmentDeleted += Scheduler_AppointmentDeleted; Scheduler.AppointmentCreating += Scheduler_AppointmentCreating; Scheduler.AppointmentEditing += (s, a) => { if (!WebContext.Current.User.IsAuthenticated) { a.Cancel = true; MessageBox.Show("PLease login and try again"); } }; Scheduler.AppointmentDeleting += (s, a) => { if (!WebContext.Current.User.IsAuthenticated) { a.Cancel = true; MessageBox.Show("PLease login and try again"); } }; SelectResource.SelectionChanged += SelectResource_SelectionChanged; this.SelectResource.Visibility = System.Windows.Visibility.Visible; }
private void ComboBox_Loaded(object sender, RoutedEventArgs e) { domainContext = new SchedulerDomainContext(); domainContext.Load<Resource>(domainContext.GetResourceQuery()).Completed += (s, args) => { foreach (var Res in domainContext.Resources) { if (Res.ResourceTypes.DisplayName == "Team") { TeamCB.Items.Add(new ComboBoxItem() { Content = Res.DisplayName, Tag = Res.Id }); } } }; }