/// <summary> /// 创建内容控件 /// </summary> private void CreateProduct() { panelItem.Children.Clear(); int index = 0; string strStatusText = string.Empty; for (int i = 0; i < m_MaxRowNum; i++) { for (int j = 0; j < m_EachRowNum; j++) { if (index < m_CurrentItemList.Count) { CashControl productControl = new CashControl() { HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, VerticalAlignment = System.Windows.VerticalAlignment.Stretch, Margin = new Thickness(5) }; Grid.SetRow(productControl, i); Grid.SetColumn(productControl, j); panelItem.Children.Add(productControl); productControl.MouseLeftButtonUp += (ItemWayChecked); productControl.SetCurrentItem(m_CurrentItemList[index]); productControl.SetOneText(PubHelper.p_BusinOper.MoneyIntToString(m_CurrentItemList[index].CashValue.ToString())); switch (m_CurrentItemList[index].Status) { case "0": // 关闭接收 strStatusText = m_Text_Stop; break; case "1": // 开启接收 strStatusText = m_Text_Run; break; } productControl.SetSecondText(strStatusText); } index++; } } ControlButton(false); }
/// <summary> /// 创建内容控件 /// </summary> private void CreateProduct() { panelItem.Children.Clear(); int index = 0; string strStatusText = string.Empty; for (int i = 0; i < m_MaxRowNum; i++) { for (int j = 0; j < m_EachRowNum; j++) { if (index < m_CurrentItemList.Count) { CashControl productControl = new CashControl() { HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, VerticalAlignment = System.Windows.VerticalAlignment.Stretch, Margin = new Thickness(5) }; Grid.SetRow(productControl, i); Grid.SetColumn(productControl, j); panelItem.Children.Add(productControl); productControl.SetCurrentItem(m_CurrentItemList[index]); productControl.Tag = m_CurrentItemList[index].CashValue.ToString(); productControl.SetOneText(PubHelper.p_BusinOper.MoneyIntToString(m_CurrentItemList[index].CashValue.ToString())); strStatusText = m_CurrentItemList[index].StockNum.ToString() + "【" + m_CurrentItemList[index].BoxStockNum.ToString() + "】"; productControl.SetSecondText(strStatusText); } index++; } } }