0
첫째로 ListView
컨트롤 자체에 이것을 사용하고 있습니다 :각 GridViewColumn을 별도의 ObservableCollection에 바인딩하는 방법
ItemsSource="{Binding AllEffects}"
그러면 GridViewColumn
에 대한 개별 바인딩이 허용되지 않습니까?
AllEffects
나는 다른 2
ObservableCollection
을 가지고있다. 다른 2 개의
GridViewColumn
에 바인딩하고 싶다 :
public ObservableCollection<GPUSupportNode> GPUSupport { get; set; }
public ObservableCollection<CPUSupportNode> CPUSupport { get; set; }
public class CPUSupportNode
{
public bool IsSupported {get;set;}
}
GPUSupport/CPUSupport
에 GPUSupport/CPUSupport
을 연결하려고한다.
지금 당장 가지고 있습니다 :
<GridViewColumn
Width="Auto"
Header="GPU">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox
Margin="0"
HorizontalAlignment="Center"
IsChecked="{Binding GPUSupport, Mode=TwoWay}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
그러나 작동하지 않습니다. 이것이 가능한가?
감사합니다. 모든 ObservableCollections를 결합하려고하는 해킹처럼 보입니다. –
MVVM은 WPF에서 Databinding Scenerios를 활성화하고 모델에서 뷰 코드를 분리하기위한 표준 패턴입니다. GUI를 사용하지 않고도 GUI까지 모든 방법을 쉽게 테스트 할 수 있습니다. 다음은 MVVM에 대한 블로그입니다. http://houseofbilz.com/archives/2009/05/22/adventures-in-mvvm-model-view-viewmodel/ –