저는 WPF에서 새로 왔으며 xaml에서 ObservableCollection으로 바인딩하려고합니다. 현재 내가 같은 일을 오전 : XAML에서ObservableCollection 목록에 데이터 바인딩 바인딩
: CS에서
<Grid Grid.Column="1">
<local:ProcessingStep DataContext="{Binding ProcessingSteps[0]}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
<Grid Grid.Column="2">
<local:ProcessingStep DataContext="{Binding ProcessingSteps[1]}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
<Grid Grid.Column="3">
<local:ProcessingStep DataContext="{Binding ProcessingSteps[2]}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
:
public ObservableCollection<ProcessingStepView> ProcessingSteps
{
get
{
return m_ProcessingSteps ??
(m_ProcessingSteps = new ObservableCollection<ProcessingStepViewl>
{
new ProcessingStepView("Step1"),
new ProcessingStepView("Step2"),
new ProcessingStepView("Step3")
});
}
}
어떻게 직접 WPF에 목록을 결합 할 수 있습니까? 예 : 100 단계가있는 경우 하나씩 수행하는 것이 좋지 않습니다.
항목을 어떻게 열로 정렬합니까? 그것들은 같은 너비입니까, 아니면 그냥 수평으로 쌓아 올리는 것입니까? – dkozl
가로로 쌓아두고 싶습니다 – olidev