มันเป็นไปได้ที่จะโหลดอีกข้อมูลของแม่แบบสำหรับกำหนดไว้คอลัมน์ใน WPF ข้อมูลของเส้นกริด?
ฉัน XAML ดูเหมือนนี้:
<DataGridTemplateColumn Header="Select">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox
HorizontalContentAlignment="Center"
Visibility="{Binding IsStarted}"
VerticalAlignment="Center"
IsChecked="{Binding IsStarted, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Command="{Binding DataContext.Checked,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
CommandParameter="{Binding}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
เป้าหมายอยู่ที่นี่คือโหลดแยกข้อมูลของต้นแบบเมื่อตอนที่ผูกมัดหรอ IsStarted
ตั้งค่าเพื่อปลอม,หรือจะพูดอีกอย่างตอนที่มองเห็นได้ถูกตั้งให้ปลอม.
ที่แรดประสงค์ที่นี่คือเมื่อบางอย่างปุ่มคือกระตุ้นซึ่งจะตั้งค่าค่าตรรกะว่า"ผิด"อีกข้อมูลของต้นแบบจะต้องเห็นเรื่องนี้เป็นของคอลัมน์แทนที่จะอยู่ในปัจจุบันที่มีอยู่รายการ.
เป็นตัวอย่างที่ตาม XAML ควรจะแสดงครั้งตรรกะที่จะตั้งค่าปลอมหลังจากการประหารชีวิตของปุ่ม
<TextBlock Visibility="{Binding IsTrue}" Text="Hello" />
นี่มันเป็นไปได้?