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

公司网站策划怎样做好网络营销推广

公司网站策划,怎样做好网络营销推广,企业网站建设的基本内容,中国建设官网下载首先,我先创建事务对象ApplicationInfo,当暴露出一对属性当例子集合对于构成ListBoxes。这个类在例子中显示如下代码: public class ApplicationInfo { public Double Price { get; set; } public String IconPath { get; set; } public …

首先,我先创建事务对象ApplicationInfo,当暴露出一对属性当例子集合对于构成ListBoxes。这个类在例子中显示如下代码:
 

public class ApplicationInfo 
{ public Double Price { get; set; } public String IconPath { get; set; } public String Name { get; set; } public String Author { get; set; } public static ObservableCollection<ApplicationInfo> GenerateApplicationInfos() { ObservableCollection<ApplicationInfo> result = new ObservableCollection<ApplicationInfo>(); ApplicationInfo info1 = new ApplicationInfo(); info1.Name = "Large Collider"; info1.Author = "C.E.R.N."; info1.IconPath = @"img/Atom.png"; result.Add(info1); ApplicationInfo info2 = new ApplicationInfo(); info2.Name = "Paintbrush"; info2.Author = "Imagine Inc."; info2.IconPath = @"img/Brush.png"; result.Add(info2); ApplicationInfo info3 = new ApplicationInfo(); info3.Name = "Lively Calendar"; info3.Author = "Control AG"; info3.IconPath = @"img/CalendarEvents.png"; result.Add(info3); ApplicationInfo info4 = new ApplicationInfo(); info4.Name = "Fire Burning ROM"; info4.Author = "The CD Factory"; info4.IconPath = @"img/CDBurn.png"; result.Add(info4); ApplicationInfo info5 = new ApplicationInfo(); info5.Name = "Fav Explorer"; info5.Author = "Star Factory"; info5.IconPath = @"img/favorites.png"; result.Add(info5); ApplicationInfo info6 = new ApplicationInfo(); info6.Name = "IE Fox"; info6.Author = "Open Org"; info6.IconPath = @"img/Connected.png"; result.Add(info6); ApplicationInfo info7 = new ApplicationInfo(); info7.Name = "Charting"; info7.Author = "AA-AZ inc"; info7.IconPath = @"img/ChartDot.png"; result.Add(info7); ApplicationInfo info8 = new ApplicationInfo(); info8.Name = "SuperPlay"; info8.Author = "EB Games"; info8.IconPath = @"img/Games.png"; result.Add(info8); return result; } 
} 

然后需要定义ListBoxes对于符合的ItemTemplates。我同样启动拖动ListBoxItems和允许拖动每一个ListBoxes

<Grid x:Name="LayoutRoot" Background="White"> <Grid.Resources> <Style TargetType="ListBoxItem"> <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True"></Setter> </Style> <DataTemplate x:Key="ApplicationTemplate"> <StackPanel Orientation="Horizontal"> <Image Source="{Binding IconPath}"/> <TextBlock Margin="5" Text="{Binding Name}" VerticalAlignment="Center"></TextBlock> </StackPanel> </DataTemplate> </Grid.Resources> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <ListBox x:Name="ApplicationList" ItemTemplate="{StaticResource ApplicationTemplate}" AllowDrop="True"/> <ListBox x:Name="MyAppList" Background="Gray" Grid.Column="1"   ItemTemplate="{StaticResource ApplicationTemplate}" AllowDrop="True"/> 
</Grid> 

之后我们需要设置控件的ItemSource:

ApplicationList.ItemsSource = ApplicationInfo.GenerateApplicationInfos(); 
MyAppList.ItemsSource = new ObservableCollection<ApplicationInfo>(); 

附加拖动处理事件

DragDropManager.AddDragInitializeHandler(ApplicationList, OnDragInitialize); 
DragDropManager.AddDragInitializeHandler(MyAppList, OnDragInitialize); DragDropManager.AddGiveFeedbackHandler(ApplicationList, OnGiveFeedback); 
DragDropManager.AddGiveFeedbackHandler(MyAppList, OnGiveFeedback); DragDropManager.AddDragDropCompletedHandler(ApplicationList, OnDragCompleted); 
DragDropManager.AddDragDropCompletedHandler(MyAppList, OnDragCompleted); DragDropManager.AddDropHandler(ApplicationList, OnDrop); 
DragDropManager.AddDropHandler(MyAppList, OnDrop);   

然后在DraInitialize定义数据当拖动后,同时呈现。同样设置了DragDropEffects到所有允许拖动的场景

private void OnDragInitialize(object sender, DragInitializeEventArgs args) 
{ args.AllowedEffects = DragDropEffects.All; var payload = DragDropPayloadManager.GeneratePayload(null); var data = ((FrameworkElement)args.OriginalSource).DataContext; payload.SetData("DragData", data); args.Data = payload; args.DragVisual = new ContentControl { Content = data, ContentTemplate = LayoutRoot.Resources["ApplicationTemplate"] as DataTemplate }; 
} 

同样设置鼠标光标为箭头:
 

private void OnGiveFeedback(object sender, Telerik.Windows.DragDrop.GiveFeedbackEventArgs args) 
{ args.SetCursor(Cursors.Arrow); args.Handled = true; 
} 

最后添加逻辑,将在拖动后允许完成操作:
 

private void OnDrop(object sender, Telerik.Windows.DragDrop.DragEventArgs args) 
{ var data = ((DataObject)args.Data).GetData("DragData"); ((IList)(sender as ListBox).ItemsSource).Add(data); 
} public void OnDragCompleted(object sender, Telerik.Windows.DragDrop.DragDropCompletedEventArgs args) 
{ var data = DragDropPayloadManager.GetDataFromObject(args.Data, "DragData"); ((IList)(sender as ListBox).ItemsSource).Remove(data); 
} 

拖动如下ListBoxes

http://www.khdw.cn/news/61048.html

相关文章:

  • 做网站加班多吗什么是关键词排名优化
  • 山东网站空间外贸建站
  • 淄博网站关键字优化灰色词快速排名方法
  • 浪网站制作杭州推广平台有哪些
  • 网站后期维护是做什么做seo有什么好处
  • 网站建设大约需要多少钱seo模板建站
  • 梅河口做网站的公司廊坊seo管理
  • skype网站在线客服网络营销ppt怎么做
  • wordpress 登录代码如何做好网站推广优化
  • 江津网站建设国内新闻最新消息
  • 做旅游网站的优势互联网广告
  • dede模板分为 网站建设好吗百度登录
  • 购物展示网站开发的背景郑州seo竞价
  • 龙华营销型网站建设公司营销推广
  • 小程序模板源下载南京百度网站快速优化
  • 做网站月入1000东莞关键词优化软件
  • 企业网站建设大概的费用网站制作专业
  • 南京电信网站空间扩容黄页网站推广效果
  • 网站建设 云计算上海百度竞价点击软件
  • 华大集团 做网站百度关键词seo排名优化
  • 外贸网站vps服务器百度搜索风云榜单
  • 院校建设网站群的原因如何设置友情链接
  • 贵阳模板建站定制培训课程
  • 企业大黄页衡阳有实力seo优化
  • 做毕业论文需要哪些网站企业网站推广策划
  • 大连百度网站排名优化肇庆百度快照优化
  • 优化网站公司外包培训学校机构
  • 淮安网站制作设计世界新闻最新消息
  • 德庆网站建设公司青岛网络优化代理
  • 浙江网站建设网站优化首页关键词排名