[Unity] Binding to struct type
Posted: 28 Jul 2014, 19:44
Hi,
I was wondering if there is a way to bind View to a struct type. Say I have the class that contains struct type:
After setting DataContext to myShip, is it possible to reference parameters it in xaml like: Text="{Binding current_Resist.resist_Kinet } ?
I was wondering if there is a way to bind View to a struct type. Say I have the class that contains struct type:
Code: Select all
public SpaceShip myShip;
[Noesis.Extended]
public class SpaceShip: Noesis.BaseComponent {
private Damage_Resist _current_Resist;
public Damage_Resist current_Resist {
get { return _current_Resist; }
set {
if (_current_Resist != value) {
_current_Resist = value;
NotifyPropertyChanged("current_Resist");
}
}
}
}
public struct Damage_Resist {
public float resist_Kinet;
public float resist_Gravi;
public Damage_Resist (float r_kin, float r_gravi) {
resist_Kinet = r_kin;
resist_Gravi = r_gravi;
}