private void dataGrid_Record_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e) { String title = ((System.Data.DataRowView)(dataGrid_Record.CurrentCell.Item)).Row.ItemArray[2].ToString(); String date = ((System.Data.DataRowView)(dataGrid_Record.CurrentCell.Item)).Row.ItemArray[1].ToString(); String detail = ((System.Data.DataRowView)(dataGrid_Record.CurrentCell.Item)).Row.ItemArray[3].ToString(); RecordDetail rd = RecordDetail.getRecordDetail(title, date, detail, this.Top, this.Left); rd.Show(); }
public static RecordDetail getRecordDetail(String title, String date, String content, double x, double y) { //判断是否已经建立过窗体 if (instance == null) { instance = new RecordDetail(title, date, content, x, y); } else //如果建立,则更新内容 { instance.textBlock_Detail.Text = title; instance.textBox_Date.Text = date; instance.textBlock_Detail.Text = content; } return(instance); }