Locator.xaml
上传用户:huazai0421
上传日期:2008-05-30
资源大小:405k
文件大小:2k
源码类别:

SilverLight

开发平台:

C#

  1. <UserControl x:Class="ESRI.ArcGIS.Samples.LocatorControl"
  2.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  3.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:esriConverters="clr-namespace:ESRI.ArcGIS.Client.ValueConverters;assembly=ESRI.ArcGIS.Client"
  5. >
  6. <UserControl.Resources>
  7. <esriConverters:DictionaryConverter x:Name="MyDictionaryConverter" />
  8. </UserControl.Resources>
  9. <Grid>
  10. <StackPanel Orientation="Horizontal">
  11. <TextBlock Text="Search:" Margin="0,0,5,0" Foreground="White" FontWeight="Bold"  VerticalAlignment="Center" />
  12. <TextBox Width="150" Height="22" Foreground="Gray"
  13.  x:Name="locationTextBox" SelectionBackground="#999999"
  14.  GotFocus="TextBox_GotFocus"
  15.  LostFocus="TextBox_LostFocus"
  16.  Text="Enter a location..."
  17.  KeyDown="SearchLocation_KeyDown"
  18.  Background="Transparent"  VerticalAlignment="Center" />
  19.     </StackPanel>
  20. <Popup x:Name="locationResultsPopUp" IsOpen="True" HorizontalAlignment="Left" VerticalAlignment="Top">
  21. <ListBox x:Name="locationResults" Background="#333333"  SizeChanged="locationResults_SizeChanged"
  22.  SelectionChanged="locationResults_SelectionChanged" 
  23.  Visibility="Collapsed"
  24.  LostFocus="locationResults_LostFocus">
  25. <ListBox.ItemTemplate>
  26. <DataTemplate>
  27. <TextBlock 
  28. Foreground="White" FontSize="9"
  29. Text="{Binding Path=Attributes, Converter={StaticResource MyDictionaryConverter}, ConverterParameter=Descr, Mode=OneWay}" />
  30. </DataTemplate>
  31. </ListBox.ItemTemplate>
  32. </ListBox>
  33. </Popup>
  34. </Grid>
  35. </UserControl>