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.
Were you able to resolve your issue with panning the window? Please let me know if you have any further questions or concerns.
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; } }