Q:

Using commands with MenuItem's in WPF

So I have this MenuItem which is using a list of CultureInfos as an itemsource.
What I'm trying to do is to fire a function when a CultureInfo is clicked/selected, which is supposed to change the localization of the application to the selected cultureinfo.
I can safely say that the function is working as it should.
After researching and trying a few examples, this is what I ended up with, which unfortunately doesn't work:  
<MenuItem Header="{lex:LocText MenuLanguages}" ItemsSource="{Binding LanguageList}" DisplayMemberPath="Name">
        <MenuItem.ItemContainerStyle>
            <Style>
                <Setter Property="MenuItem.Command" Value="{Binding SetLanguage}" />
                <Setter Property="MenuItem.CommandParameter" Value="{Binding}" />
            </Style>
        </MenuItem.ItemContainerStyle>
</MenuItem>

The command: 
    private ICommand _SetLanguage;
    public ICommand SetLanguage
    {
        get
        {
            if (_SetLanguage == null)
                _SetLanguage = new RelayCommand(ChangeLanguage);
            return _SetLanguage;
        }
    }

    public void ChangeLanguage(object langChosen)
    {
        LocalizeDictionary.Instance.Culture = CultureInfo.GetCultureInfo(langChosen.ToString());
    }

CultureInfo.GetCultureInfo() takes string as a parameter.
The itemsource is basically an ObservableCollection<CultureInfo>.
My question is what could be wrong with the above code? I have been trying quite a few 'solutions' but nothing really worked...
When I select an item form the list nothing happens at all. 
*I also tried to set a breakpoint on the ChangeLanguage method, which brought me to a conclusion that the method never even fires. 
Using caliburn.micro and WPFLocalizationExtension extension. 

A:

If it doesn't work, then the binding is wrong. Check out for binding errors in debug window.
You need to use relativesource, since binding directly wont do what you think will do.
    <MenuItem Header="_Recent files" ItemsSource="{Binding RecentFiles, Converter={StaticResource RecentFilesToListOfStringsConverter}, Mode=OneWay}" >
    <MenuItem.ItemContainerStyle>
        <Style TargetType="{x:Type MenuItem}">
            <Setter Property="Command" Value="{Binding DataContext.ImportRecentItemCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type MenuItem}, AncestorLevel=1}}" />
            <Setter Property="CommandParameter" Value="{Binding}" />
        </Style>
    </MenuItem.ItemContainerStyle>
</MenuItem>

