WPF——提高开发效率

1. 快速定义类的属性与函数

输入ctor+两次Tab键:定义类的构造函数

	public Student()
	{
	
	}

输入prop+两次Tab键:定义不带private字段的属性

	public int MyProperty { get; set; }

输入propfull+两次Tab键:定义带private字段的属性

	private int myVar;
	
	public int MyProperty
	{
	    get { return myVar; }
	    set { myVar = value; }
	}

输入propdp+两次Tab键:定义依赖属性

	public int MyProperty
	{
	    get { return (int)GetValue(MyPropertyProperty); }
	    set { SetValue(MyPropertyProperty, value); }
	}
	
	// Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
	public static readonly DependencyProperty MyPropertyProperty =
	    DependencyProperty.Register("MyProperty", typeof(int), typeof(ownerclass), new PropertyMetadata(0));

输入propa+两次Tab键:定义附加属性

     public static int GetMyProperty(DependencyObject obj)
     {
         return (int)obj.GetValue(MyPropertyProperty);
     }

     public static void SetMyProperty(DependencyObject obj, int value)
     {
         obj.SetValue(MyPropertyProperty, value);
     }

     // Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
     public static readonly DependencyProperty MyPropertyProperty =
         DependencyProperty.RegisterAttached("MyProperty", typeof(int), typeof(ownerclass), new PropertyMetadata(0));
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Microsoft's Windows Presentation Foundation (WPF) provides you with a development framework for building high-quality user experiences for the Windows operating system. It blends together rich content from a wide range of sources and allows you unparalleled access to the processing power of your Windows computer. Pro WPF 4.5 in C# provides a thorough, authoritative guide to how WPF really works. Packed with no-nonsense examples and practical advice you'll learn everything you need to know in order to use WPF in a professional setting. The book begins by building a firm foundation of elementary concepts, using your existing C# skills as a frame of reference, before moving on to discuss advanced concepts and demonstrate them in a hands-on way that emphasizes the time and effort savings that can be gained. What you’ll learn •Understand the fundamentals of WPF programming from XAML to controls and data flow. •Develop realistic application scenarios to see navigation, localization and deployment in action. •Explore the advanced user interface controls that WPF provides. •Learn to manage documents from within WPF: Text layout, printing, and document packaging are all covered. •Use graphics and multimedia to add punch to your applications Who this book is for This book is designed for developers encountering WPF for the first time in their professional lives. A working knowledge of C# and the basic architecture of .NET is helpful to follow the examples easily, but all concepts will be explained from the ground up. Table of Contents 01.Introducing WPF 02.XAML 03.Layout 04.Dependency Properties 05.Routed Events 06.Controls 07.The Application 08.Element Binding 09.Commands 10.Resources 11.Styles and Behaviors 12.Shapes, Brushes, and Transforms 13.Geometries and Drawings 14.Effects and Visuals 15.Animation Basics 16.Advanced Animation 17.Control Templates 18.Custom Elements 19.Data Binding 20.Formatting 21.Bound Data 22.Data Views 23.Lists, Trees, and Grids 24.Windows Pages and Navigation 25.Menus, Toolbars, and Ribbons 26. Sound and Video 27.3-D Drawing 28.Documents 29. Printing 30.Interacting with Windows Forms 31.Multithreading 32.The Add-in Model 33.ClickOnce Deployment ----------------------------------------------------------- Pro WPF 4th edition,喜欢的朋友请支持正版。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值