This is a migrated thread and some comments may be shown as answers.
Creation of Dynamic Layer Map with DomainService
1 Answer 78 Views
Map
This is a migrated thread and some comments may be shown as answers.
Arvind Dhasmana
Top achievements
Rank 1
Arvind Dhasmana asked on 13 May 2010, 11:59 AM
Hi

I am using Dynamic Layer concept with DomainServices with MVVM in silverlight.
As Domain Services do not have Asynchronous call so how to achieve Item Virtualization concept in that .

I have done the same thing i have created a class Dynamic with IMapDynamicSource as Interface inside a class but here i can not use async methods nor i have the callbacks as the completed event here gives me 

internal void Load_Completed(object sender, EventArgs e)

 

{

 


}

we do not have e.userstate here so how to work on this.

Regards
CHaru Pahuja

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 14 May 2010, 01:20 PM
Hi Arvind Dhasmana,

The WCF Domain Service do provide asynchronous calls on the client side (Silverlight application) with user state object. You can use LoadOperation.Completed event or a callback through the DomainContext.Load method. The implementation could looks like the following:

private MapDataDomainContext datarContext = new MapDataDomainContext();
  
public void ItemsRequest(
    double minZoom, 
    double maxZoom,
    Telerik.Windows.Controls.Map.Location upperLeft, 
    Telerik.Windows.Controls.Map.Location lowerRight,
    Action<System.Collections.ICollection> callback)
{
    LoadOperation<PointOfInterest> loadOp = this.datarContext.Load(this.datarContext.GetPOIQuery(), new Action<LoadOperation<PointOfInterest>>(LoadCompleted), callback);
}
  
private void LoadCompleted(LoadOperation<Customer> args)
{
    Action<System.Collections.ICollection> callback = args.UserState as Action<System.Collections.ICollection>;
  
    List<object> objects = new List<object>();
    // Process query results an fill in list of the objects.
    // ...
  
    callback(objects);
}


Greetings,
Andrey Murzov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Map
Asked by
Arvind Dhasmana
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or