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 ...
随机推荐
- 2017年上海金马五校程序设计竞赛:Problem A : STEED Cards (STL全排列函数)
Description Corn does not participate the STEED contest, but he is interested in the word "STEE ...
- HTML5之FileReader的简易使用
用来把文件读入内存,并且读取文件中的数据.FileReader接口提供了一个异步API,使用该API可以在浏览器主线程中异步访问文件系统,读取文件中的数据.FileReader接口提供了读取文件的方法 ...
- java List排序 顺序 倒序 随机
List list = new LinkedList(); for ( int i = 0 ; i < 9 ; i ++ ) { list.add( " a " + i); ...
- python用户登录,密码错误3次则锁定
需求: 1.输入用户名密码 2.认证成功后显示欢迎信息 3.输错三次后锁定 实现思路: 1.判断用户是否在黑名单,如果在黑名单提示账号锁定. 2.判断用户是否存在,如果不存在提示账号不存在. 3.判断 ...
- SUSE LINUX 11忘记密码的解决方法
忘记ROOT的密码 1.重新启动机器,在出现grub引导界面后,在启动linux的选项里加上init=/bin/bash,通过给内核传递init=/bin/bash参数使得OS在运行login程序之前 ...
- [Leetcode Week6]Linked List Cycle
Linked List Cycle 题解 原创文章,拒绝转载 题目来源:https://leetcode.com/problems/linked-list-cycle/description/ Des ...
- 使用腾讯云 GPU 学习深度学习系列之二:Tensorflow 简明原理【转】
转自:https://www.qcloud.com/community/article/598765?fromSource=gwzcw.117333.117333.117333 这是<使用腾讯云 ...
- 性能测试===Locust介绍
简述性能测试 提起性能测试,可能移动APP的从业人员会感觉比较混淆,因为在客户端(Android.iOS)中也有性能测试专项,主要涉及的是APP的启动时间.内存.包大小.帧率,流量等客户端相关的指标. ...
- pythontip题目解答
输出字典key 给你一字典a,如a={1:1,2:2,3:3},输出字典a的key,以','连接,如‘1,2,3'.要求key按照字典序升序排列(注意key可能是字符串). 例如:a={1:1,2:2 ...
- Mysql的碎片查看与处理
-- 每张表的大小 参考网址:http://www.oschina.net/question/12_3673 -- DATA_FREE 大于零表示有碎片 -- 在我们的项目中,生产环境一律采用独立的表 ...