OK, I'm back to square one. What I'm finding is, if you use the static method (MyFeatureLayerInfoWindowTemplate) vs. the dynamic method (LocationInfoWindowTemplate) for creating InfoWindows, you have new problems either way. In the dynamic method, binding works great, but you then lose the ability to apply rowspan="2" so you can see the entire content of the InfoWindow. In the static method, you seem to lose the binding capabilities.What I am specifically trying to do is allow the user to create new locations with comments at that location which they can eventually save. On the InfoWindow, we want to display the currently logged in user's name. I can't get that part to work, and I fear what will happen when I attempt to capture the comment within the InfoWindow...can it be done?Here's some code, first XAML: <DataTemplate x:Key="NewCommentInfoWindowTemplate">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="20" />
<RowDefinition Height="30" />
<RowDefinition Height="200" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="134" />
<ColumnDefinition Width="316" />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="0" Grid.ColumnSpan="2">
<Image x:Name="Dismiss" Style="{StaticResource dismissButton}" Height="20" ToolTipService.ToolTip="Exit"
Cursor="Hand" MouseLeftButtonDown="Dismiss_MouseLeftButtonDown" />
</StackPanel>
<TextBlock Text="Comment for user: " Grid.Row="1" Foreground="Black" FontSize="12" FontWeight="Bold" VerticalAlignment="Top" Margin="2" />
<TextBlock x:Name="UserID" Text="{Binding ID}" Grid.Column="1" Grid.Row="1" VerticalAlignment="Top" Margin="2" HorizontalAlignment="Left"
Foreground="Black" FontSize="12" FontWeight="Bold" />
<TextBlock Grid.Row="2" Text="Comment:" Foreground="Black" FontSize="12" FontWeight="Bold" Margin="2" VerticalAlignment="Top" />
<TextBox x:Name="CommentText" Grid.Row="2" Grid.Column="1" Margin="2" VerticalAlignment="Stretch" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="3" Grid.ColumnSpan="2">
<Button x:Name="SaveComment" Content="Save" Margin="2" MouseLeftButtonDown="SaveComment_MouseLeftButtonDown"
Cursor="Hand"/>
</StackPanel>
</Grid>
</DataTemplate>
<esri:InfoWindow x:Name="NewCommentInfoWindow" Grid.RowSpan="2"
Padding="2" CornerRadius="20" Background="White"
Map="{Binding ElementName=Map}"
ContentTemplate="{StaticResource NewCommentInfoWindowTemplate}" />" />
Code-behind to assign the UserID: private void CaptureComment_MouseClick(object sender, ESRI.ArcGIS.Client.Map.MouseEventArgs e)
{
//The actual coordinates
ESRI.ArcGIS.Client.Geometry.MapPoint clickPoint = e.MapPoint;
//Open the comment entry form and pass the coordinates
ESRI.ArcGIS.Client.Geometry.Geometry g = clickPoint;
Map.PanTo(g);
NewCommentInfoWindow.Anchor = clickPoint;
NewCommentInfoWindow.IsOpen = true;
//Since a ContentTemplate is defined, Content will define the DataContext for the ContentTemplate
FSRMapApplication.UserID ui = new FSRMapApplication.UserID(UserID);
CommentInfoWindow.Content = ui;
}
Note that FSRMapApplication.UserID is a class that holds the UserID assigned as "ID". This value is being passed from the web.config through initParams, etc/