摘要:
http://msdn.microsoft.com/zh-cn/library/ms597484.aspx #region text public string Text { get { return (string)GetValue(TextProperty); } set { SetValue(TextProperty, value); } } //public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", // typeof(string), 阅读全文
摘要:
先上个示例 <ItemsControl Margin="10" ItemsSource="{Binding}" Name="itemsControl"><ItemsControl.Template> <ControlTemplate TargetType="{x:Type ItemsControl}"> <Border CornerRadius="5"> <ScrollViewer VerticalScrollBarVisibility=&q 阅读全文
摘要:
add textblockon ui , as bellow:<Grid><TextBlock Height="23" HorizontalAlignment="Left" Margin="16,18,0,0" Name="textBlock1" Text="TextBlock" VerticalAlignment="Top" /></Grid>add style for textBlock <Window.Resources> 阅读全文
摘要:
C# 调用C++的dll,通过DllImport方式。以下例子包含以下几种参数传递方式:传递string、Int、Int数组、结构体、结构体数组。比较懒,没写注释,呵呵,各位辛苦了。demo在这里C++ Dll 如下:// dllmain.cpp : Defines the entry point for the DLL application.#include "stdafx.h"#include <stdio.h>#include <tchar.h>BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_ 阅读全文
摘要:
重现步骤:1.写一个很简单的wpf程序,UI上有一个checkbox,运行起来。2.在桌面点击右键菜单--》Screen Resolution --》orientation 更改为 portrait,点击apply,然后Keep changes。试一试touch到 checkbox上面,会不会有效果。3.如果仍然可用,重复第二步,把orientation 改为landscape,点击apply,然后Keep changes。反复更改这个属性,在两个值之间切换。大约2次以后,会发现touch到checkbox上以后,checkbox不会被选中或者取消选中,也就是失效了。然后寻寻觅觅,发现点击其他 阅读全文
摘要:
最近纠结于wpf 多国语言处理的问题,先说说找到的以下几种方案。1.借用vc的处理方式,编译完了以后每个语言产生一个dll,分别放在语言文件夹里面,Wpf 使用dllImport调用win32 api中的loadstring方法提取MUI资源,然后赋值为ui。微软自己去判断该用哪个语言,不用自己操心。优点:可靠,毕竟那么多地方都这么干的。缺点:麻烦了点2. 微软给出的解决方案,地址如下:http://msdn.microsoft.com/zh-cn/library/ms788718.aspx其中里面有一句,让我很失望:用 XAML 编写 UI;避免在代码中创建 UI。当您使用 XAML 创建 阅读全文