我需要链接库栏项目的名称以在单独的文本框中同步以识别我在拖动什么等。
无论如何我可以从这里绑定内容文本:
<my:LibraryBar
HorizontalAlignment="Center"
Name="libcont"
VerticalAlignment="Top"
Background="{x:Null}"
ItemsSource="{Binding}"
Width="850"
Height="250"
>
<my:LibraryBar.ItemTemplate>
<DataTemplate>
<Viewbox Stretch="Fill" >
<Grid>
<Image Source="{Binding dev_img}" Height="144" Width="128" />
<Label Content="{Binding name}" />
</Grid>
</Viewbox>
</DataTemplate>
</my:LibraryBar.ItemTemplate>
</my:LibraryBar>
到我的文本框:
<TextBlock HorizontalAlignment="Left" Name="libcontvalue" VerticalAlignment="Top" />
我的VB代码:
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.Ace.Oledb.12.0; Data Source=|DataDirectory|\mvdata.accdb")
con.Open()
Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM devices", con)
Dim sdr As OleDbDataReader = cmd.ExecuteReader
libcont.ItemsSource = sdr