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; }
public void OnHyperlinkClick(object sender, RoutedEventArgs e) { TextBlock row = sender as TextBlock; // Fetch Unit information Unit u = row.DataContext as Unit; _unitController.UpdateClasses(ref u); // User control UnitDetailUserControl uduc = new UnitDetailUserControl(); uduc.DataContext = u; 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(); }