Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Silverlight TV 13: MVVM Light Toolkit
Mar 12, 2010 at 1:30 AMThanks Laurent!
You saved my day. I am working on a SL4 app and I am going to use your MVVM Light, am I allowed to do it?
Thanks again for the help!
Silverlight TV 13: MVVM Light Toolkit
Mar 12, 2010 at 12:08 AMHi Laurent,
Thanks for this great toolkit. Your toolkit is nice but if you add a single how to use documentation to it, it would be awesome. I know you did most of it in blog posts but if you gather them in a single doc it would be great. Thanks.
One question I have is about the Locator Class. Could you please explain more about this class and how it does the work.
It might be a stupid question but Why when I do not use the locator class and just Bind the DataContext of the main container object to the VM such as below the Command do not executed.
<UserControl
xmlns:vm="clr-namespace:MyApp.ViewModels"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras">
<UserControl.Resources>
<vm:MainPageViewModel x:Key="MainPageViewModel"/>
</UserControl.Resources>
<Grid DataContext="{Binding MainPageViewModel}">
<Button Content="Simple Command">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<cmd:EventToCommand Command="{Binding SimpleCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</Grid>
</UserControl>
and in the MainPageViewModel class
namespace MyApp.ViewModels
{
public class MainPageViewModel: ViewModelBase
{
public MainPageViewModel()
{
SimpleCommand= new RelayCommand(() =>
{
// do sth
Status = "SimpleCommand executed";
});
}
public RelayCommand SimpleCommand
{
get;
private set;
}
}
As you see I have set the DataContext of the Grid to my VM so my button should be able to use the SimpleCommand, am I right?
Nore: The above code is just a sample. I know that the button now has built in command support now in SL4.
Thanks!