Ok, I finaly solved by myself, I made a conversor like this:
public class ObservableToGroupedConverter : IValueConverter
{
public object Convert(object value, Type targetType,
object parameter, CultureInfo culture)
{
var group = (value as ViewModelFriends).friends;
return metodosAuxiliares.GetItemGroups(group.OrderBy(o => o.distraw).ToList(), c => c.online);
}
public object ConvertBack(object value, Type targetType,
object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
I added the conversor to the resources and the binding is:
<view:ViewFriends x:Name="vistaAmigos"
DataContext="{Binding MainVMFriends,
Source={StaticResource friendLocator},
Converter={StaticResource friendConvert}}"/>