WPF Binding on Position

Topics: WPF
Aug 15, 2011 at 2:10 AM

Hi

I am a trying to get a handle on WPF and binding with the map control.

When I try to add a binding on the map's Position property I get the error "A 'Binding' cannot be set on the 'Position' property of type 'GMapControl'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.".

Anyone know how to do this properly?

Coordinator
Aug 15, 2011 at 11:40 AM

create custom GMapControl, implement DependencyProperty for position, enjoy ;}

p.s. i'll convert position property someday too

Aug 15, 2011 at 11:49 AM
Thanks Radioman

I have to say this control is just about the best open source project I've ever seen. It is an awesome piece of work. Thank you.

BTW, I have changed the code in my project for WinForms to implement Z-Order on markers. Let me know if you'd like the code to add to the project.

Cheers

Paul

On Mon, Aug 15, 2011 at 9:40 PM, radioman <notifications@codeplex.com> wrote:

From: radioman

create custom GMapControl, implement DependencyProperty for position, enjoy ;}

p.s. i'll convert position property someday too

Read the full discussion online.

To add a post to this discussion, reply to this email (greatmaps@discussions.codeplex.com)

To start a new discussion for this project, email greatmaps@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Aug 15, 2011 at 2:59 PM

just make a fork, i'll check it

May 9, 2013 at 5:05 PM
radioman wrote:
create custom GMapControl, implement DependencyProperty for position, enjoy ;} p.s. i'll convert position property someday too
The only problem is that the user might scroll the map with his mouse, so the underlying Position property will change, but the DependencyProperty won't.
Why? let's say DependencyProperty is X, then the user moves the map to Y, then DependencyProperty is again being set to X - it will not raise a change event since the value is still X, thought the map is showing Y.
May 11, 2013 at 12:16 AM
Hi Paul,

Have a look at this thread.

https://greatmaps.codeplex.com/discussions/436024

it may help but I haven't got it working yet ( not that Ive had any time to work on it )
May 11, 2013 at 5:47 AM
I8sy, don't get me wrong, it does work, but only "one way". If the user moves the map (mouse drag etc) the DependencyProperty won't be updated with the new position(s).
May 11, 2013 at 9:17 AM
Superware, no offense taken I hadn't really thought of that but I would think that you could toggle how the map is being updated on its position.

For example the user clicks the map which disables the binding then when the user wants to see their position they click a button and it resets the binding again, very similar to the way a lot of the mapping program's work tomtom, garmin, trapster etc

The idea of the binding for me is so that I can bind it to my gps data rather than doing it via events as I'm doing now ( I just think it'd be cool to be able to just drop in a GPS reader control and set a binding and you've got the map working no mess no fuss )