1
我有幾個ListBoxItems有一個圖像和一個文本框在他們點擊時突出顯示。我遇到的困難是如何使整個列表框項目doubleclick事件觸發到超鏈接。有人可以幫助我嗎?ListBoxItem和超鏈接
我一直在看這個,但它似乎是列表框作爲一個整體,而不是一個項目 - http://jarloo.com/code/wpf/wpf-listbox-doubleclick/。
這裏是我的listboxitems之一:
<ListBoxItem >
<Grid HorizontalAlignment="Stretch">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.RowSpan="2"
BorderBrush="LightGray" BorderThickness="0"
Margin="0,0,5,0">
<Image Source="/IDE;component/Resources/Images/test1.ico" Height="64" Width="64" />
</Border>
<TextBlock Text="Google.com"
FontWeight="Bold"
Grid.Column="2"
Margin="0,0,0,5"/>
<TextBlock TextWrapping="Wrap" Text="To learn more information doubleclick this box to open the website."
Grid.Column="2" Grid.Row="2"/>
</Grid>
<Line X1="0" Y1="0" X2="0" Y2="0" Stretch="Uniform"
Stroke="DarkGray"
VerticalAlignment="Bottom"/>
</Grid>
</ListBoxItem>
啊!感謝這一點。我一直試圖,但它不會允許它。乾杯 –
2011-04-13 21:34:12