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

网络营销热点事件案例分析广州百度seo

网络营销热点事件案例分析,广州百度seo,网推软件有哪些,WordPress安装Redis前言 最近在和其他软件联合做一个本地图片选择传输功能#xff0c;为此希望图片能够有序的呈现在客户端#xff0c;简单的实现了一下功能#xff0c;通过Mvvm模式进行呈现#xff0c;过程简单通俗#xff0c;话不多说直接上图。 处理过程 前台代码 你只需要粘贴到你的前台…前言 最近在和其他软件联合做一个本地图片选择传输功能为此希望图片能够有序的呈现在客户端简单的实现了一下功能通过Mvvm模式进行呈现过程简单通俗话不多说直接上图。 处理过程 前台代码 你只需要粘贴到你的前台xml中就可以位置记得调整下Margin,我这是按照我的位置进行调整的所以针对ListBox在你的前台你还需要调整下。 ListBox NamelstFileManager Background Transparent ItemsSource{Binding} ScrollViewer.HorizontalScrollBarVisibilityDisabled ScrollViewer.VerticalScrollBarVisibilityAuto ScrollViewer.CanContentScrollTrue Margin69,192,50,40ListBox.ItemsPanelItemsPanelTemplateWrapPanel//ItemsPanelTemplate/ListBox.ItemsPanelListBox.ItemTemplateDataTemplate!--这里修改内容整体大小以及在你框内的占比我这一行显示5个--Grid Margin17 Width100 Height155Grid.RowDefinitionsRowDefinition HeightAuto /RowDefinitionRowDefinition HeightAuto /RowDefinitionRowDefinition HeightAuto /RowDefinition/Grid.RowDefinitionsImage Source{Binding Pic} HorizontalAlignmentCenter VerticalAlignmentCenter Width100 Height100/Border BorderThickness1 BorderBrushred Margin1,107,1,0/TextBlock Text{Binding Name} Grid.Row1 ForegroundWhite VerticalAlignmentCenter HorizontalAlignmentCenter HeightAuto TextWrappingWrap//Grid/DataTemplate/ListBox.ItemTemplate /ListBox 后台代码 创建一个类进行数据绑定 public class LVData{public string Name { get; set; }public BitmapImage Pic { get; set; }} 定义一个集合进行数据缓存 集合定义在MainWindow的类中 ObservableCollectionLVData LVDatas new ObservableCollectionLVData(); 在我们的逻辑中进行数据填充和呈现清除集合清空ListBox中的Item显示 //添加图 LVDatas.Add(new LVData { Name 图片在ListBox中显示的名称建议直接显示图片名称, Pic new BitmapImage(new Uri(完整的图片路径)) }); //显示在ListBox中 lstFileManager.ItemsSource LVDatas; //清除集合清空呈现 LVDatas.Clear(); //当前点击的图片名称lstFileManager.SelectedIndex 这是目前点击的下标 Console.WriteLine(LVDatas[lstFileManager.SelectedIndex].Name); 整体代码 using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes;namespace ImageTexture {/// summary/// MainWindow.xaml 的交互逻辑/// /summarypublic partial class MainWindow : Window{//定义集合ObservableCollectionLVData LVDatas new ObservableCollectionLVData();public MainWindow(){InitializeComponent();ImageTexture2DView(E:\\ProjectFiles\\ImageTexture);}private void ImageTexture2DView(string path){//Path是图片所在的文件夹路径var apps System.IO.Directory.GetFiles(path);Liststring images new Liststring();foreach (string app in apps)//---遍历文件夹所有文件{var fi new FileInfo(app);//---使用FileInfo类进行操作if (fi.Extension .png){//将图片添加到LVData中LVDatas.Add(new LVData { Name fi.Name.Remove(fi.Name.LastIndexOf(.)), Pic new BitmapImage(new Uri(fi.FullName)) });}}//进行呈现lstFileManager.ItemsSource LVDatas;}private void ImageClear_Click(object sender, RoutedEventArgs e){//清除集合清空ListBox中的Item显示LVDatas.Clear();}}public class LVData{public string Name { get; set; }public BitmapImage Pic { get; set; }} }结局     后续想从数据库或者其他地方添加就根据自己的想法添加就可以了另外获取点击的是哪个绑定个监听事件就可以了希望对大家有帮助。
http://www.hkea.cn/news/14592616/

相关文章:

  • 如何做网站推广获客网站数据维护
  • 用表格做网站建设网站必备条件
  • wordpress网站很慢wordpress主题大前端dux去授权
  • 网页制作模板的网站代码wordpress ie8 兼容
  • 在线免费开网站校园网网站建设规划
  • 文化厅网站建设审核报告单wordpress 子页面列表
  • 织梦网站流动广告代码网页翻译功能在哪
  • 网站开发人员介绍手机 互动网站案例
  • 百度网站的网址是什么如何制作网页设计首页
  • 国内网站是cn还是com怎么在建设银行网站挂号
  • 鹤壁做网站的公司百度seo关键词排名推荐
  • 江门网站快速排名优化网站平台优化
  • 在线解压网站phpcms网站seo怎么做
  • 做网站找哪个软件怎么制作链接带图片和文字编辑
  • jsp环保主题网站代做免费wordpress博客
  • seo整站优化外包服务icp备案域名购买
  • 校园网站设计开题报告百度 手机网站 友好性
  • seo建站网络公司郑州网站建设哪家好
  • 苏州专业网站建设设计公司网站服务器选择
  • 网站设计搜索栏怎么做网站视频下载软件
  • 网站新功能演示用什么技术做的肇庆网站建设优化
  • 合肥市建设建筑网站网站内容策划方案
  • onethink做的企业网站长沙微信公众号开发
  • 德阳市做网站网站备案和服务器备案
  • 竹子建站seo设置怎么做莱阳网站建设
  • 家居企业网站建设公司建设网站的需要学习哪些课程
  • 网站大气模板中国建筑网络教育平台
  • 大理市城乡建设局网站教你如何用天翼云盘做网站
  • 常熟企业网站建设广西医院的网站建设
  • 上海网站的优化公司建设银行社保卡查询网站