저는 Wpf 세계에서 새로운 편이어서 MvvM 패턴을 사용함에 따라 몇 가지보기를 만들었고 모두 하나 이상의 ComboBox를 가지고 있습니다. Combo를 채우고 SelectedItem을 가져 오는 동일한 코드 행 (속성 작성, 채우기 및 다른 항목 가져 오기).Wpf Mvvm ComboBox
이 부분을 개선 할 수있는 프레임 워크가 있습니까? 또는 해킹/속임수 ???
이private Department defaultBranch;
public Department DefaultBranch
{
get
{
return this.defaultBranch;
}
set
{
if (this.defaultBranch != value)
{
this.defaultBranch = value;
this.OnPropertyChanged("DefaultBranch");
this.saveChangeCommand.RaiseCanExecuteChanged();
this.UserMessage = string.Empty;
}
}
}
private ObservableCollection<Department> departments;
public ObservableCollection<Department> Departments
{
get { return this.departments; }
set
{
if (this. departments!= value)
{
this. departments = value;
this.OnPropertyChanged("Departments");
}
}
}
이 같은 종류인가 ComboBox (예 : 응용 프로그램 전체에 흩어져있는 부서에 대해 여러 개의 콤보 상자가 있습니까?) 그런 경우 - 해당 마크 업 조각이 있고 ComboBox에서 상속 한 사용자 정의 컨트롤을 만들 수 있습니다 – Goblin
@Goblin, 하지만 나 wpf에서 컨트롤을 사용자 지정하려고 시도하고 그 winform's 세계 에서처럼 쉽지 않다는 것을 알게되었습니다. – 2Fast4YouBR