using HMI.Base;
|
using HMI.UI.DpUtil;
|
using System.Collections.ObjectModel;
|
using System.Windows;
|
using System.Windows.Controls;
|
|
namespace Plugin.StandardTest
|
{
|
public class ScreenGridConfig
|
{
|
public int rows { get; set; }
|
public int columns { get; set; }
|
public ObservableCollection<bool> values { get; set; }
|
}
|
|
/// <summary>
|
/// ScreenTouch.xaml 的交互逻辑
|
/// </summary>
|
public partial class ScreenGrid : NotifyControl
|
{
|
public ScreenGrid(int rows, int columns)
|
{
|
InitializeComponent();
|
|
for (int i = 0; i < rows; i++)
|
{
|
grid.RowDefinitions.Add(new RowDefinition());
|
}
|
|
for (int i = 0; i < columns; i++)
|
{
|
grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto});
|
}
|
}
|
|
public void AddScreen(ScreenTouch screen, int row, int col)
|
{
|
grid.Children.Add(screen);
|
Grid.SetRow(screen, row);
|
Grid.SetColumn(screen, col);
|
|
GridHelper.RefreshGridSpace(grid);
|
}
|
}
|
}
|