Exemplo n.º 1
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     WindowStandardGrid wnd = new WindowStandardGrid();
     CollectionViewSource source = ((System.Windows.Data.CollectionViewSource)(wnd.FindResource("personViewSource")));
     wnd.Loaded += (sender1, e1) => {
         MyXpoDataService ctx = new MyXpoDataService(new Uri(ODataServerAddress));
         DataServiceQuery<Person> query = ctx.CreateQuery<Person>("Person");
         source.Source = query.Execute();
         source.View.MoveCurrentToFirst();
     };
     wnd.Show();
 }
Exemplo n.º 2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            WindowDXGrid wnd = new WindowDXGrid();
            CollectionViewSource viewSource = ((System.Windows.Data.CollectionViewSource)(wnd.FindResource("personViewSource")));
            wnd.Loaded += (sender1, e1) => {
                MyXpoDataService ctx = new MyXpoDataService(new Uri(ODataServerAddress));
                var persons = from p in ctx.CreateQuery<Person>("Person") select p;

                viewSource.Source = persons;
                viewSource.View.MoveCurrentToFirst();

            };
            wnd.Show();
        }