Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 577201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:07:41+00:00 2026-05-13T14:07:41+00:00

I’m creating a silverlight user control that I should be able to drag and

  • 0

I’m creating a silverlight user control that I should be able to drag and drop via blend. But this control needs to accept a map that is already on the page.

For eg.

  1. Main.xaml contains a map control.
  2. MapEditor.xaml contains buttons and other controls. In the .cs file, it needs to access a map control (the one in Main.xaml).

How do I go about getting this done?

I was thinking about adding a parameter in the contructor for MapEditor but how would I pass in the map as a parameter in design mode?

Thanks.

ps. I’m going to break out this control into a silverlight library so it could be used in multiple projects later.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:07:42+00:00Added an answer on May 13, 2026 at 2:07 pm

    You don’t want to be giving your control a parameterised constructor, XAML will only construct types using their default constructor.

    Simple Approach

    The easiest approach would be to add DependencyProperty to your control to which you would assign the Map control (I’ll use the type name MyMap in this example):-

    public MyMap Map
    {
        get { return (MyMap)GetValue(MapProperty); }
        set { SetValue(MapProperty, value); }
    }
    
    public static DependencyPropery MapProperty = new DependencyProperty("Map",
        typeof(MyMap), typeof(MapEditor), new PropertyMetaData(null));
    

    Now in Blend the Map property will appear in the Miscellaneous category in the Properties tab. You can then use the “Element Property” tab of the “Create Data Binding” to select the Map control to which it should bind.

    Hard Core Approach

    That said I would be inclined to build a proper customisable control following these guidelines Creating a New Control by Creating a ControlTemplate. With the addition that I would extend the ContentControl base class and include a ContentPresenter at the heart of the template. The control would make the assumption that the child control is a MyMap control.

    This approach allows the entire appearance of the MapEditor control to be styled in Blend and it allows the Map control that is to be “edited” to be drap-drop onto the MapEditor as a child control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data like this: 1 2 3 4 5 9 2 6
I have a bunch of posts stored in text files formatted in yaml/textile (from
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.