zoukankan      html  css  js  c++  java
  • Attached Property在Xaml中,使用Property Element的写法

      <DockPanel LastChildFill="False">
        <TextBox DockPanel.Dock="Bottom">Command: </TextBox>
        <Button>
          <Button.Content>Right Button</Button.Content>
          <DockPanel.Dock>Right</DockPanel.Dock>
        </Button>
      
      </DockPanel>


    看到了吗?假如把Attached Property, DockPanel.Dock使用Property Element来设置,而不是通过常规的XML 属性来赋值的话,是直接写在Element内部,并且不用使用Elememt作为前缀的(Button.DockPanel.Dock是错的!)

    这也就解释了,Behavior是如何Attach到WPF的Element上的:

    <Ellipse Canvas.Left="80" Canvas.Top="70" Fill="OrangeRed" Width="40" Height="70">
      <i:Interaction.Behaviors>
        <custom:DragInCanvasBehavior></custom:DragInCanvasBehavior>
      </i:Interaction.Behaviors>
    </Ellipse>
  • 相关阅读:
    ruby 类库组成
    ruby 数据类型Number
    ruby require的使用
    ruby $LOAD_PATH及类加载
    ruby编码说明
    RubyMine常用快捷键
    基础
    基础
    基础
    基础
  • 原文地址:https://www.cnblogs.com/puncha/p/3876997.html
Copyright © 2011-2022 走看看