当前位置: 首页> 房产> 建材 > 乐平网站设计_网站seo优化加推广_百度搜索百度_百度网址名称是什么

乐平网站设计_网站seo优化加推广_百度搜索百度_百度网址名称是什么

时间:2025/9/12 3:32:22来源:https://blog.csdn.net/u012269637/article/details/144839026 浏览次数:0次
乐平网站设计_网站seo优化加推广_百度搜索百度_百度网址名称是什么

页面控件使用                 

  <Label Style="{StaticResource ListSearch-Label}" Content="走货方式:"/>
                    <c1:C1ComboBox BorderThickness="1" Width="110"
                    <xctk:CheckComboBox Width="113" Style="{StaticResource ListSearch-XctkCheckComboBox}" 
                                        ItemsSource="{Binding ShippmentWayList,Mode=TwoWay}" 
                                        DisplayMemberPath="ShipWay" ValueMemberPath="ShipWay" 
                                        SelectedItemsOverride="{Binding ShippmentWayItems,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, 
                                        ValidatesOnExceptions=True, ValidatesOnDataErrors=True, NotifyOnValidationError=True}"
                                        SelectedValue="{Binding ShippmentWay, Mode=TwoWay}"/>

cs

  private ObservableCollection<dynamic> _shippmentWayItems;

        private string _shippmentWay;

        public string ShippmentWay
        {
            get
            {
                return _shippmentWay;
            }
            set
            {
                if (_shippmentWay != null && _shippmentWay.Contains("-1") && value != null && !value.Contains("-1"))
                {
                    _shippmentWayItems = new ObservableCollection<dynamic>() { };
                }

                  //等于-1这个可以护理,我的key和value用的都是中文
                else if (_shippmentWay != null && !_shippmentWay.Contains("-1") && value != null && value.Contains("-1"))
                {
                    _shippmentWay = InitWayStatus();
                    _shippmentWayItems = new ObservableCollection<dynamic>() { };
                    foreach (var item in ShippmentWayList)
                    {
                        _shippmentWayItems.Add(new { name = item.ShipWay, value = item.ShipWay });
                    }
                }
                _shippmentWay = value;
                if (SearchItem != null)
                {
                    SearchItem.ShippmentWay = _shippmentWay;
                }
                RaisePropertyChanged(() => ShippmentWayItems);
                RaisePropertyChanged(() => ShippmentWay);
            }
        }


        /// <summary>
        /// 获取所有走货方式数据来源数据库
        /// </summary>
        private void GetShipingWayList() 
        {
            string error;
            var list = _shipWayService.FindByIsShip((int)_fSaleType, out error);
            if (list == null)
            {
                ShippmentWayList = new ObservableCollection<ShipWayModel>();
            }
            else
            {
                ShippmentWayList = new ObservableCollection<ShipWayModel>(list);
            }
            RaisePropertyChanged(() => ShippmentWayList);
        }

 /// <summary>
        /// 默认走货方式的状态初始化,把这个方法放在初始化种
        /// </summary>
        /// <returns></returns>
        private string InitWayStatus()
        {
            var list = new List<string>();
            if (ShippmentWayList==null) {
                GetShipingWayList();
            }
            foreach (var item in ShippmentWayList)
            {
                list.Add(item.ShipWay);
            }
            return string.Join(",", list);
        }
 


 

关键字:乐平网站设计_网站seo优化加推广_百度搜索百度_百度网址名称是什么

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: