Click here to Skip to main content
14,038,195 members

Silverlight / WPF

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder16-Jul-09 3:09
adminChris Maunder16-Jul-09 3:09 
PinnedHow to get an answer to your question PinPopular
Chris Maunder16-Jul-09 3:05
adminChris Maunder16-Jul-09 3:05 
QuestionBinding "SelectedItems" of a Listbox Pin
Jayme6524-Mar-19 1:15
memberJayme6524-Mar-19 1:15 
AnswerRe: Binding "SelectedItems" of a Listbox Pin
Gerry Schmitz24-Mar-19 6:15
mveGerry Schmitz24-Mar-19 6:15 
QuestionMicrosoft Documentation Pin
RichardChiles8-Mar-19 12:41
memberRichardChiles8-Mar-19 12:41 
AnswerRe: Microsoft Documentation Pin
Richard Deeming8-Mar-19 13:35
mveRichard Deeming8-Mar-19 13:35 
GeneralRe: Microsoft Documentation Pin
RichardChiles8-Mar-19 13:46
memberRichardChiles8-Mar-19 13:46 
GeneralRe: Microsoft Documentation Pin
Richard Deeming11-Mar-19 9:03
mveRichard Deeming11-Mar-19 9:03 
QuestionPlot LineSeries with out point Markers. Pin
RichardChiles8-Mar-19 12:39
memberRichardChiles8-Mar-19 12:39 
Questiondynamic tabitems with dynamic buttons in each tabitem Pin
siebren beens4-Mar-19 1:47
membersiebren beens4-Mar-19 1:47 
AnswerRe: dynamic tabitems with dynamic buttons in each tabitem Pin
Super Lloyd6-Mar-19 12:18
memberSuper Lloyd6-Mar-19 12:18 
QuestionEnum Filtering Pin
Kevin Marois27-Feb-19 12:58
professionalKevin Marois27-Feb-19 12:58 
AnswerRe: Enum Filtering Pin
Richard Deeming28-Feb-19 1:28
mveRichard Deeming28-Feb-19 1:28 
GeneralRe: Enum Filtering Pin
Kevin Marois28-Feb-19 4:13
professionalKevin Marois28-Feb-19 4:13 
QuestionListBox with Hyperlinks Problem Pin
Kevin Marois24-Feb-19 8:41
professionalKevin Marois24-Feb-19 8:41 
I have a listbox that is used for the user to either drag a file into or select via the Open File dialog.

The files in the list are displayed as hyperliks. Here's my XAML
<ListBox Grid.Row="1" 

            x:Name="filesBox"

            AllowDrop="True"

            Grid.Column="2"

            BorderBrush="SteelBlue"

            BorderThickness="1"

            VerticalAlignment="Stretch"

            ItemsSource="{Binding Attachments}"

            SelectedItem="{Binding SelectedAttachment}"

            Margin="2"

            Drop="ListBox_Drop">

<pre>
<ListBox.ItemTemplate>
    <DataTemplate>

        <TextBlock FontSize="14">
            <Hyperlink>
                <TextBlock Text="{Binding FileName}"/>
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <i:InvokeCommandAction Command="{Binding ElementName=attachmentView, Path=DataContext.OpenFileCommand}"

                                                    CommandParameter="{Binding }"/>
                            </i:EventTrigger>
                            <i:EventTrigger EventName="ListBox_Drop">
                                <i:InvokeCommandAction Command="{Binding ElementName=attachmentView, Path=DataContext.DragDropCommand}"

                                                        CommandParameter="{Binding }"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                </Hyperlink>
            </TextBlock>
    </DataTemplate>
</ListBox.ItemTemplate>





The problem is that unless the listbox item is selected, the link doesn't work. If I click on the area around the link to select the list item, then the link works.

I didn't poste the code behind because it works as long as the listbox item is selected. So, how do I select the listbox item when the link is clicked? Or somehow otherwise solve this?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: ListBox with Hyperlinks Problem Pin
Gerry Schmitz24-Feb-19 9:21
mveGerry Schmitz24-Feb-19 9:21 
GeneralRe: ListBox with Hyperlinks Problem Pin
Kevin Marois27-Feb-19 4:53
professionalKevin Marois27-Feb-19 4:53 
AnswerRe: ListBox with Hyperlinks Problem Pin
Richard Deeming27-Feb-19 8:00
mveRichard Deeming27-Feb-19 8:00 
QuestionHow to solve erroneous designer intellisense error report Pin
Super Lloyd26-Jan-19 19:29
memberSuper Lloyd26-Jan-19 19:29 
AnswerRe: How to solve erroneous designer intellisense error report Pin
Gerry Schmitz28-Jan-19 8:24
mveGerry Schmitz28-Jan-19 8:24 
GeneralRe: How to solve erroneous designer intellisense error report Pin
Super Lloyd28-Jan-19 14:42
memberSuper Lloyd28-Jan-19 14:42 
QuestionHave two controls fill the MainWindow and resize automatically Pin
Mc_Topaz16-Jan-19 4:14
memberMc_Topaz16-Jan-19 4:14 
AnswerRe: Have two controls fill the MainWindow and resize automatically Pin
Richard Deeming16-Jan-19 8:07
mveRichard Deeming16-Jan-19 8:07 
GeneralRe: Have two controls fill the MainWindow and resize automatically Pin
Mc_Topaz16-Jan-19 19:22
memberMc_Topaz16-Jan-19 19:22 
QuestionHyperlink Context Menu Pin
Kevin Marois9-Jan-19 15:30
professionalKevin Marois9-Jan-19 15:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web06 | 2.8.190425.1 | Last Updated 2 Apr 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid