I have put together an application that highlights a single Mapelement in yellow. This works find until I attempt to do a WindowPan to the selected Element. When I put the code in for the WindowPan, a single line of code [WindowPan(this.SelectedElement)], I then begin to have multiple selects upon clicking on the next few mapelements.
I have verified that my code selects only one item at a time when I click one item after another. I only get the above results of multiple selects when I put the one line of code in to Pan to the item.
Jason,
I am still having the same problem. When I highlight an element and then move to a different element and do the WindowFit (see below), it does not clear the first highlight and then highlights the second element also. Here is the code:
private void mapODE_ElementClick(object sender, Infragistics.Silverlight.Map.MapElementClickEventArgs e) { if (this.SelectedElement != null && this.SelectedElement != e.Element) { this.AllowChangesOnSelectedElement = true; this.SelectedElement.Fill = null; this.AllowChangesOnSelectedElement = false; } e.Element.Fill = new SolidColorBrush(Colors.Yellow); this.SelectedElement = e.Element; this.mapODE.WindowFit(e.Element); }
private void mapODE_ElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "Fill" && sender == this.SelectedElement && !this.AllowChangesOnSelectedElement) { this.AllowChangesOnSelectedElement = true; this.SelectedElement.Fill = new SolidColorBrush(Colors.Yellow); this.AllowChangesOnSelectedElement = false; } }
Were you able to resolve your issue with panning the window? Please let me know if you have any further questions or concerns.
Hello,
How are you implementing your selection behavior? Also, at what point are you calling the WindowPan method?
Do you have a sample that we could use to research this?
Oddly enough, when I remove the code and use the navigator to zoom in, I also get the multiple selects after I zoom in.
Additional information:
I have discovered that the WindowZoom is the guilty culprit. When I change the WindowZoom to a number like 4 and then run the WindowPan, I am getting the multple selects.