Click here to Skip to main content
15,887,477 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: WPF MVVM ListBox Basics Pin
SledgeHammer0123-Jun-11 9:55
SledgeHammer0123-Jun-11 9:55 
GeneralRe: WPF MVVM ListBox Basics Pin
Member 450279424-Jun-11 1:36
Member 450279424-Jun-11 1:36 
GeneralRe: WPF MVVM ListBox Basics Pin
SledgeHammer0124-Jun-11 4:59
SledgeHammer0124-Jun-11 4:59 
QuestionMVVM: TreeViewItem double click -> command? Pin
SledgeHammer0122-Jun-11 12:44
SledgeHammer0122-Jun-11 12:44 
AnswerRe: MVVM: TreeViewItem double click -> command? Pin
Pete O'Hanlon22-Jun-11 17:24
mvePete O'Hanlon22-Jun-11 17:24 
GeneralRe: MVVM: TreeViewItem double click -> command? Pin
SledgeHammer0122-Jun-11 17:38
SledgeHammer0122-Jun-11 17:38 
GeneralRe: MVVM: TreeViewItem double click -> command? Pin
Pete O'Hanlon22-Jun-11 21:09
mvePete O'Hanlon22-Jun-11 21:09 
GeneralRe: MVVM: TreeViewItem double click -> command? Pin
SledgeHammer0123-Jun-11 6:49
SledgeHammer0123-Jun-11 6:49 
Hmm... this doesn't actually work. Unless I'm missing something obvious.

<TreeView ItemsSource="{Binding StateCountyItems}" FocusVisualStyle="{x:Null}" BorderThickness="0,0,0,0">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Value}">
<TextBlock Text="{Binding Key}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction CommandName="Test" />
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBlock>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>

My ViewModel has:

public RelayCommand Test
{
get
{
if (_test == null)
_test = new RelayCommand(t);

return _test;
}
}

private void t()
{
}

With that XAML exactly, the Test getter is never even called. I changed CommandName to Command="{Binding ElementName=g, Path=DataContext.Test}"

g is the window that has its DataContext set... I'll of course clean up the names later lol... when I change it to that, NOW the Test getter is called, BUT void t() is never called when I double click.

any ideas?
GeneralRe: MVVM: TreeViewItem double click -> command? Pin
SledgeHammer0123-Jun-11 6:57
SledgeHammer0123-Jun-11 6:57 
GeneralRe: MVVM: TreeViewItem double click -> command? Pin
Pete O'Hanlon23-Jun-11 7:01
mvePete O'Hanlon23-Jun-11 7:01 
GeneralRe: MVVM: TreeViewItem double click -> command? Pin
SledgeHammer0123-Jun-11 7:13
SledgeHammer0123-Jun-11 7:13 
GeneralRe: MVVM: TreeViewItem double click -> command? Pin
Pete O'Hanlon23-Jun-11 7:14
mvePete O'Hanlon23-Jun-11 7:14 
GeneralRe: MVVM: TreeViewItem double click -> command? Pin
Mycroft Holmes23-Jun-11 12:04
professionalMycroft Holmes23-Jun-11 12:04 
GeneralRe: MVVM: TreeViewItem double click -> command? Pin
SledgeHammer0123-Jun-11 12:50
SledgeHammer0123-Jun-11 12:50 
GeneralRe: MVVM: TreeViewItem double click -> command? Pin
Mycroft Holmes23-Jun-11 14:47
professionalMycroft Holmes23-Jun-11 14:47 
GeneralRe: MVVM: TreeViewItem double click -> command? Pin
Pete O'Hanlon23-Jun-11 20:20
mvePete O'Hanlon23-Jun-11 20:20 
GeneralRe: MVVM: TreeViewItem double click -> command? Pin
Pete O'Hanlon23-Jun-11 20:19
mvePete O'Hanlon23-Jun-11 20:19 
Questionusing navigation pages in wpf Pin
zooom_921-Jun-11 19:12
zooom_921-Jun-11 19:12 
AnswerRe: using navigation pages in wpf Pin
Pete O'Hanlon21-Jun-11 21:28
mvePete O'Hanlon21-Jun-11 21:28 
QuestionWPF - resource site Pin
Simon_Whale21-Jun-11 11:52
Simon_Whale21-Jun-11 11:52 
AnswerRe: WPF - resource site Pin
Soulus8321-Jun-11 12:53
Soulus8321-Jun-11 12:53 
GeneralRe: WPF - resource site Pin
Pete O'Hanlon21-Jun-11 21:02
mvePete O'Hanlon21-Jun-11 21:02 
AnswerRe: WPF - resource site Pin
Mark Salsbery21-Jun-11 13:04
Mark Salsbery21-Jun-11 13:04 
QuestionUserControl in MVVM w/ no code behind? is it possible? Pin
SledgeHammer0121-Jun-11 10:04
SledgeHammer0121-Jun-11 10:04 
AnswerRe: UserControl in MVVM w/ no code behind? is it possible? Pin
Pete O'Hanlon21-Jun-11 10:27
mvePete O'Hanlon21-Jun-11 10:27 

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.