title: Problem SilverLight 4 DataPager control
body: <p>I want to bind DataPager to DataGrid</p>
  
  <p>here is xaml</p>
  
  <pre><code>&lt;UserControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="NorthWindSilver.MainPage"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:mv="clr-namespace:NorthWindSilver.ViewModel"
  xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
  mc:Ignorable="d"
  d:DesignHeight="300" d:DesignWidth="400"&gt;
  
  &lt;UserControl.Resources&gt;
      &lt;mv:ViewModel x:Key="ViewModel"/&gt;
  &lt;/UserControl.Resources&gt;
  
  &lt;Grid x:Name="LayoutRoot" Background="White"&gt;
      &lt;data:DataGrid Name="dgCustomer" AutoGenerateColumns="True" ItemsSource="{Binding Items, Mode=TwoWay, Source={StaticResource ViewModel}}"&gt;
      &lt;/data:DataGrid&gt;
      &lt;sdk:DataPager HorizontalContentAlignment="Center" x:Name="myPager" Grid.Row="2" Source="{Binding Path=ItemsSource, ElementName=dgCustomer}" PageSize="10"/&gt;
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>and ViewModel</p>
  
  <pre><code> public class ViewModel :  INotifyPropertyChanged
  {
  
      public event PropertyChangedEventHandler PropertyChanged;
  
      public ObservableCollection&lt;Customer&gt; _items;
  
      public ViewModel()
      {
          if (!IsDesignTime)
              this.Customer();
      }
  
      public void ChangeProperty(string propertyName)
      {
          if (this.PropertyChanged != null)
          {
              this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
          }
  
      }      
  
      public ObservableCollection&lt;Customer&gt; Items
      {
          get
          {
              return this._items;
          }
          set
          {
              this._items = value;
              ChangeProperty("Items");
          }
      }
  
  
      public bool IsDesignTime
      {
          get
          {
              return (Application.Current == null) ||
                  (Application.Current.GetType() == typeof(Application));
          }
      }
  
  
      public void Customer()
      {
          DataServiceClient webService = new DataServiceClient();
          webService.GetCustomersCompleted += new EventHandler&lt;GetCustomersCompletedEventArgs&gt;(webService_GetCustomersCompleted);
  
          webService.GetCustomersAsync();
      }
  
  
      void webService_GetCustomersCompleted(object sender, GetCustomersCompletedEventArgs e)
      {
          Items = e.Result;
  
          PagedCollectionView pageView = new PagedCollectionView(Items);          
  
          MainPage ma = new MainPage();
  
          ma.dgCustomer.ItemsSource = pageView;
      }
  }
  </code></pre>
  
  <p><a href="http://img98.imageshack.us/img98/1672/unledko.jpg" rel="nofollow noreferrer">Here is the result</a><img src="https://i.stack.imgur.com/l3GtL.jpg" alt="enter image description here"></p>
  
  <p>As you see DataPager does not work
  what the problem?</p>