【发布时间】:2015-01-01 00:02:18
【问题描述】:
我正在开发 Windows Phone 8.1 应用程序。如果我在 BitmapIcon 控件中设置 UriSource,例如:
<BitmapIcon Width="35" Height="35" Margin="0" RequestedTheme="Dark" UriSource="/Assets/Main/Operations/appbar.information.png">
一切正常,但如果我想将其设置为动态,我会看到仍然是空白字段。
我正在使用 MVVM Light。我的模型看起来像:
...
private string _icon;
public string Icon
{
get { return _icon; }
set { _icon = value; RaisePropertyChanged("Icon"); }
}
...
接下来我创建对象,添加到列表并在此基础上创建可观察的集合。其他字段正常工作,但不是这个:
<BitmapIcon Width="25" Height="25" Margin="0" UriSource="{Binding Icon, Mode=TwoWay}"/>
【问题讨论】:
标签: c# xaml mvvm windows-phone-8.1 mvvm-light