文章列表
 
您正在查看 "Wpf" 分类下的文章

2009-10-17 2:11

转换绑定的数据
要在绑定期间转换数据,必须创建一个实现 IValueConverter 接口的类,其中包括 Convert 和 ConvertBack 方法
用 ValueConversionAttribute 属性来修饰此实现
C#
Object Convert(
Object value,
Type targetType,
Object parameter,
CultureInfo culture
)

参数
value
类型:System.Object

绑定源生成的值。

targetType
类型:System.Type

绑定目标属性的类型。

parameter
类型:System.Object

要使用的

 
2009-07-03 17:50
DispatcherTimer dTimer = new DispatcherTimer();
dTimer.Tick += new EventHandler(dTimer_Tick);
dTimer.Interval = new TimeSpan(0, 0, 1);
dTimer.Start();
 
2009-07-03 17:40
System.Drawing.Point mp = System.Windows.Forms.Control.MousePosition;
 
2008-06-26 23:51

由Page①和PageFunction<T> ②类来实现,②派生①。

由①调用②:
使用NavigationService.Navigate方法;

创建②:
XAML部分
<PageFunction
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:ObjectDesign;assembly=ObjectDesign"
    x:Class="Ba

 
2008-06-11 23:45

首先定义这个对象的大小:
<Setter Property="Width" Value="20"/>
<Setter Property="Height" Value="100"/>

定义背景:
<Setter Property="Background" Value="Red"/>

定义蒙板:
<Setter Property="OpacityMask" Value="{StaticResource q1}"/>

<DrawingBrush x:Key="q1">
        <DrawingBrush.Drawing>

 
2008-06-11 19:22

StreamGeometry XAML 属性用法

< 对象 属性="[fillRule] figureDescription[figureDescription]*" ... />

PathFigureCollection XAML 属性用法

< 对象 属性="figureDescription[figureDescription]*" ... />

大写是绝对值,小写是上一点的偏移量

M(坐标):开始点

L(坐标):用直线绘到的点

A (size rotationAngle isLargeArcFlag sweepDirectionFlag endPoint):椭圆弧线
size System.Windows.Size 弧线的 x 轴半径和 y 轴半径

 
2008-06-11 13:57

MatrixTransform中有个Matrix属性,包含是一个二维的变换矩阵。

M11

默认值:1.0

 
2008-06-11 13:04

移动:在2秒内从130的位置移动到180的位置。
<Rectangle Canvas.Left="130" Canvas.Top="170" Height="100" Name="rectangle1" Stroke="Black" Width="200" RadiusX="10" RadiusY="10">
            <Rectangle.RenderTransform>
              

 
2008-06-10 18:27

写在资源属性部分。

<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="FontFamily" Value="Comic Sans MS"/>
<Setter Property="FontSize" Value="14"/>
</Style>
只有TargetType时,是对所有TargetType值的类型都应用样式。

当指定x:Key后,可以在具体类型中引用:
<TextBlock Style="{StaticResource

 
2008-06-10 18:09

如果只是在窗口级使用:<Window.Resources>

如果是在应用程序级使用:<Application.Resources>

如果是要引用外部资源文件:
<Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
              

 
   
 
 
文章分类
 
 
Wpf(13)
 
Xaml(10)
 
Linq(1)
 
Wcf(1)
 
 
   
 
文章存档
 
     
 
最新文章评论
  

这个是怎么用呢我用的就是大天
   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu