ComponentOne Maps for UWP
Step 1 of 4: Creating the Application
Maps for UWP Tutorials > Adding Map Markers with a Click > Step 1 of 4: Creating the Application

In this step, you will create a new Universal Windows application and set up your XAML view.

  1. Select File | New | Project to open the New Project dialog box.
  1. Select Templates | Visual C# | Windows | Universal. From the templates list, select Blank App (Universal Windows).
  2. Enter a name for your application and click OK. A new, blank Universal Windows application will open.
  1. In the Solution Explorer, right-click the References file and select Add Reference from the list. Browse to locate the following assembly references:
  1. Double-click the MainPage.xaml file to open it.
  1. Add the following namespace declarations to the <Page> tag at the top of the page:

The tag should resemble the following:

Markup
Copy Code
<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:C1="using:C1.Xaml.Maps"
    xmlns:local="using:MapsTest5"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Xaml="using:C1.Xaml"
    x:Class="MapsTest5.MainPage"
    mc:Ignorable="d">
  1. Insert the following markup between the <Grid> </Grid> tags to add a C1Maps control and a general TextBlock control, as well as some formatting:
Markup
Copy Code
<Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Border Margin="0,0,0,10">
            <TextBlock TextWrapping="Wrap" Text="Right Click to add mark, Drag mark to move mark, Double Click on mark to remove." />
        </Border>
        <Border Grid.Row="1">
            <Grid>
                <C1:C1Maps x:Name="maps"/>
            </Grid>
        </Border>

 

In this step, you created a new Universal Windows application, added references to the C1.UWP reference assemblies, and created a C1Map control and a TextBlock control.