WPF 枚举使用

时间:2015-02-03 19:12:43   收藏:0   阅读:443

1、model

class JX_Unit
{
public enum SumUnit
{
KW = 1,
L = 2,
Kt = 3,
}

}

 

2、viewModel

public string waterUnit {
get { return JX_Unit.SumUnit.Kt.ToString();
}
set { waterUnit = value; }
}

 

3、view

 

<TextBlock Text="{Binding waterUnit}" FontSize="15"/>

原文:http://www.cnblogs.com/hanjiaxu/p/4270719.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!