- 博客(29)
- 资源 (15)
- 收藏
- 关注
原创 控件基类及属性
3个基类的继承层次结构:System.Windows.UIElementSystem.Windows.FrameworkElementSystem.Windows.Controls.ControlUIElement类常用属性:AllowDrop 获取或设置一个值,该值确定此 UIElement 是否可用作拖放操作的放置目标。CacheMode 获取或设置一个值,
2013-12-07 20:01:49
789
转载 C#中readonly关键字与const关键字的区别
const 的概念就是一个包含不能修改的值的变量。常数表达式是在编译时可被完全计算的表达式。因此不能从一个变量中提取的值来初始化常量。如果 const int a = b+1;b是一个变量,显然不能在编译时就计算出结果,所以常量是不可以用变量来初始化的。readonly 允许把一个字段设置成常量,但可以执行一些运算,可以确定它的初始值。因为 readonly 是在计算时执行的,当然它可
2013-12-02 11:08:01
607
原创 WPF之动画
线性关键帧、不连续关键帧动画: <PointAnimationUsingKeyFrames Storyboard.TargetName="ellipse" Storyboard.TargetProperty="Fill.
2013-12-01 20:31:49
1229
原创 WPF之绘图
点线: <Polyline Stroke="Blue" StrokeThickness="10" StrokeDashArray="1 2" Points="10,30 60,0 90,40
2013-11-30 09:20:08
802
原创 WPF之样式
自动样式: Customized Button Normal Content. <Button Padding="5" Margin="5" Style="{x:Null}" >A Normal Button More normal Content.
2013-11-29 22:01:28
576
原创 WPF之资源
<ImageBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:CustomResources}, ResourceId=SadTileBrush}" TileMode="Tile" ViewportUnits="Absolute" Viewport="0 0 32 32"
2013-11-28 23:03:37
637
原创 WPF之命令
Requery public partial class CustomCommand : System.Windows.Window { public CustomCommand() { InitializeComponent(); } private void RequeryCommand(
2013-11-28 22:23:41
754
原创 WPF之自定义控件
public class CommandSlider : Slider, ICommandSource { public CommandSlider() : base() { } //ICommand Interface Memembers //make Command a depe
2013-11-28 22:14:56
1024
转载 一个Metro风格的开源项目 MahApps.Metro
目录:Metro风格控件Metro主题 MahApps.Metro文档地址:http://mahapps.com/MahApps.Metro/源码地址:https://github.com/MahApps/MahApps.Metro在VS中可以装一个NuGet插件来下载MahApps.Metro.dll和MahApps.Metro.Resources.dll。M
2013-11-27 17:59:58
2869
原创 WPF之绑定
绑定字体: Calibri 元素之间绑定: <TextBlock Margin="10" Name="lblSampleText" FontSize="{Binding ElementName=sliderFont
2013-11-24 21:58:00
877
原创 WPF之菜单选择-反射
private void ButtonClick(object sender, RoutedEventArgs e) { // Get the current button. Button cmd = (Button)e.OriginalSource;
2013-11-24 21:49:04
1216
原创 WPF之窗体追踪
public partial class App : Application { private List documents = new List(); public List Documents { get { return documents; } set { docum
2013-11-24 21:41:57
824
原创 WPF之单例模式
public class Startup { [STAThread] public static void Main(string[] args) { SingleInstanceApplicationWrapper wrapper = new SingleInstanceApplication
2013-11-24 21:36:47
3741
原创 WPF之任务结束
public partial class App : Application { private bool unsavedData = false; public bool UnsavedData { get { return unsavedData; } set { unsavedData =
2013-11-24 21:32:03
708
原创 WPF之运行参数
public partial class App : Application { // The command-line argument is set through the Visual Studio // project properties (the Debug tab). private void App_Startup(objec
2013-11-24 21:29:01
688
原创 WPF之应用程序资源
Play private void cmdPlay_Click(object sender, RoutedEventArgs e) { img.Source = new BitmapImage(new Uri("images/winter.jpg", UriKind.Relati
2013-11-24 21:25:54
534
原创 WPF之检测鼠标位置
Capture the Mouse private void cmdCapture_Click(object sender, RoutedEventArgs e) { this.AddHandler( Mouse.LostMouseCaptureEvent,
2013-11-24 19:03:50
1258
原创 WPF之按键事件
Type here: <TextBox PreviewKeyDown="KeyEvent" KeyDown="KeyEvent" PreviewKeyUp="KeyEvent" KeyUp="KeyEvent" PreviewTextInput="TextInpu
2013-11-24 18:59:26
4162
原创 WPF之功能键检测
Check Current Shift State private void KeyEvent(object sender, KeyEventArgs e) { lblInfo.Text = "Modifiers: " + e.KeyboardDevice.Modifiers.To
2013-11-24 18:53:59
788
原创 WPF之鼠标拖放复制
Drag from this TextBox <Label Grid.Column="1" Padding="20" Background="LightGoldenrodYellow" VerticalAlignment="Center" HorizontalAlignment="Center" MouseDown="lblSource_Mo
2013-11-24 18:49:33
938
原创 WPF之路由事件
路由规则之冒泡规则:<Window x:Class="RoutedEvents.BubbledLabelClick" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title=
2013-11-24 18:45:19
848
原创 WPF之布局控件
StackPanel:堆栈面板 A Button Stack Button 1 Button 2 Button 3 Button 4 <CheckBox Name="chkVertical" Margin="10" HorizontalAlignment="Center" Checked="chkVertica
2013-11-24 18:26:22
1044
原创 WPF 自下定义多指针标尺
Window2.xaml: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Test"
2013-11-24 13:17:54
3500
原创 WPF美女时钟
改自网页版的美女时钟MainWindow.xaml:<Window x:Class="Clock.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/
2013-11-24 13:10:37
935
原创 WPF版会飞的小鸟
用Blend画界面、做动画,C#控件位移。MainWindow.xaml:<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xm
2013-11-24 13:06:16
822
原创 MVVM模式基于开源VLC解码器WPF万能视频播放器
采用VLC解码器,能播放市面上几乎所有格式影片。Models:SysInfo.csusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace MvvmPlayer.Models{ pu
2013-11-24 12:46:25
11004
3
Rust编程之道PDF
2019-05-05
CheckComboBox/RadioComboBox/ListBoxComboBox
2014-09-03
Exploring Expect
2010-03-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人