添加本地类命名空间到xaml文件

mac2022-06-30  23

xmlns:local="clr-namespace:你的命名空间"

local 可以随便改 比如 my

比如你的类 实现了IValueConverter接口

调用:

定义key

    <Grid.Resources>           <local:DateFormatter x:Key="FormatConverter" />        </Grid.Resources>

 

调用

  <TextBlock Text="{Binding Path=ReleaseDate, Mode=OneWay,                        Converter={StaticResource FormatConverter},                         ConverterParameter=\{0:d\}}" />

转载于:https://www.cnblogs.com/LYunF/archive/2012/11/02/2751356.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)