zoukankan      html  css  js  c++  java
  • Binding Relative 示例

    Binding to self :

    <TextBlock Height="23"   Name="textBlock4" Text="{Binding RelativeSource=
    {RelativeSource Mode=Self},Path=Name}" VerticalAlignment="Top" />

    Binding to Templatepartent:

    <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,141,0,0"  
    Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=Name,Converter={...}}"/>

    Or:

    <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,141,0,0"  
    Text="{TemplateBinding Path=Name}"/>

    Binding to Ancestor:

    <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,141,0,0"    Text="{Binding RelativeSource={RelativeSource 
    Mode=FindAncestor,AncestorType=ComboBox,AncestorLevel=2},Path=Name}"     VerticalAlignment="Top" />-->

    <Rectangle   x:Name="recIcon"    Grid.Row="0" FocusVisualStyle="{x:Null}"     Fill="{Binding DefaultImage,RelativeSource={RelativeSource  AncestorType={x:Type 
    local:IconButton}}}"  />-->

    Binding to PreviousData:

    <TextBlock  Text="{Binding   RelativeSource={RelativeSource Mode=PreviousData},Path=Name}"/>

  • 相关阅读:
    List,Set,Map初级学习
    String,StringBuffer,StringBuilder 的使用
    activity跳转
    JSON与List之间的转换
    子线程更新UI
    数据库查询关键字显示所有结果
    Java数据类型转换1
    git 操作
    MySql导出表结构
    springBoot双数据源配置
  • 原文地址:https://www.cnblogs.com/xiaokang088/p/2026749.html
Copyright © 2011-2022 走看看