public HostInfoEditDlg(MainWindow main, string title, HostInfo hi) : this() { mainWindow = main; hostInfo = hi; hostInfoBack = (HostInfo)hi.Clone(); this.Title = title; txtHostIMEI.Text = hi.IDID; txtHostLat.Text = hi.Lat.ToString(); txtHostLng.Text = hi.Lng.ToString(); txtHostName.Text = hi.Name; txtHostRemark.Text = hi.Remark; txtHostRoadID.Text = hi.Addr; cbHostEnable.IsChecked = hi.Enable; // 初始化组信息 combGroupInfo.ItemsSource = MainWindow.appState.TreeDatas.TreeGroupInfos.Where(t => t.GroupInfo.GUID.Trim() != "").ToList(); combGroupInfo.DisplayMemberPath = "GroupInfo.Name"; combGroupInfo.SelectedItem = MainWindow.appState.TreeDatas.TreeGroupInfos.FirstOrDefault(t => t.GroupInfo.GUID == hi.GroupInfoGUID); }