0
Silverlight에서 Knockout.js로 바뀝니다.보기 모델에서 사용자 지정 개체 사용 넉 아웃
public class MyViewModel : ViewModel
{
private MyCustomClass custom = null;
public MyCustomClass Custom
{
get { return custom; }
set { custom = value;
NotifyPropertyChanged("MyCustomClass");
}
}
}
<TextBox Text="{Binding Path=Custom.PropertyName, Mode=TwoWay}" />
그러나, 나는 Knockout.js에서 같은 종류의 문제를 수행하는 방법을 잘 모르겠어요 : 나는 실버 라이트에 ViewModels를 만들 것이다 때, 나는 종종 이런 식으로 뭔가를 할 것이다. 현재, 내가 가진 :
<input type="text" data-bind="value:propertyName" />
var viewModel = {
custom: {
propertyName:""
}
}