我将一个应用程序从 wp8 传递到 win8,文本块中的所有绑定都失败了,我不明白为什么。示例文本块:
<TextBlock Grid.Row="1" Height="Auto" TextAlignment="Left" Text="{Binding SimulClassement,Converter={StaticResource ClassementConverter}}" Visibility="{Binding VisibilityResultat}" Foreground="#FFFF7901" HorizontalAlignment="Left" VerticalAlignment="Top"/>
我的财产是这样的:
private string _simulClassement;
public string SimulClassement
{
get { return _simulClassement; }
set
{
_simulClassement = value;
RaisePropertyChanged("SimulClassement");
}
}
SimulClassement 属性已在我的视图模型中设置,但我什么都没有看到...我忘记了什么???
问候。
编辑:
public class ClassementConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
if (value != null)
{
return " Classement : " + value;
}
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
我将此属性设置为:SimulClassement = GetSimulClassement(CalculPoints(CalculNombreVictoire(CalculVe2I(SelectedProfile.Classement), SelectedProfile.Classement)), SelectedProfile.Classement, false);