Select to view content in your preferred language

ShowCoordinatesBehavior Has Black Background

926
4
10-04-2010 10:21 AM
RyanCoodey
Frequent Contributor
Where does the ShowCoordinatesBehavior inherit its background color from and how can I change it?  It should be transparent... but I am seeing a back box behind the coordinates...

Thanks!!!
0 Kudos
4 Replies
JenniferNery
Esri Regular Contributor
I cannot reproduce this. Do you mind sharing more information? Maybe a screenshot? I'm using the sample from our SDK http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ShowCoordinatesBehavior and tried it with SL4, WPF4, and WPF3.5 projects, and none of them have a Background set to Black (kindly see attached image).  

By default ShowCoordinatesBehavior template has 2 TextBlocks (one with Black Foreground and the other with White Foreground that appears like an outline). This template does not set Background property and it also cannot be modified.
0 Kudos
RyanCoodey
Frequent Contributor
Jennifer, Thanks a lot for doing all that testing... I am running a .NET 4 WPF Web Application (XBAP) and I just tried it as a regular WPF application and it displays fine, but as a Web Application (XBAP) it has this black background.   Hmmm, so what is the difference between those two... not sure what I could do to fix it...

Attached a screen shot of the black background.

Thanks a lot for the help!!!
0 Kudos
JenniferNery
Esri Regular Contributor
This seems to be a limitation on WPF Browser Application as discussed in this link http://www.netframeworkdev.com/windows-presentation-foundation-wpf/problem-with-popup-bakground-in-x...

I tried creating a popup outside our API and followed the suggestion of setting AllowsTransparency to False and explicitly setting a Background. However, when Background is set to {x:Null} or Transparent, the background remains black. It only accepted Background when set to "White" or other colors.
   <Grid>
  <ToggleButton x:Name="ShowPopup" Content="ShowPopup" VerticalAlignment="Top" HorizontalAlignment="Center"/>
  <Popup AllowsTransparency="False" PlacementTarget="{Binding ElementName=ShowPopup}" Placement="Relative"  IsOpen="{Binding ElementName=ShowPopup, Path=IsChecked}" Opened="Popup_Opened">
   <Popup.Child>
    <Border Background="{x:Null}">
     <TextBlock Text="Test"/>
    </Border>
   </Popup.Child>
  </Popup>
 </Grid>


Due to this limitation, we also cannot support it at this time.
0 Kudos
RyanCoodey
Frequent Contributor
Well bummer... Doesn't seem to matter if it is a "Full Trust" app either.  Guess I will have to find some other means of showing these coordinates to the user.  I'll try to work out a fixed window and display the coordinates in it using something like: MyMap.ScreenToMap(screenPoint)...

Well thanks a lot for looking into this, I REALLY appriciate it!!!  Thank you!
0 Kudos