【发布时间】:2016-12-26 01:52:48
【问题描述】:
我正在尝试更改 ContentPage 上的图像源属性。我正在使用绑定上下文来执行此操作。但是,即使我在模型视图中更改源,这也不会更新我视图中的图像。
UpdateMethod()
{
imageSource1 = imageSource[1];
}
public string ImageSource1
{
get
{
return imageSource1;
}
set
{
imageSource1 = value;
this.Notify("ImageSource1");
}
}
XAML:
<ContentView HorizontalOptions="Center" Grid.Row="0" >
<Image ClassId = "1" Source="{Binding ImageSource1}" BindingContextChanged="Handle_BindingContextChanged">
<Image.GestureRecognizers>
<TapGestureRecognizer Command="{Binding OnTapGestureRecognizerTappedCommand1}" NumberOfTapsRequired="1" />
</Image.GestureRecognizers>
</Image>
</ContentView>
【问题讨论】:
标签: c# image xaml xamarin xamarin.forms