3 Answers, 1 is accepted
0
Hi Derek,
Could you please examine this help article, see the online demos and if you have further questions feel free to ask?
All the best,
Viktor Tsvetkov
the Telerik team
Could you please examine this help article, see the online demos and if you have further questions feel free to ask?
All the best,
Viktor Tsvetkov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
0
Ilya
Top achievements
Rank 1
answered on 20 May 2013, 09:30 AM
Hi.
I am trying to use Breadcrumb with MVVM pattern now and I am a bit stuck with handling SelectionChanged event. Could you provide just a small example how should I bind event to the ViewModel code?
I have tried this code:
And in ViewModel:
Haven't ever came to "int i =1;"
Thank you for help.
I am trying to use Breadcrumb with MVVM pattern now and I am a bit stuck with handling SelectionChanged event. Could you provide just a small example how should I bind event to the ViewModel code?
I have tried this code:
<
telerik:RadBreadcrumb
x:Name
=
"Breadcrumb"
<br><
span
class
=
"Apple-tab-span"
style
=
"white-space:pre"
> </
span
>... <
br
> ><
br
> <
i:Interaction.Triggers
><
br
> <
i:EventTrigger
EventName
=
"SelectionChanged"
><
br
> <
i:InvokeCommandAction
Command
=
"{Binding SelectedItemChangedCommand}"
/><
br
> </
i:EventTrigger
><
br
> </
i:Interaction.Triggers
><
br
> <
br
> </
telerik:RadBreadcrumb
>
private
void
BreadcrumbItemChangedCommandFunction()<br> {<br>
int
i = 1;<br> }<br><br>
private
void
CreateCommands()<br> {<br> SelectedItemChangedCommand =
new
DelegateCommand(BreadcrumbItemChangedCommandFunction, CanRunChange);<br> }<br><br>
private
bool
CanRunChange()<br> {<br>
return
true
;<br> }<br><br>
public
DelegateCommand SelectedItemChangedCommand {
get
;
set
; }
Thank you for help.
0
Hello Ilya,
Instead of SelectionChanged you should use the CurrentItemChanged event like this:
Also if you want you could bind the current item and use it in the command like this:
I hope I was able to help you and if you have further questions please feel free to ask.
Regards,
Zarko
Telerik
Instead of SelectionChanged you should use the CurrentItemChanged event like this:
<
i:EventTrigger
EventName
=
"CurrentItemChanged"
>
...
</
i:EventTrigger
>
<
telerik:RadBreadcrumb
x:Name
=
"Breadcrumb"
CurrentItem
=
"{Binding MyCurrentItem}"
>
<
i:Interaction.Triggers
>
<
i:EventTrigger
EventName
=
"CurrentItemChanged"
>
<
i:InvokeCommandAction
Command
=
"{Binding SelectedItemChangedCommand}"
CommandParameter
=
"{Binding MyCurrentItem}"
/>
</
i:EventTrigger
>
</
i:Interaction.Triggers
>
</
telerik:RadBreadcrumb
>
Regards,
Zarko
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.