Creation of Dynamic Layer Map with DomainService

2 posts, 0 answers
  1. Arvind Dhasmana
    Arvind Dhasmana avatar
    12 posts
    Member since:
    Apr 2010

    Posted 13 May 2010 Link to this post


    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.

    CHaru Pahuja
  2. Andrey
    Andrey avatar
    1681 posts

    Posted 14 May 2010 Link to this post

    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.
        // ...

    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.
Back to Top