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 8016277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:29:41+00:00 2026-06-04T20:29:41+00:00

My WPF program uses a third party map package which has a WPF map

  • 0

My WPF program uses a third party map package which has a WPF map control. My program needs to be able to run on a system which does not have this software installed, and it needs to be smart enough to recognize when the software is installed and use it. This means that I can’t include any XAML for the map control in my form’s XAML file or XAML parse exceptions are thrown.

I have a technique for determining if the software is installed. In my program’s initialization code, I set a property of the Application object called MapsAreInstalled to true if the mapping software is installed, and I set it to false if it is not.

In my form, which is a UserControl, I’ve added an override of the OnApplyTemplate method. This checks the value of the MapsAreInstalled property and creates a new map control if the value is true. Here’s the XAML that I was using to create this control before it became obvious that I had to change my approach:

<telogis:MapControl ButtonBase.Click="CarImage_Click"
                    Canvas.Left="0"
                    Canvas.Top="0"
                    Center="41.366674544084,-73.6112966322899"
                    DragBehavior="None"
                    Heading="0"
                    Height="{Binding ElementName=ChannelCanvas, Path=ActualHeight}"
                    MapQuality="Perfect"
                    Name="ReadMap"
                    Perspective="TwoD"
                    RenderLabels="True"
                    UiEnable="True"
                    Width="{Binding ElementName=ChannelCanvas, Path=ActualWidth}"
                    Zoom="50" />

I know how to initialize all of these properties in the code behind EXCEPT the ButtonBase.Click event handler. How do I set this up in the code-behind?

Tony

  • 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-06-04T20:29:42+00:00Added an answer on June 4, 2026 at 8:29 pm

    I found the answer to this one:

    RoutedEventHandler clickHandler = MyClickHandler;
    mapCtrl.AddHandler( ButtonBase.ClickEvent, clickHandler );
    

    Thanks anyway.

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

Sidebar

Related Questions

I'm making a C# WPF program, and my program has to be able to
I have a WPF application that uses a third-party library to perform a specific
I am keen to create a new program that uses WPF Ribbon with C#.
I made a WPF/C# program and I am using the internet control for WYSIWYG
I am writing a WPF program in C# in which I have a ListView
Say, I have a WPF program with a Windows Forms control in WindowsFormsHost on
A WPF program I'm writing in C# has the following interface on the back-end:
I have a wpf program in c# that has a combobox with various colors
I have a WPF program with two listviews which display information from two different
I have a program that uses a licence system for its users. Now I

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.