wpf一些例子
相关知识点:WPF - Adorner
WPF Diagram Designer
http://www.codeproject.com/Articles/484616/MVVM-Diagram-Designer
翻译好的
http://www.cnblogs.com/zhoujg/archive/2009/11/23/1608913.html
http://www.cnblogs.com/zhoujg/archive/2010/08/17/1801271.html
http://www.cnblogs.com/zhoujg/archive/2010/08/17/1801427.html
http://www.cnblogs.com/zhoujg/archive/2010/08/19/1801660.html
http://www.cnblogs.com/zhoujg/archive/2010/08/19/1801663.html
树状列表:
http://www.codeproject.com/Articles/30721/WPF-TreeListView-Control
Automatic Scrolling During Drag operation
http://www.codeproject.com/Articles/618014/Automatic-Scrolling-During-Drag-operation
MainWindow.xaml using System.Windows;
using System.Windows.Input; namespace AutoDragScrollingDemo
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
} public void EnableDragDemo(object sender, MouseEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
{
DragDrop.DoDragDrop(sender as DependencyObject, new object(), DragDropEffects.Move);
}
}
}
}
MainWindow.xaml
MainWindow.xml.cs using System.Windows;
using System.Windows.Input; namespace AutoDragScrollingDemo
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
} public void EnableDragDemo(object sender, MouseEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
{
DragDrop.DoDragDrop(sender as DependencyObject, new object(), DragDropEffects.Move);
}
}
}
}
MainWindow.xml.cs
AutoDragScrollingDemo.cs /*
*This work is being distributed under the The Code Project Open License (CPOL) (http://www.codeproject.com/info/cpol10.aspx) along with all restrictions placed therein.
*Attribution:
*1. Source Article: http://www.codeproject.com/Articles/618014/Automatic-Scrolling-During-Drag-operation
* Author: Amit Mittal (http://www.codeproject.com/Members/Amit_Mittal)
*/ using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media; namespace AutoDragScrollingDemo
{
public class AutoDragScrollingProvider
{
public static readonly DependencyProperty EnableAutomaticScrollingProperty =
DependencyProperty.RegisterAttached("EnableAutomaticScrolling", typeof(bool), typeof(AutoDragScrollingProvider), new PropertyMetadata(default(bool), OnEnableAutomaticScrollingChange)); public static bool GetEnableAutomaticScrolling(DependencyObject obj)
{
return (bool)obj.GetValue(EnableAutomaticScrollingProperty);
} public static void SetEnableAutomaticScrolling(DependencyObject obj, bool value)
{
obj.SetValue(EnableAutomaticScrollingProperty, value);
} public static readonly DependencyProperty UseLineScrollingForVerticalChange =
DependencyProperty.RegisterAttached("UseLineScrollingForVerticalChange", typeof(bool), typeof(AutoDragScrollingProvider), new PropertyMetadata(default(bool))); public static bool GetUseLineScrollingForVerticalChange(DependencyObject obj)
{
return (bool)obj.GetValue(UseLineScrollingForVerticalChange);
} public static void SetUseLineScrollingForVerticalChange(DependencyObject obj, bool value)
{
obj.SetValue(UseLineScrollingForVerticalChange, value);
} public static readonly DependencyProperty UseLineScrollingForHorizontalChangeProperty =
DependencyProperty.RegisterAttached("UseLineScrollingForHorizontalChange", typeof(bool), typeof(AutoDragScrollingProvider), new PropertyMetadata(default(bool))); public static bool GetUseLineScrollingForHorizontalChange(DependencyObject obj)
{
return (bool)obj.GetValue(UseLineScrollingForHorizontalChangeProperty);
} public static void SetUseLineScrollingForHorizontalChange(DependencyObject obj, bool value)
{
obj.SetValue(UseLineScrollingForHorizontalChangeProperty, value);
} private static readonly DependencyProperty _autoDragScrollingProviderProperty =
DependencyProperty.RegisterAttached("_AutoDragScrollingProvider", typeof(AutoDragScrollingProvider), typeof(AutoDragScrollingProvider), new PropertyMetadata(default(AutoDragScrollingProvider))); private static void OnEnableAutomaticScrollingChange(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var uiElement = d as UIElement;
if (uiElement != null)
{
if (true.Equals(e.NewValue))
{
Debug.Assert(uiElement.GetValue(_autoDragScrollingProviderProperty) == null);
var scrollingManager = new AutoDragScrollingProvider();
uiElement.PreviewDragEnter += scrollingManager.HandlePreviewDragMove;
uiElement.PreviewDragOver += scrollingManager.HandlePreviewDragMove;
uiElement.SetValue(_autoDragScrollingProviderProperty, scrollingManager);
}
else
{
var scrollingManager = uiElement.GetValue(_autoDragScrollingProviderProperty) as AutoDragScrollingProvider;
if (scrollingManager != null)
{
uiElement.PreviewDragEnter -= scrollingManager.HandlePreviewDragMove;
uiElement.PreviewDragOver -= scrollingManager.HandlePreviewDragMove;
uiElement.SetValue(_autoDragScrollingProviderProperty, null);
}
}
}
} //this caching is to avid some redundant steps but may prove troublesome
//if parent tree is dynamic which in most cases is not the case.
private IScrollInfo _scrollInfo;
private void HandlePreviewDragMove(object sender, DragEventArgs e)
{
if (_scrollInfo == null)
{
ScrollViewer parentScrollViewer = null;
var parent = e.OriginalSource as DependencyObject;
while (parent != null)
{
parentScrollViewer = parent as ScrollViewer;
if (parentScrollViewer != null)
{
break;
} parent = VisualTreeHelper.GetParent(parent);
} if (parentScrollViewer != null)
{
parent = e.OriginalSource as DependencyObject;
while (parent != null)
{
_scrollInfo = parent as IScrollInfo;
if (_scrollInfo != null && _scrollInfo.ScrollOwner == parentScrollViewer)
{
break;
}
_scrollInfo = null;
parent = VisualTreeHelper.GetParent(parent);
}
} Panel scrollablePanel = _scrollInfo as Panel;
if (scrollablePanel != null)
{
Orientation? orientation = null;
//Special case handling as stack panel does not support 'smooth scrolling' or in other words fractional offset changes
if (scrollablePanel is StackPanel)
{
orientation = (Orientation)scrollablePanel.GetValue(StackPanel.OrientationProperty);
}
//VirtualizingStackPanel behaves like StackPanel only if it is not hosted in an ItemsControl
else if (scrollablePanel is VirtualizingStackPanel && !scrollablePanel.IsItemsHost)
{
orientation = (Orientation)scrollablePanel.GetValue(VirtualizingStackPanel.OrientationProperty);
} if (orientation != null)
{
if (orientation == Orientation.Horizontal)
{
SetUseLineScrollingForHorizontalChange(scrollablePanel, true);
}
else
{
SetUseLineScrollingForVerticalChange(scrollablePanel, true);
}
}
}
} UIElement scrollable = _scrollInfo as UIElement;
if (scrollable != null)
{
var mousePos = e.GetPosition(scrollable); if (_scrollInfo.CanHorizontallyScroll)
{
var avgWidth = scrollable.RenderSize.Width / _scrollInfo.ViewportWidth; //translate to pixels
if (mousePos.X < )
{
if (GetUseLineScrollingForHorizontalChange(scrollable))
{
_scrollInfo.LineLeft();
}
else
{
var delta = (mousePos.X - ) / avgWidth; //translate back to original unit
_scrollInfo.SetHorizontalOffset(_scrollInfo.HorizontalOffset + delta);
}
}
else if (mousePos.X > (scrollable.RenderSize.Width - ))
{
if (GetUseLineScrollingForHorizontalChange(scrollable))
{
_scrollInfo.LineRight();
}
else
{
var delta = (mousePos.X + - scrollable.RenderSize.Width) / avgWidth; //translate back to original unit
_scrollInfo.SetHorizontalOffset(_scrollInfo.HorizontalOffset + delta);
}
}
} if (_scrollInfo.CanVerticallyScroll)
{
var avgHeight = scrollable.RenderSize.Height / _scrollInfo.ViewportHeight; //translate to pixels
if (mousePos.Y < )
{
if (GetUseLineScrollingForVerticalChange(scrollable))
{
_scrollInfo.LineUp();
}
else
{
var delta = (mousePos.Y - ) / avgHeight; //translate back to original unit
_scrollInfo.SetVerticalOffset(_scrollInfo.VerticalOffset + delta);
}
}
else if (mousePos.Y > (scrollable.RenderSize.Height - ))
{
if (GetUseLineScrollingForVerticalChange(scrollable))
{
_scrollInfo.LineDown();
}
else
{
var delta = (mousePos.Y + - scrollable.RenderSize.Height) / avgHeight; //translate back to original unit
_scrollInfo.SetVerticalOffset(_scrollInfo.VerticalOffset + delta);
}
}
}
}
}
}
}
AutoDragScrollingDemo.cs
另外一个scrollviewer内容拖拽,自动滚动的例子
http://www.codeproject.com/Tips/635510/WPF-Drag-Drop-Auto-scroll
学习资料
http://drwpf.com/blog/2008/03/25/itemscontrol-i-is-for-item-container/
http://drwpf.com/blog/2008/07/20/itemscontrol-g-is-for-generator/
http://drwpf.com/blog/category/itemscontrol/
http://drwpf.com/blog/category/itemscontrol/
http://www.cnblogs.com/Kation/archive/2013/05/02/xaml-contentproperty-collection.html
Copy ui into image
http://www.cnblogs.com/gnielee/archive/2010/12/17/copy-wpf-ui-to-clipboard.html
Drag And Drop
http://blogs.msdn.com/b/llobo/archive/2006/12/08/drag-drop-library.aspx
Copy Item in Canvas and paste to self or another Canvas
http://www.cnblogs.com/DebugLZQ/archive/2013/05/06/3062409.html.
http://www.codeproject.com/Tips/82990/XAML-Serialization
https://msdn.microsoft.com/zh-cn/library/system.windows.markup.xamlreader%28v=vs.110%29.aspx
Copy Paste Item in Canvas with Undo Redo
namespace CopyAndPasteInCanvas { public partial class Window1 : Window { private Rectangle rect; private double top = ; private double left = ; private Stack<Shape> undoStack = new Stack<Shape>(); private Stack<Shape> redoStack = new Stack<Shape>(); public Window1() { InitializeComponent(); CommandBinding pasteCmdBinding = new CommandBinding(); pasteCmdBinding.Command = ApplicationCommands.Paste; pasteCmdBinding.Executed += pasteCmdBinding_Executed; pasteCmdBinding.CanExecute += pasteCmdBinding_CanExecute; this.CommandBindings.Add(pasteCmdBinding); CommandBinding copyCmdBinding = new CommandBinding(); copyCmdBinding.Command = ApplicationCommands.Copy; copyCmdBinding.Executed += copyCmdBinding_Executed; copyCmdBinding.CanExecute += copyCmdBinding_CanExecute; this.CommandBindings.Add(copyCmdBinding); CommandBinding undoCmdBinding = new CommandBinding(); undoCmdBinding.Command = ApplicationCommands.Undo; undoCmdBinding.CanExecute += undoCmdBinding_CanExecute; undoCmdBinding.Executed += undoCmdBinding_Executed; this.CommandBindings.Add(undoCmdBinding); CommandBinding redoCmdBinding = new CommandBinding(); redoCmdBinding.Command = ApplicationCommands.Redo; redoCmdBinding.CanExecute += redoCmdBinding_CanExecute; redoCmdBinding.Executed += redoCmdBinding_Executed; this.CommandBindings.Add(redoCmdBinding); rect = new Rectangle(); rect.Width = ; rect.Height = ; rect.Fill = Brushes.Red; } private void undoCmdBinding_Executed(object sender, ExecutedRoutedEventArgs e) { Shape shape = undoStack.Pop(); RemoveShape(shape); } private void undoCmdBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = undoStack.Count > ; } private void redoCmdBinding_Executed(object sender, ExecutedRoutedEventArgs e) { Shape shape = redoStack.Pop(); AddShape(shape); } private void redoCmdBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = redoStack.Count > ; } private void pasteCmdBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = Clipboard.ContainsText(TextDataFormat.Xaml); } private void copyCmdBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = true; } private void copyCmdBinding_Executed(object sender, ExecutedRoutedEventArgs e) { string xaml = XamlWriter.Save(rect); Clipboard.SetText(xaml, TextDataFormat.Xaml); } private void pasteCmdBinding_Executed(object sender, ExecutedRoutedEventArgs e) { string xaml = Clipboard.GetText(TextDataFormat.Xaml); if (xaml != null) { using (MemoryStream stream = new MemoryStream(xaml.Length)) { using (StreamWriter sw = new StreamWriter(stream)) { sw.Write(xaml); sw.Flush(); stream.Seek(, SeekOrigin.Begin); Shape shape = XamlReader.Load(stream) as Shape; AddShape(shape); } } } } private void AddShape(Shape shape) { Canvas.SetLeft(shape, left); Canvas.SetTop(shape, top); top += ; left += ; drawingCanvas.Children.Add(shape); undoStack.Push(shape); } private void RemoveShape(Shape shape) { top -= ; left -= ; Canvas.SetLeft(shape, left); Canvas.SetTop(shape, top); drawingCanvas.Children.Remove(shape); redoStack.Push(shape); } } }
Copy And Paste In Canvas for undo and redo operation
copy paste with out undo redo
<Window x:Class="CopyAndPasteInCanvas.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="400" Width="600"> <Grid> <Canvas Name="drawingCanvas"/> </Grid> </Window>
窗体
namespace CopyAndPasteInCanvas { public partial class Window1 : Window { private Rectangle rect; private double top = ; private double left = ; public Window1() { InitializeComponent(); CommandBinding pasteCmdBinding = new CommandBinding(); pasteCmdBinding.Command = ApplicationCommands.Paste; pasteCmdBinding.Executed += pasteCmdBinding_Executed; pasteCmdBinding.CanExecute += pasteCmdBinding_CanExecute; this.CommandBindings.Add(pasteCmdBinding); CommandBinding copyCmdBinding = new CommandBinding(); copyCmdBinding.Command = ApplicationCommands.Copy; copyCmdBinding.Executed += copyCmdBinding_Executed; copyCmdBinding.CanExecute += copyCmdBinding_CanExecute; this.CommandBindings.Add(copyCmdBinding); rect = new Rectangle(); rect.Width = ; rect.Height = ; rect.Fill = Brushes.Red; } private void pasteCmdBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = Clipboard.ContainsText(TextDataFormat.Xaml); } private void copyCmdBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = true; } private void copyCmdBinding_Executed(object sender, ExecutedRoutedEventArgs e) { string xaml = XamlWriter.Save(rect); Clipboard.SetText(xaml, TextDataFormat.Xaml); } private void pasteCmdBinding_Executed(object sender, ExecutedRoutedEventArgs e) { string xaml = Clipboard.GetText(TextDataFormat.Xaml); if (xaml != null) { using (MemoryStream stream = new MemoryStream(xaml.Length)) { using (StreamWriter sw = new StreamWriter(stream)) { sw.Write(xaml); sw.Flush(); stream.Seek(, SeekOrigin.Begin); Shape shape = XamlReader.Load(stream) as Shape; Canvas.SetLeft(shape, left); Canvas.SetTop(shape, top); top += ; left += ; drawingCanvas.Children.Add(shape); } } } } } }
Code Behind
Automated Undo/Redo library based on C# Generics in .NET framework
http://www.codeproject.com/Articles/19550/Automated-Undo-Redo-library-Csharp-Generics-NET-C
收费控件
https://www.devexpress.com/Products/NET/Controls/WPF/Grid/
http://xceed.com/Index.aspx?Lang=EN-CA
免费UI设计工具
http://download.cnet.com/Indigo-Studio/3000-2247_4-75851417.html
ObservableCollection and CollectionChanged Event
http://stackoverflow.com/questions/3042179/observablecollection-and-collectionchanged-event
public class RangeObservableCollection<T> : ObservableCollection<T>
{
private bool surpressEvents = false; public void AddRange(IEnumerable<T> items)
{
surpressEvents = true;
foreach (var item in items)
{
base.Add(item);
}
this.surpressEvents = false;
this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, items.ToList())); } protected override void OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
if (!this.surpressEvents)
{
base.OnCollectionChanged(e);
}
}
}
private RangeObservableCollection<InventoryBTO> _inventoryRecords;
public RangeObservableCollection<InventoryBTO> InventoryRecords
{
get { return _inventoryRecords; }
set { _inventoryRecords = value; }
} private InventoryBTO _selectedRecord;
public InventoryBTO SelectedRecord
{
get { return _selectedRecord; }
set
{
if (_selectedRecord != value)
{
_selectedRecord = value;
OnPropertyChanged(new PropertyChangedEventArgs("SelectedRecord"));
}
}
} public InventoryViewModel()
{
if (_inventoryRecords == null)
{
InventoryRecords = new ObservableCollection<InventoryBTO>();
this.InventoryRecords.CollectionChanged += new NotifyCollectionChangedEventHandler(InventoryRecords_CollectionChanged);
} this.InventoryRecords.AddRange(InventoryListBTO.GetAllInventoryRecords());
} void InventoryRecords_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
//e.NewItems will be an IList of all the items that were added in the AddRange method...
}
To determine whether the ScrollBar is clicked or not
<Grid>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden" Name="myScrollViewer"
PreviewMouseDown="myScrollViewer_PreviewMouseDown"> <StackPanel Name="imgStackPnl" Orientation="Horizontal">
<Image Source="1.jpg" Width="100" Margin="0,10"/>
<Image Source="2.jpg" Width="100" Margin="0,10"/>
<Image Source="3.jpg" Width="100"/>
</StackPanel> </ScrollViewer> </Grid>
private void myScrollViewer_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
object original = e.OriginalSource; if (!original.GetType().Equals(typeof(ScrollViewer)))
{
if (original.GetType().Equals(typeof(Image)))
{
Console.WriteLine("image is clicked");
}
else if (FindVisualParent<ScrollBar>(original as DependencyObject) != null)
{
Console.WriteLine("scroll bar is clicked");
} }
} private parentItem FindVisualParent<parentItem>(DependencyObject obj) where parentItem:DependencyObject
{
DependencyObject parent = VisualTreeHelper.GetParent(obj);
while (parent!=null && !parent.GetType().Equals(typeof(parentItem)))
{
parent = VisualTreeHelper.GetParent(parent);
}
return parent as parentItem;
}
二叉树的例子
http://visualstudiogallery.msdn.microsoft.com/60297607-5fd4-4da4-97e1-3715e90c1a23/
Interaction design 交互式设计
https://en.wikipedia.org/wiki/Interaction_design
用户体验
http://baike.baidu.com/subview/274884/5077647.htm
交互设计师
http://baike.baidu.com/view/2316574.htm
用户体验设计
http://baike.baidu.com/view/1365273.htm
交互设计
http://baike.baidu.com/view/426920.htm
Copy Paste Image Example
http://files.cnblogs.com/files/CodingArt/WpfApplication1.zip
WPF: MultiBinding and IMultiValueConverter
http://blog.csainty.com/2009/12/wpf-multibinding-and.html
public class DataClass
{
public string FirstName { get; set; } public string Surname { get; set; }
} public class NameMultiValueConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
return String.Format("{0} {1}", values[], values[]);
}
} <Window xmlns:local="clr-namespace:BlogIMultiValueConverter">
<Window.Resources>
<local:NameMultiValueConverter x:Key="NameMultiValueConverter" />
</Window.Resources>
<Grid>
<TextBox Text="{Binding Path=FirstName, UpdateSourceTrigger=PropertyChanged}" />
<TextBox Text="{Binding Path=Surname, UpdateSourceTrigger=PropertyChanged}" />
<TextBlock>
<TextBlock.Text>
<MultiBinding Converter="{StaticResource MultiValueConverter}">
<Binding Path="FirstName" />
<Binding Path="Surname" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</Grid>
</Window>
Combobox 下拉框 是 datagrid
http://www.nullskull.com/a/1428/wpf-datagrid-as-combobox-dropdown-part-2.aspx
http://www.codeproject.com/Articles/43074/WPF-Custom-ComboBox
Material Design in XAML Toolkit
DataGrid
下面代码中,按下tab键后,焦点从txt1,直接跳转到txt2:
<Windows.Resources>
<Style x:Key="cellstyle" TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource MetroDataGridCell}">
<Setter Property="KeyboardNavigation.IsTabStop" Value="False"/>
</Style>
</Windows.Resources> <DataGrid CellStyle="{StaticResource cellstyle}">
<DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox x:Name="txt1"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox x:Name="txt1"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
https://social.msdn.microsoft.com/Forums/en-US/5f17c332-673c-43ed-a818-67bd9429400d/wpf-datagrid-datagridtemplatecolumn-tab-focus-issue?forum=wpf
To be continued...
wpf一些例子的更多相关文章
- WPF 触发器例子
WPF的触发器很强大,这里简单附上触发器的一个小例子,分别用XMAL和CS代码来实现一个功能,鼠标悬停在button上时改变字体颜色 1.XMAL代码如下: <Window x:Class=&q ...
- WPF比较两个随机数大小写,利用MVVM思想实现
MVVM模式是把表现层和业务层完全分离,所以这里就使用MVVM制作一个极其简单的WPF的例子: 先看看最终图:
- 带你一起Piu Piu Piu~
单刀直入,今天要讲的是自己写的一个WPF动画例子.我们在看下最终效果~ 最近在重看WPF编程宝典2010,在练习第15章动画性能例子时有了些想法.原始例子如下: 原始例子(打包了整个15章的) 它是 ...
- .NET插件技术-应用程序热升级
今天说一说.NET 中的插件技术,即 应用程序热升级.在很多情况下.我们希望用户对应用程序的升级是无感知的,并且尽可能不打断用户操作的. 虽然在Web 或者 WebAPI上,由于多点的存在可以逐个停用 ...
- C#用户自定义控件(含源代码)-透明文本框
using System; using System.Collections; using System.ComponentModel; using System.Drawing; using Sys ...
- .net技术栈转型心路历程分享
一.概要 本篇文章针对的是,长年写客户端(WPF/winfrom/delphi)的小伙伴想转后台写数据服务(asp.net mvc webapi , socket)或者想转其它技术,却又不知道改如何下 ...
- wpf值转换器IValueConverter例子
转载:http://blog.163.com/wangzhenguo2005@126/blog/static/37140526201085113430862/ 值转换器可以把一种类型转换成另一种类型. ...
- 【C#/WPF】ListView的MVVM例子,及禁止拖动ListView的头部Header
一个ListView的MVVM简单例子: <ListView ItemsSource="{Binding GoodsList}" Margin="0,10,0,10 ...
- 3ds Max建模,Blend设计,VS2008控制WPF的3D模型例子
原文:3ds Max建模,Blend设计,VS2008控制WPF的3D模型例子 3ds Max建模,Blend设计,VS2008控制WPF的3D模型例子 所用的软件 3ds Max 9.0,Mic ...
随机推荐
- Linux 开机自动挂载windows分区
blkid 查看 uuid如下ps:或者使用uuidgen <设备>查看具体设备的uuidreddusty@reddusty-X550JK:~$ sudo blkid[sudo] pass ...
- php使用curl模拟登录带验证码的网站
需求是这样的,需要登录带验证码的网站,获取数据,但是不可能人为一直去记录数据,想通过自动采集的方式进行,如下是试验出来的结果代码!有需要的可以参考下! <?php namespace Home\ ...
- html中给元素添加背景图片或者gif动图
添加背景图片有四种常用的方式,分别是: repeat 完全平铺 repeat-x 横向平铺 repeat-y 纵向平铺 no-repeat 不平铺 使用示例: <!DOC ...
- python多线程实现多任务
#转载请联系 1.什么是线程? 进程是操作系统分配程序执行资源的单位,而线程是进程的一个实体,是CPU调度和分配的单位.一个进程肯定有一个主线程,我们可以在一个进程里创建多个线程来实现多任务. --- ...
- Java中的new关键字和引用传参
先看看Java中如何使用new关键字创建一个对象的. [java] view plain copy public class Student { public String name; public ...
- Vuejs1.0学习
1.数据双向绑定 双向绑定以后,表单中数据的改变会同步改变H2中的输出 2.v-show 内容输入前: 内容输入后:隐藏提示,展示按钮 代码实现: 此处的v-show可以换成v-if,v-show是隐 ...
- Nginx 的安装配置入门(mac)
1.安装Nginx服务器: 执行命令 brew install nginx 安装完以后,可以在终端输出的信息里看到一些配置路径: /usr/local/etc/nginx/nginx.conf (配置 ...
- Codeforces 811 A. Vladik and Courtesy
A. Vladik and Courtesy time limit per test 2 seconds memory limit per test 256 megabytes input sta ...
- keyPoints的相关函数
cout<<"坐标:"<<keypoints1[i].pt; cout<<",邻域直径:"<<keypoints ...
- HDU 2050 折线分割平面(转)
折线分割平面 http://acm.hdu.edu.cn/showproblem.php?pid=2050 Problem Description 我们看到过很多直线分割平面的题目,今天的这个题目稍微 ...