当前位置: 首页 > news >正文

做淘客的网站有哪些电商怎么做账和报税

做淘客的网站有哪些,电商怎么做账和报税,做网站需要学会写代码吗,上海市嘉定建设局网站WPF中TreeView.BringIntoView方法的替代方案 周银辉 WPF中TreeView.BringIntoView#xff08;#xff09;方法并不是那么地好用#xff0c;不少时候会没有效果#xff0c;这里有一个替代方案#xff0c;调用SelectItem#xff08;#xff09;方法可以展开并呈现TreeView…                             WPF中TreeView.BringIntoView方法的替代方案                                        周银辉 WPF中TreeView.BringIntoView方法并不是那么地好用不少时候会没有效果这里有一个替代方案调用SelectItem方法可以展开并呈现TreeView上指定的Item   public static class TreeViewHelper     {         /// summary         /// Expands all children of a TreeView         /// /summary         /// param nametreeViewThe TreeView whose children will be expanded/param         public static void ExpandAll(this TreeView treeView)         {             ExpandSubContainers(treeView);         }           /// summary         /// Expands all children of a TreeView or TreeViewItem         /// /summary         /// param nameparentContainerThe TreeView or TreeViewItem containing the children to expand/param         private static void ExpandSubContainers(ItemsControl parentContainer)         {             foreach (Object item in parentContainer.Items)             {                 TreeViewItem currentContainer parentContainer.ItemContainerGenerator.ContainerFromItem(item) as TreeViewItem;                 if (currentContainer ! null currentContainer.Items.Count 0)                 {                     //expand the item                     currentContainer.IsExpanded true;                       //if the items children are not generated, they must be expanded                     if (currentContainer.ItemContainerGenerator.Status ! GeneratorStatus.ContainersGenerated)                     {                         //store the event handler in a variable so we can remove it (in the handler itself)                         EventHandler eh null;                         eh new EventHandler(delegate                             {                                 //once the children have been generated, expand those childrens children then remove the event handler                                 if (currentContainer.ItemContainerGenerator.Status GeneratorStatus.ContainersGenerated)                                 {                                     ExpandSubContainers(currentContainer);                                     currentContainer.ItemContainerGenerator.StatusChanged - eh;                                 }                             });                           currentContainer.ItemContainerGenerator.StatusChanged eh;                     }                     else //otherwise the children have already been generated, so we can now expand those children                     {                         ExpandSubContainers(currentContainer);                     }                 }             }         }           /// summary         /// Searches a TreeView for the provided object and selects it if found         /// /summary         /// param nametreeViewThe TreeView containing the item/param         /// param nameitemThe item to search and select/param         public static void SelectItem(this TreeView treeView, object item)         {             ExpandAndSelectItem(treeView, item);         }           /// summary         /// Finds the provided object in an ItemsControls children and selects it         /// /summary         /// param nameparentContainerThe parent container whose children will be searched for the selected item/param         /// param nameitemToSelectThe item to select/param         /// returnsTrue if the item is found and selected, false otherwise/returns         private static bool ExpandAndSelectItem(ItemsControl parentContainer, object itemToSelect)         {             //check all items at the current level             foreach (Object item in parentContainer.Items)             {                 TreeViewItem currentContainer parentContainer.ItemContainerGenerator.ContainerFromItem(item) as TreeViewItem;                   //if the data item matches the item we want to select, set the corresponding                 //TreeViewItem IsSelected to true                 if (item itemToSelect currentContainer ! null)                 {                     currentContainer.IsSelected true;                     currentContainer.BringIntoView();                     currentContainer.Focus();                       //the item was found                     return true;                 }             }               //if we get to this point, the selected item was not found at the current level, so we must check the children             foreach (Object item in parentContainer.Items)             {                 TreeViewItem currentContainer parentContainer.ItemContainerGenerator.ContainerFromItem(item) as TreeViewItem;                   //if children exist                 if (currentContainer ! null currentContainer.Items.Count 0)                 {                     //keep track of if the TreeViewItem was expanded or not                     bool wasExpanded currentContainer.IsExpanded;                       //expand the current TreeViewItem so we can check its child TreeViewItems                     currentContainer.IsExpanded true;                       //if the TreeViewItem child containers have not been generated, we must listen to                     //the StatusChanged event until they are                     if (currentContainer.ItemContainerGenerator.Status ! GeneratorStatus.ContainersGenerated)                     {                         //store the event handler in a variable so we can remove it (in the handler itself)                         EventHandler eh null;                         eh new EventHandler(delegate                         {                             if (currentContainer.ItemContainerGenerator.Status GeneratorStatus.ContainersGenerated)                             {                                 if (ExpandAndSelectItem(currentContainer, itemToSelect) false)                                 {                                     //The assumption is that code executing in this EventHandler is the result of the parent not                                     //being expanded since the containers were not generated.                                     //since the itemToSelect was not found in the children, collapse the parent since it was previously collapsed                                     currentContainer.IsExpanded false;                                 }                                   //remove the StatusChanged event handler since we just handled it (we only needed it once)                                 currentContainer.ItemContainerGenerator.StatusChanged - eh;                             }                         });                         currentContainer.ItemContainerGenerator.StatusChanged eh;                     }                     else //otherwise the containers have been generated, so look for item to select in the children                     {                         if (ExpandAndSelectItem(currentContainer, itemToSelect) false)                         {                             //restore the current TreeViewItems expanded state                             currentContainer.IsExpanded wasExpanded;                         }                         else //otherwise the node was found and selected, so return true                         {                             return true;                         }                     }                 }             }               //no item was found             return false;         }     }  转载于:https://www.cnblogs.com/zhouyinhui/archive/2008/12/22/1360033.html
http://www.yutouwan.com/news/355144/

相关文章:

  • 随州网站建设外包公司长沙官网seo技巧
  • 电子商务网站开发人员单页网站源码
  • 刘家窑网站建设公司今天广州新闻最新消息
  • 厦门双瑞高磁网站是谁做的电商网站定制开发
  • 对网站提出的优化建议厦门网站开发公司找哪家
  • jsp简述网站开发流程无锡网站制作哪家便宜
  • 加油站项目建设背景烟台市住房和城乡建设厅网站
  • 做网站编辑有什么发展怎么做网站的投票平台
  • 网站设计与建设的公司万基城市建设有限公司网站
  • 做棋牌网站违法吗客户管理软件有哪些
  • 深圳贸易网站建设5118网站
  • 深圳市工程招标网中标公告百度seo2022
  • 高碑店地区网站建设成成品网站源码有限公司
  • 好的网站建设案例成立公司注册资金可以随便写吗
  • 网站开发word文档360建筑网官网招聘
  • 旅游便宜网站建设网站编程论文
  • 网站建设没有预付款自己做网站推广试玩
  • 学网站建设需要多长时间如何在个人电脑用源码做网站
  • 滕州网站设计竞彩足球最新比赛
  • 建网站石家庄h5怎么设计网页
  • 门户网站网站不允许上传文件
  • 建设网站都需要准备什么dw网站开发环境
  • 精品课程 网站建设质量自己做网站租服务器
  • 做网站有哪几种语言网站建设人员
  • 哪个免费自助建站系统最好用商城网站制作公司
  • 网站设计说明书整合珠海网站建设 旭洁
  • 杭州外贸建站图书馆信息化网站建设
  • 南京建设工程公共资源交易中心网站做视频在线观看网站
  • 上海建设网站价格怎么注册17做网站
  • 怎么做网站地图的样式seo工具网站