随笔分类 - WPF
摘要:xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml名称 种类x:Array标签扩展 x:ClassAttributex:ClassModifierAttributex:CodeXAML指令元素x:FieldModifierAttribute x:KeyAttributex:NameAttributex:Null标签扩展x:SharedAttributex:Static标签扩展x:SubclassAttributex:Type标签扩展x:TypeA...
阅读全文
摘要:决定深入学习下XAML,现在感觉所学的东西都是很零散,没有自己的东西使用Attribute=Value语法赋值,由于XAML的语法限制,Value只可能是一个字符串。这就引出2个问题如果一个类能使用XAML语言进行申明,并允许它的Property与XAML标签的Attribute互相映射,那就需要为这些Property准备适当的转换机制由于Value是一个字符串,所以其格式复杂程度有限,尽管可以再转换机制里包含一定的按格式解析字符串的功能,但这会让最终的XAML使用者头疼不已。因为他们不得不在没有编码辅助的情况下手写一个格式复杂的字符串以满足赋值要求。第一个问题的解决方案是使用TypeConv
阅读全文
摘要:总是记不住,写下,记录下来private void LayoutRoot_MouseMove(object sender, MouseEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) { this.DragMove(); } }
阅读全文
摘要:对于初学者,当想到要改变一个控件的模板时都是这样一套写下来的 [xml] <TextBox Grid.Row="0" Width="300" Height="26" FontFamily="YouYuan" FontWeight="Bold" FontSize="16" AllowDrop="False"> <TextBox.Template> <ControlTemplate> </ControlTemplate
阅读全文
摘要:之前我们所学的属性是这样设计的 [csharp] private Uri url; public Uri Url { get { return url; } set { url = value; } } [/csharp] 由于WPF中的依赖属性非常强大,所以它的属性应该这样设计 [csharp] public static readonly DependencyProperty url = DependencyProperty.Register("Imageurl", typeof(Uri), typeof(Pic), new PropertyMetadata(strin
阅读全文
摘要:WPF中的Mediaplayer就是强大呀,只要有歌曲链接就能播放 [csharp] public partial class MainWindow : Window { MediaPlayer player = new MediaPlayer(); public MainWindow() { InitializeComponent(); MusicUrl.Text = "<a href="http://zhangmenshiting2.baidu.com/data2/music/5213846/5213846.mp3?xcode=f4ff3ed1ddf627aa67
阅读全文
摘要:写点一般的小程序,没必要用SQL数据库,xml也能搞定,这个是我自己总结的,若有不足或错误的地方请见谅和提醒。 WPF里的xml有两种方式 细说第二种,首先是将xml文件作为资源载入 注意的是XPath这个家伙,我的xml文件是这样的,这里XPath要写的是xml的根,并且不能写成 XPath="S
阅读全文
摘要:暂时没时间整理,先把连接写下http://blog.csdn.net/tcjiaan/article/details/6997900动画控制http://developer.51cto.com/art/200912/173016.htm重叠控件 事件http://zwkufo.blog.163.com/blog/static/25882512010311027408/Design 4学习http://www.cnblogs.com/lonelyxmas/category/370274.html
阅读全文
摘要:纠结了一天了,也许是还对这个wpf有点陌生,想要执行一个关闭动画再真正关闭窗口,找到一87的方法,比之加个延迟让动画执行完好多了,原文在这http://www.cnblogs.com/Watson/archive/2012/05/27/2519896.htmlbool isclose = false; protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { base.OnClosing(e); if (!isclose) ...
阅读全文
摘要:WPF 字符转义下面是五个在XML文档中预定义好的实体: < < 小于号 > > 大于号 & & 和 ' ' 单引号 " " 双引号 实体必须以符号"&"开头,以符号";"结尾。
阅读全文