public void OnHyperlinkClick(object sender, RoutedEventArgs e) { TextBlock row = sender as TextBlock; // Fetch Unit information Class u = row.DataContext as Class; Staff r = DBAdapter.Instance.FetchStaffByID(u.StaffID); _staffController.UpdateConsultations(ref r); _staffController.UpdateUnits(ref r); _staffController.UpdateClasses(ref r); // User control StaffDetailUserControl uduc = new StaffDetailUserControl(); uduc.DataContext = r; Window window = new Window { Title = u.ToString(), Owner = Application.Current.MainWindow, Content = uduc, Height = 500, Width = 700, ResizeMode = ResizeMode.NoResize, WindowStartupLocation = WindowStartupLocation.CenterOwner, }; window.ShowDialog(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Staffs = ((System.Windows.Controls.TabItem)(target)); return; case 2: this.StaffList = ((HRIS.Source.View.StaffListUserControl)(target)); return; case 3: this.StaffDetail = ((HRIS.Source.View.StaffDetailUserControl)(target)); return; case 4: this.Units = ((System.Windows.Controls.TabItem)(target)); return; case 5: this.UnitList = ((HRIS.Source.View.UnitListUserControl)(target)); return; case 6: this.UnitDetail = ((HRIS.Source.View.UnitDetailUserControl)(target)); return; } this._contentLoaded = true; }