Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf 将数据绑定到Listbox包含文本块的Listbox_Wpf_Xaml_Data Binding_Wpf Controls - Fatal编程技术网

Wpf 将数据绑定到Listbox包含文本块的Listbox

Wpf 将数据绑定到Listbox包含文本块的Listbox,wpf,xaml,data-binding,wpf-controls,Wpf,Xaml,Data Binding,Wpf Controls,我想将数据绑定到列表框。 Textblock将显示seprate字段。我怎么能做到? 请帮我解决这个问题/使用一个按钮使它看起来像这样 <ListBox Width="400" Margin="10" ItemsSource="{Binding myItems}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Tex

我想将数据绑定到列表框。 Textblock将显示seprate字段。我怎么能做到? 请帮我解决这个问题/

使用一个按钮使它看起来像这样

<ListBox Width="400" Margin="10" ItemsSource="{Binding myItems}">
   <ListBox.ItemTemplate>
     <DataTemplate>
       <StackPanel>
         <TextBlock Text="{Binding Path=MedicineName}" />
         <TextBlock Text="{Binding Path=ListBoxLetter}"/>
       </StackPanel>
     </DataTemplate>
   </ListBox.ItemTemplate>
 </ListBox>