This is a migrated thread and some comments may be shown as answers.

InformationLayer data binding requires InvalidateArrange() on collection change

4 Answers 113 Views
Map
This is a migrated thread and some comments may be shown as answers.
Damian Slee
Top achievements
Rank 1
Damian Slee asked on 01 Apr 2010, 04:57 AM
I have tried data binding an observable collection to an InformationLayer.   But it seems it does not catch the ICollectionChange event.  informationLayer.InvalidateArrange() needs to be called manually after the collection is altered.

 

 

 

        ObservableCollection<Pushpin> _pins = new ObservableCollection<Pushpin>();  
 
        private void radMap_InitializeCompleted(object sender, EventArgs e)  
        {  
            if (!this.isInitialized)  
            {  
                isInitialized = true;  
 
                // initializing draagable object  
                Pushpin pushpin = new Pushpin();  
                ToolTip tooltip = new ToolTip();  
                tooltip.Content = "3 house st";  
                ToolTipService.SetToolTip(pushpin, tooltip);  
                this.MakeFrameworkElementDraggable(pushpin);  
                MapLayer.SetLocation(pushpin, new Location(37.747440943384, -95.2481111547551));  
                _pins.Add(pushpin);  
 
                pushpin = new Pushpin();  
                this.MakeFrameworkElementDraggable(pushpin);  
                MapLayer.SetLocation(pushpin, new Location(37.247440943384, -95.8481111547551));  
                _pins.Add(pushpin);  
 
                informationLayer.ItemsSource = _pins;  
            }  
        }  
 
 
 
        private void Button_Click(object sender, RoutedEventArgs e)  
        {  
            Pushpin pushpin = new Pushpin();  
            ToolTip tooltip = new ToolTip();  
            tooltip.Content = "new pushpin";  
            ToolTipService.SetToolTip(pushpin, tooltip);  
 
 
            this.MakeFrameworkElementDraggable(pushpin);  
 
            MapLayer.SetLocation(pushpin, new Location(36.747440943384, -94.2481111547551));  
 
            _pins.Add(pushpin);  
            informationLayer.InvalidateArrange();  
        }  
 
 
 
 

 

4 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 02 Apr 2010, 06:24 PM
Hello Damian,

Thank you for the feedback. We have addressed this issue. Please, download the latest internal build and give it a try.

Sincerely yours,
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.
0
Anton Z
Top achievements
Rank 1
answered on 04 May 2010, 11:10 AM
I have the same problem. Tried to use last build, but it does not help.

How i can call informationLayer.InvalidateArrange() from ViewModel? =)
0
Andrey
Telerik team
answered on 05 May 2010, 09:49 AM
Hello Anton,

Previous issue has been addressed to observable collection of FrameworkElements.
We have checked the latest build. It works properly.
Could you, please, create sample solution which demonstrates the problem?

Kind regards,
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.
0
Anton Z
Top achievements
Rank 1
answered on 16 May 2010, 03:58 PM
Hello Andrey,

All work fine
Sorry, it's my error

PS may be you can help with another problem information layer binding
Tags
Map
Asked by
Damian Slee
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Anton Z
Top achievements
Rank 1
Share this question
or