16,021,181 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by rohu123 (Top 4 by date)
rohu123
27-Jan-16 1:07am
View
Hi Richard,
My Xaml Page consist of only the Map Control and command bar. The XAML is as given below -
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MapTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Maps="using:Windows.UI.Xaml.Controls.Maps"
x:Class="MapTest.MainPage"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Page.BottomAppBar>
<commandbar>
<appbarbutton icon="Accept" label="appbarbutton">
<appbarbutton icon="Cancel" label="appbarbutton">
</Page.BottomAppBar>
<grid removed="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Maps:MapControl
x:Name="MapWorkArea"
HorizontalAlignment="Left"
Margin="10,10,0,0"
VerticalAlignment="Top"
Height="560" Width="380"
MapServiceToken="My Service Token"/>
</Page>
Code Behind as given below -
<pre>
namespace MapTest
{
///
/// An empty page that can be used on its own or navigated to within a Frame.
///
public sealed partial class MainPage : Page
{
public MainPage()
{
//intialization of the control is happening here
this.InitializeComponent();
LoadData();
}
private async void LoadData()
{
try
{
var geopoint = new Geopoint(new BasicGeoposition() { Latitude = 55.6127809826285, Longitude = 13.0031764693558 });
var youPin = CreatePin();
MapWorkArea.Children.Add(youPin);
MapControl.SetLocation(youPin, geopoint);
MapControl.SetNormalizedAnchorPoint(youPin, new Point(0.0, 1.0));
await MapWorkArea.TrySetViewAsync(geopoint, 15, 0, 0, MapAnimationKind.Bow);
}
catch (Exception ex)
{
throw;
}
}
private DependencyObject CreatePin()
{
//Creating a Grid element.
var myGrid = new Grid();
myGrid.RowDefinitions.Add(new RowDefinition());
myGrid.RowDefinitions.Add(new RowDefinition());
myGrid.Background = new SolidColorBrush(Colors.Transparent);
//Creating a Rectangle
var myRectangle = new Rectangle { Fill = new SolidColorBrush(Colors.Black), Height = 20, Width = 20 };
myRectangle.SetValue(Grid.RowProperty, 0);
myRectangle.SetValue(Grid.ColumnProperty, 0);
//Adding the Rectangle to the Grid
myGrid.Children.Add(myRectangle);
//Creating a Polygon
var myPolygon = new Polygon()
{
Points = new PointCollection() { new Point(2, 0), new Point(22, 0), new Point(2, 40) },
Stroke = new SolidColorBrush(Colors.Black),
Fill = new SolidColorBrush(Colors.Black)
};
myPolygon.SetValue(Grid.RowProperty, 1);
myPolygon.SetValue(Grid.ColumnProperty, 0);
//Adding the Polygon to the Grid
myGrid.Children.Add(myPolygon);
return myGrid;
}
}
}
</pre>
rohu123
13-Jan-16 5:47am
View
Deleted
Hi all,
I got the solution for this issue.
But facing another issue is that When i using DrawerNavigation Control on the parent page it not generating events on the parent page.
For Example -
On Menu1.xaml added reference of user control like given below -
xmlns:uc ="using:Sample.Controls"
Add using user control as given -
<uc:drawernavigation x:name="ucDNMenu1" zindex="999"></uc:drawernavigation>
Thanks in advance,
Rohan
rohu123
2-Mar-11 4:02am
View
Thanks.
rohu123
2-Mar-11 4:01am
View
Thanks dude..