I have a class named Tasks.cs:
namespace Player_beta.ViewModels
{
public class Tasks : ICollectionView
{
private ICollectionView _customerView;
public ICollectionView Customers
{
get { return _customerView; }
}
public ObservableCollection<PlaylistVM> PlayLists
{
get { return _playLists; }
set { _playLists = value; }
}
//etc
In my Window1.xaml I wrote:
xmlns:local="clr-namespace:Player_beta.ViewModels;assembly="
Then I've tried to create a local instance of Tasks.cs and get access to its PlayLists property, but failed:
<Window.Resources>
<local:Tasks x:Key="mtask"/>
<CollectionViewSource Source="{StaticResource mtask.PlayLists}" x:Key="customerView">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="plNAME"/>
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
</Window.Resources>
........................
<ListBox DisplayMemberPath="plNAME" ItemsSource="{Binding Source={StaticResource customerView}}" />
I know that I can create an instance of Tasks.cs in Window1.xaml.cs and then bind it to Window1's DataContext, but its DataContext already bound to an instance of another class - PlayerVM.cs.