private void lblClick(object sender, MouseButtonEventArgs e) { var jsonFile = File.ReadAllText("person.json"); ShowPers sh = JsonConvert.DeserializeObject <ShowPers>(jsonFile); if (sender is Label lbl) { ShowPers shPers = new ShowPers(); string[] lab = lbl.Content.ToString().Split(); Dictionary <string, string[]> arrFromJson = JsonConvert.DeserializeObject <Dictionary <string, string[]> >(jsonFile); foreach (var v in arrFromJson) { if ((v.Value[0] == lab[1]) && (v.Value[1] == lab[2])) { //shPers.DateFirst = (v.Key.Remove(v.Key.Length - 5, 5)); shPers.DateFirst = v.Key; shPers.arr = v.Value; } } ; shPers.Show(); shPers.Focus(); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.mwShowPers = ((Med.ShowPers)(target)); #line 9 "..\..\ShowPers.xaml" this.mwShowPers.Closing += new System.ComponentModel.CancelEventHandler(this.mwShowPers_Closing); #line default #line hidden return; case 2: #line 18 "..\..\ShowPers.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 3: this.tbFirstName = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.tbDiagnos = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.tbSecondName = ((System.Windows.Controls.TextBox)(target)); return; case 6: this.dateFirst = ((System.Windows.Controls.DatePicker)(target)); return; case 7: this.timeFirst = ((Xceed.Wpf.Toolkit.MaskedTextBox)(target)); return; case 8: this.dateOfBirth = ((System.Windows.Controls.DatePicker)(target)); return; case 9: this.dateSecond = ((System.Windows.Controls.DatePicker)(target)); return; case 10: this.timeSecond = ((Xceed.Wpf.Toolkit.MaskedTextBox)(target)); return; case 11: this.btnDel = ((System.Windows.Controls.Button)(target)); #line 33 "..\..\ShowPers.xaml" this.btnDel.Click += new System.Windows.RoutedEventHandler(this.btnDel_Click); #line default #line hidden return; } this._contentLoaded = true; }