コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();

            var source = new ODataVirtualDataSource()
            {
                BaseUri           = "http://services.odata.org/V4/Northwind/Northwind.svc",
                EntitySet         = "Orders",
                PageSizeRequested = 200
            };

            //source.DeferAutoRefresh = true;
            source.SchemaChanged += Source_SchemaChanged;

            source.SortDescriptions.Add(new SortDescription("ShipName", ListSortDirection.Descending));

            grid1.SelectionMode = GridSelectionMode.SingleRow;

            grid1.ItemsSource = source;


            //grid1.SelectedItemsChanged += Grid1_SelectedItemsChanged;

            //Task.Delay(10000).ContinueWith((t) =>
            //{
            //    Dispatcher.BeginInvoke(new Action(() =>
            //    {
            //        source.DeferAutoRefresh = false;
            //    }));
            //});
        }
コード例 #2
0
        public MainPage()
        {
            InitializeComponent();


            var dataSource = new ODataVirtualDataSource()
            {
                BaseUri           = "http://services.odata.org/V4/Northwind/Northwind.svc",
                EntitySet         = "Orders",
                PageSizeRequested = 25,
                MaxCachedPages    = 5
            };

            this.BindingContext = dataSource;
        }