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

网站续费贵是重新做个好还是续费wordpress博客 centtos

网站续费贵是重新做个好还是续费,wordpress博客 centtos,网站建设目标初步目标,西部数码网站备案核验单前言 最近在和其他软件联合做一个本地图片选择传输功能#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.yutouwan.com/news/73186/

相关文章:

  • 网站互联网接入商优秀网站例子
  • 企业型网站建设制作平台全自动免费网页制作
  • 网站收费怎么做synology建设网站
  • 怎样上网站dns解析不了水果网站首页设计
  • 网站建设有哪些岗位职责百度点击优化
  • 网站开发与应用专业石家庄网页设计机构
  • wordpress payjsseo网站建站公司的主页
  • 外包公司怎么找业务aso推广优化
  • 无锡网站制作工作室重庆电子工程职业学院招生网
  • 自己做网站 什么软件视频网站开发计划书
  • 网站注销申请表望野眼上海话
  • 网站没快照无印良品官方网络商城
  • 网站首页布局修改德州做网站优化
  • 建材网站建设公司app开发公司掌握我的源代码吗
  • 网站开发需要什么热门网络游戏
  • 网站报错 500cpanel wordpress主题安装
  • 网站建设和维护待遇怎样高大上网站建设公司
  • 做一婚恋网站多少钱网站常见程序问题
  • 山西孝义网站开发市场调研公司收费标准
  • 网站建设与运营实验贷款网站模板
  • 长沙娱乐网站开发网站优化排名哪家好
  • 网站 建设需帷客分享 wordpress
  • wordpress建站两秒打开科技网站设计公司排名
  • 陕西建设银行官网站高淳城乡建设局网站
  • win2012r2 建设网站采集网站如何收录
  • 滦平县建设局网站重庆中技互联
  • 福安网站开发化妆品公司网站源码
  • 织梦网站档目管理空白网页程序开发基础知识
  • 做养生产品哪个网站好wordpress三栏模板
  • 网站搜索怎么做的龙岗网页设计