<div class="col l6 m12 s12 display-card">
<a href="signup.html" target="_blank" class="nav-link">
<div class="card cardHover">
<div class="card-image waves-effect waves-block waves-light">
<img class="activator" src="img/test2.jpg" alt="image">
</div>
<div class="card-content">
<span class="card-title activator text-darken-4"> RoboTico <i class="material-icons right">build</i></span>
</div>
</div>
价格和价格必须是字符串,但每次从选择器更改项目时都必须计算
答案 0 :(得分:1)
将您的值存储为适当的类型 - 不要继续尝试从字符串中解析它们 - 这是低效的,只会导致问题
在Picker的Selected方法中,只需调用UpdatePrice()来更新价格
private double price;
public double Price )
get {
return price;
}
set {
price = value;
OnPropertyChanged("Price");
}
}
private UpdatePrice {
Price = Market / Average;
}