Click here to Skip to main content
15,881,588 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Kevin Marois9-Jul-18 16:23
professionalKevin Marois9-Jul-18 16:23 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Pete O'Hanlon10-Jul-18 7:08
mvePete O'Hanlon10-Jul-18 7:08 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Kevin Marois10-Jul-18 7:38
professionalKevin Marois10-Jul-18 7:38 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Pete O'Hanlon10-Jul-18 10:40
mvePete O'Hanlon10-Jul-18 10:40 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Kevin Marois10-Jul-18 11:21
professionalKevin Marois10-Jul-18 11:21 
GeneralRe: Bind TabItem ContexMenu Command To Window VM Pin
Kevin Marois15-Jul-18 16:08
professionalKevin Marois15-Jul-18 16:08 
AnswerRe: Bind TabItem ContexMenu Command To Window VM Pin
NaBian18-Sep-18 5:11
NaBian18-Sep-18 5:11 
QuestionListBox of Hyperlinks - Selected Item Pin
Kevin Marois6-Jul-18 19:37
professionalKevin Marois6-Jul-18 19:37 
I'm trying to create a listbox of hyperlinks. Here's the XAML:
<ListBox ItemsSource="{Binding QuickActions}"
            x:Name="quickItemList">

    <ListBox.ItemTemplate>
        <DataTemplate>

            <TextBlock Grid.Row="0" 
                        Margin="5">

                <Hyperlink x:Name="link">

                    <TextBlock Text="{Binding Caption}"/>

                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <i:InvokeCommandAction Command="{Binding ElementName=uc, Path=DataContext.QuickActionCommand}"
                                                    CommandParameter="{Binding ElementName=quickItemList, Path=SelectedItem}"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>

                </Hyperlink>

            </TextBlock>

        </DataTemplate>

    </ListBox.ItemTemplate>

</ListBox>
and the VM code:
private ICommand _QuickActionCommand;
public ICommand QuickActionCommand
{
    get
    {
        if (_QuickActionCommand == null)
            _QuickActionCommand = new RelayCommand<object>(p => QuickActionExecuted(p), p => QuickActionCanExecute());
        return _QuickActionCommand;
    }
}

private bool QuickActionCanExecute()
{
    return true;
}

private void QuickActionExecuted(QuickActionModel model)
{
}

When I click the link the parameter 'model' is null. The SelectedItem in the list is null. I know there's a way in the XAML to code this but I just can't get it right.

Anyone know how to do 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 of Hyperlinks - Selected Item Pin
Mycroft Holmes7-Jul-18 13:38
professionalMycroft Holmes7-Jul-18 13:38 
AnswerRe: ListBox of Hyperlinks - Selected Item Pin
Richard Deeming9-Jul-18 8:32
mveRichard Deeming9-Jul-18 8:32 
QuestionWhat is Silverlight / WPF??? Pin
Arnav12130-Jun-18 20:03
Arnav12130-Jun-18 20:03 
AnswerRe: What is Silverlight / WPF??? Pin
Richard MacCutchan30-Jun-18 20:50
mveRichard MacCutchan30-Jun-18 20:50 
QuestionNested Borders Mouse Over Pin
Kevin Marois14-Jun-18 7:44
professionalKevin Marois14-Jun-18 7:44 
AnswerRe: Nested Borders Mouse Over Pin
Richard Deeming14-Jun-18 9:35
mveRichard Deeming14-Jun-18 9:35 
GeneralRe: Nested Borders Mouse Over Pin
Kevin Marois14-Jun-18 10:51
professionalKevin Marois14-Jun-18 10:51 
QuestionWPF DataGrid uses a lot of memory, or is slow to scroll Pin
Leif Simon Goodwin14-Jun-18 5:16
Leif Simon Goodwin14-Jun-18 5:16 
AnswerRe: WPF DataGrid uses a lot of memory, or is slow to scroll Pin
Pete O'Hanlon14-Jun-18 5:21
mvePete O'Hanlon14-Jun-18 5:21 
GeneralRe: WPF DataGrid uses a lot of memory, or is slow to scroll Pin
Leif Simon Goodwin14-Jun-18 21:18
Leif Simon Goodwin14-Jun-18 21:18 
AnswerRe: WPF DataGrid uses a lot of memory, or is slow to scroll Pin
Gerry Schmitz14-Jun-18 8:01
mveGerry Schmitz14-Jun-18 8:01 
GeneralRe: WPF DataGrid uses a lot of memory, or is slow to scroll Pin
Leif Simon Goodwin14-Jun-18 21:59
Leif Simon Goodwin14-Jun-18 21:59 
GeneralRe: WPF DataGrid uses a lot of memory, or is slow to scroll Pin
Gerry Schmitz15-Jun-18 8:16
mveGerry Schmitz15-Jun-18 8:16 
GeneralRe: WPF DataGrid uses a lot of memory, or is slow to scroll Pin
Leif Simon Goodwin18-Jun-18 5:40
Leif Simon Goodwin18-Jun-18 5:40 
GeneralRe: WPF DataGrid uses a lot of memory, or is slow to scroll Pin
Gerry Schmitz18-Jun-18 7:04
mveGerry Schmitz18-Jun-18 7:04 
GeneralRe: WPF DataGrid uses a lot of memory, or is slow to scroll Pin
Mycroft Holmes19-Jun-18 13:10
professionalMycroft Holmes19-Jun-18 13:10 
GeneralRe: WPF DataGrid uses a lot of memory, or is slow to scroll Pin
Leif Simon Goodwin19-Jun-18 22:43
Leif Simon Goodwin19-Jun-18 22:43 

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.