내 서버 측 앱 (TradeMarks & RetailStores)에 2 개의 모델이 있습니다. 각 RetailStore에는 상호 참조를위한 TradeMarkId 필드가 있습니다. 다음과 같이 내가 AutoGeneratingField에 필드를 잡아 모든 상표를 나열하는 콤보 상자에 의해 대체 클라이언트 측에Silverlight 4 - DataForm (AutoGeneratingField)의 RIA 서비스 DataField 헤더
Class RetailStore:
[Display(Order = 5, Name = "RetailStoreTradeMarkTitle", Description = "RetailStoreTradeMarkDescription", ResourceType = typeof(RegistrationDataResources))]
public int TradeMarkId { get; set; }
:
다음과 같이 내 DomainService 메타 데이터 모델에 은 내가 RetailStore (TradeMarkId 필드) 정의 if (e.PropertyName == "TradeMarkId")
{
ComboBox TradeMarkIdComboBox = new ComboBox { DisplayMemberPath = "TradeMarkName" };
Binding itemsSource = new Binding("TradeMarks") { Source = this.retailStoreDomainDataSource.DomainContext };
Binding selectedItem = new Binding("TradeMark") { Mode = BindingMode.TwoWay };
TradeMarkIdComboBox.SetBinding(ComboBox.ItemsSourceProperty, itemsSource);
TradeMarkIdComboBox.SetBinding(ComboBox.SelectedItemProperty, selectedItem);
DataField TradeMarkIdField = new DataField
{
Content = TradeMarkIdComboBox,
Label = e.Field.Label
};
e.Field = TradeMarkIdField;
}
바인딩은 모두 완벽하게 작동하지만 모델에서 정의한 "RetailStoreTradeMarkTitle"Description = "RetailStoreTradeMarkDescription"DisplayAttributes를 잃어 버렸습니다! 이 필드에 대한 유효성 검사를 잃었습니다.
내 질문에 내가 뭘 잘못하고 있니? 모델 확인 & 필드 헤더를 가져 오는 방법이 있습니까 ?? 사전에
Thnaks, WaMe