VoucherGrid.xaml.cs
(开头部分) 17KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using VoucherGridCtl.Commons;
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using static VoucherGridCtl.Commons.Consts;
namespace VoucherGridCtl
{
/// <summary>
/// VoucherGrid.xaml 的交互逻辑
/// </summary>
public partial class VoucherGrid : UserControl
{
static int MAX_ROWS = 100;
static int MAX_COLUMNS = 5;
string[,] m_Controls = new string[MAX_ROWS, MAX_COLUMNS];
string m_LastFocusControl = "";
//定义事件参数类
public class RowChangeEventArgs : EventArgs
{
public int OldRowIndex { set; get; }
public int RowIndex { set; get; }
/// <summary>
/// true 焦点返回上一
/// </summary>
public bool Cancel { set; get; }
}
//定义delegate
public delegate void RowChangeEventHandler(object sender, RowChangeEventArgs e);
//用event 关键字声明事件对象
public event RowChangeEventHandler RowChangeEvent;
protected void OnRowChangeEvent(Control sender,int OldRowIndex,int RowIndex) {
if (RowChangeEvent == null)
return;
RowChangeEventArgs args = new RowChangeEventArgs();
args.OldRowIndex = OldRowIndex;
args.RowIndex = RowIndex;
RowChangeEvent(grid, args);
if (args.Cancel)
{
SetLastFocus();
throw new FinanceAccountControlException(FinanceAccountControlErrorCode.CANCEL);
}
}
public VoucherGrid()
{
InitializeComponent();
}
List<VoucherGridItem> m_DataSource = new List<VoucherGridItem>();
public List<VoucherGridItem> DataSource { get { HoldDataSource(); return m_DataSource; } set { m_DataSource = value; } }
public int CurrentRowIndex { set; get; } = -1;
后面还有 435 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。