Exemple #1
0
        public void RefreshLines()
        {
            if (string.IsNullOrEmpty(Tip))
            {
                return;
            }
            var contentBox = GetTemplateChild("ContentBox") as StackPanel;

            if (contentBox == null)
            {
                return;
            }
            contentBox.Children.Clear();
            var lines = Tip.Replace("\r\n", "\n").Replace('\r', '\n').Split('\n');

            foreach (var line in lines)
            {
                if (string.IsNullOrWhiteSpace(line))
                {
                    continue;
                }
                contentBox.Children.Add(new TextBlock()
                {
                    Text = "· " + line
                });
            }
        }
Exemple #2
0
        private void SetStockTip(string StockTip)
        {
            string[] TipArray = StockTip.Split(',');

            foreach (string Tip in TipArray)
            {
                if (Tip.Contains("北京"))
                {
                    CheckBoxList_BJ.SelectedValue = Tip.Replace("北京", "") == "有货" ? "1" : "0";
                }
                else if (Tip.Contains("广州"))
                {
                    CheckBoxList_GZ.SelectedValue = Tip.Replace("广州", "") == "有货" ? "1" : "0";
                }
                else if (Tip.Contains("呼和浩特"))
                {
                    CheckBoxList_HH.SelectedValue = Tip.Replace("呼和浩特", "") == "有货" ? "1" : "0";
                }
                else if (Tip.Contains("上海"))
                {
                    CheckBoxList_SH.SelectedValue = Tip.Replace("上海", "") == "有货" ? "1" : "0";
                }
            }
        }