整合管理器服务端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.2 KiB

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace SunlightAggregationManager.View
{
/// <summary>
/// MachinePage.xaml 的交互逻辑
/// </summary>
public partial class MachinePage : UserControl
{
public MachinePage()
{
InitializeComponent();
}
private string id = "";
private void DataGridmachines_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
int rownum = DataGridmachines.SelectedIndex;//获取鼠标选中行并定义变量
if (rownum != -1)//判断鼠标定位是否有效
{
var row_ = DataGridmachines.Columns[0].GetCellContent(DataGridmachines.Items[rownum]);
if (row_ is TextBlock textBlock)
{
id = textBlock.Text;//定位第0列,
}
}
}
}
}