ThinkGeo.com    |     Documentation    |     Premium Support

Issue in WpfMap control added into VS2010

Hi,


I am referring to Step 2 in the quick guide for using wpf desktop 4.0 at wiki.thinkgeo.com/wiki/Map_S...tart_Guide


This step doesn't allow me to find the WpfMap checkbox under "WpfComponent" tab in VS2010 wpfapplication project environment running on Vista Business OS. As a result I cannot have the "WpfMap" control added into the toolbox. Indeed  cannot find the map control there. How do you accomplish this step successfully in VS2010? Because this is critical to the map suite application in wpf environment.


Thanks a lot.


Franklin



Hi Franklin, 
  
 You need to locate the “WpfDesktopEdition.dll” manually in the “WPF Components” tab, and then you can see the map control listed in the tab. 
  
 Regards, 
 Tsui

Hi Tsui, 



The problem is: I cannot find the "WpfDesktopEdition.dll" which is supposed to appear under the "WPF Components" tab after clicking "choose items" in the step 2. So I couldn't select that checkbox. This is what I described above. Do you have same problem in completing the step 2 in VS 2010 Wpf Application project space running on OS Vista Business? Hope you understand what I mean this time. 



Thanks. 



Franklin 



 



Hi Tsui, 
  
    Do you have something special to do to make the item "WpfMap" appear under WPF Component tab  in the step 2 above? 
 I am not so clear what you meant by "You need to locate the "WpfDesktopEdition.dll" manually…". 
 Thanks. 
  
 Franklin

 


Hi Franklin,


 


As we can see in the screen shot above, there is a "Browse" button. You need to click this button, locate the WpfDesktopEdition.dll file. After that, the WpfMap will be added in the list, then you can check the checkbox to make it appear in the toolbox.


 


Regards,


Tsui



Tsui, 
  
   Have added the wpfmap control as mentioned above. I dragged and dropped the wpfmap onto the map portion of the  screen as xaml below: 
  
   
 <Window x:Class="UseGrid.MainWindow" 
         xmlns="schemas.microsoft.com/winfx/2006/xaml/presentation
         xmlns:x="schemas.microsoft.com/winfx/2006/xaml
             xmlns:uc1="clr-namespace:ThinkGeo.MapSuite.WpfDesktopEdition;assembly=WpfDesktopEdition" 
             
         Title="MainWindow" Height="560" Width="1130"> 
     <Grid ShowGridLines="True" 
           TextBlock.FontSize="20"> 
         <Grid.RowDefinitions> 
             <RowDefinition Height="124*" /> 
             <RowDefinition  Height="0"/> 
             <RowDefinition Height="317" /> 
         </Grid.RowDefinitions> 
         <Grid.ColumnDefinitions> 
             <ColumnDefinition Width="171*"/> 
             <ColumnDefinition Width="0*" /> 
             <ColumnDefinition Width="611*" /> 
             <ColumnDefinition Width="109*" /> 
         </Grid.ColumnDefinitions> 
         <GridSplitter Grid.RowSpan="3" Width="8" 
                       Background="Black" 
                       ResizeBehavior="PreviousAndNext" 
                       ResizeDirection="Columns" Grid.ColumnSpan="2" /> 
                        
                          Content="Vehicles in Fleet" Click="Button_Click_1" Grid.Column="2" /> 
          
      
        
  
                          Content="Event View" Grid.Row="2" /> 
         <ListBox Height="80" HorizontalAlignment="Left" Margin="2,79,0,0" Name="TaskList" VerticalAlignment="Top" Width="152"> 
             <ListBoxItem Content="Create a zone" FontSize="12" FontWeight="Bold" /> 
             <ListBoxItem Content="Edit a zone" FontSize="12" FontWeight="Bold" /> 
             <ListBoxItem Content="Delete a zone" FontSize="12" FontWeight="Bold" /> 
         </ListBox> 
          
         <ListBox Grid.Row="2" Height="257" HorizontalAlignment="Left" Margin="12,25,0,0" Name="ManCatalogList" VerticalAlignment="Top" Width="142"> 
             <ListBoxItem Content="Fleet Management" FontSize="12" FontWeight="Bold" /> 
             <ListBoxItem Content="Asset Monitoring" FontSize="12" FontWeight="Bold" /> 
             <ListBoxItem Content="Zone Management" FontSize="12" FontWeight="Bold" /> 
             <ListBoxItem Content="Zone Set Management" FontSize="12" FontWeight="Bold" /> 
             <ListBoxItem Content="Event Handling" FontSize="12" FontWeight="Bold" /> 
             <ListBoxItem Content="Asset Management" FontSize="12" FontWeight="Bold" /> 
             <ListBoxItem Content="Asset Group Management" FontSize="12" FontWeight="Bold" /> 
         </ListBox> 
          
         <ListBox Height="23" HorizontalAlignment="Left" Margin="8,24,0,0" Name="listBox1" VerticalAlignment="Top" Width="146" AllowDrop="True"> 
             <ListBoxItem Content="FleetA" FontSize="12" FontWeight="Bold" /> 
             <ListBoxItem Content="FleetB" FontSize="12" FontWeight="Bold" /> 
             <ListBoxItem Content="FleetC" FontSize="12" FontWeight="Bold" /> 
         </ListBox> 
         <uc1:WpfMap Grid.Column="2" Grid.Row="2" HorizontalAlignment="Left" Margin="1,0,0,0" Name="wpfMap1" VerticalAlignment="Top" Height="317" Width="758" /> 
         <Border CornerRadius="4" BorderBrush="Gray" BorderThickness="1"  Background="#33ffffff" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="329,11,0,0" Grid.Column="2" Grid.Row="2"> 
             <StackPanel Orientation="Horizontal"> 
                 <StackPanel.Resources> 
                     <Style x:Key="bt" TargetType="Button">
<Setter Property="Width" Value="30"></Setter>
<Setter Property="Margin" Value="2"></Setter>
</Style>
</StackPanel.Resources>
<Button Style="{StaticResource bt}" x:Name="btnDisplayPolygon" Click="button_Click">
<Image Source="/Resource/AQUA.png" />
</Button>
<Button Style="{StaticResource bt}" x:Name="btnTrackNormal" Click="button_Click">
<Image Source="/Resource/Normal.png" />
</Button>
<Button Style="{StaticResource bt}" x:Name="btnTrackPoint" Click="button_Click">
<Image Source="/Resource/Point.png" />
</Button>
<Button Style="{StaticResource bt}" x:Name="btnTrackLine" Click="button_Click">
<Image Source="/Resource/Line.png" />
</Button>
<Button Style="{StaticResource bt}" x:Name="btnTrackRectangle" Click="button_Click">
<Image Source="/Resource/Rectangle.png" />
</Button>
<Button Style="{StaticResource bt}" x:Name="btnTrackSquare" Click="button_Click" >
<Image Source="/Resource/Square.png" />
</Button>
<Button Style="{StaticResource bt}" x:Name="btnTrackPolygon" Click="button_Click">
<Image Source="/Resource/Polygon.png" />
</Button>
<Button Style="{StaticResource bt}" x:Name="btnTrackCircle" Click="button_Click">
<Image Source="/Resource/Circle.png" />
</Button>
<Button Style="{StaticResource bt}" x:Name="btnTrackEllipse" Click="button_Click">
<Image Source="/Resource/Ellipse.png" />
</Button>
<Button Style="{StaticResource bt}" x:Name="btnTrackEdit" Click="button_Click">
<Image Source="/Resource/Edit.gif" />
</Button>
<Button Style="{StaticResource bt}" x:Name="btnTrackDelete" Click="button_Click">
<Image Source="/Resource/Delete.png" />
</Button>

</StackPanel>
</Border>

</Grid>
</Window>

However, still run into "The tag 'WpfMap' does not exist in XML namespace 'clr-namespace ThinkGeo.MapSuite.WpfDekstopEdition;assembly=WpfDesktopEdition'. Line 54 Position 10

What could be the problem? and how to fix it?
Thanks a lot.

Regards,
 Franklin

Hi Tsui, 
 The XAML text is badly distorted. I will include the file in Ticket#3087. 
 Thanks. 
  
 Regards, 
  
 Franklin

Hi Franklin, 
  
 We’ll see the ticket and let you know how it goes. 
  
 Regards, 
 Tsui

Hi Tsui, 
  
    The file has been submitted, please take a look at Ticket#3087. 
 Thanks. 
 Regards, 
 Franklin

Hi Franklin, 
  
 We’ll check out the ticket and let you know how it goes soon. 
  
 Regards,  
 Tsui

Hi Franklin, 
  
 We’ve got the XAML code you attached in the ticket. 
 We created a demo, pasted your XAML code into it and added some empty event handlers for the buttons. Then we compiled and ran it, and we got no error. 
  
 Please make sure all necessary assemblies are referenced in your project, if that won’t work, please send us your sample that has the problem and we’ll check it for you. 
  
 Please feel free to let us know if you have any other questions. 
  
 Regards, 
 Tsui

Hi Tsui, 
  
   It was due to a project property setting problem. I have fixed the misconfiguration. All the references were made correctly. 
 Thanks. 
  
 Franklin

Hi Franklin, 
  
 Glad to know that, please let us know if you have any other questions. 
  
 Regards,  
 Tsui