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

  • SEARCH
  • Home
  • 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 645519
In Process

The Archive Base Latest Questions

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

I am using silverlight, My code is set up for a usercontrol as follows:

  • 0

I am using silverlight, My code is set up for a usercontrol as follows:

myxaml.xaml (Just showing the toggle button [line 119])

<ToggleButton x:Name="btnToggleResizeMap" Checked="btnToggleResizeMap_Checked" Unchecked="btnToggleResizeMap_Unchecked" IsChecked="True"/>

codebehind.cs

public partial class MapRadar : UserControl
{

    public delegate void OnMapExpandChange(object sender, EventArgs e);
    public event OnMapExpandChange Expanded;
    public event OnMapExpandChange NotExpanded;

    private void btnToggleResizeMap_Checked(object sender, System.Windows.RoutedEventArgs e)
    {
        NotExpanded(this, null); //If i remove this line, the app runs fine
    }

    private void btnToggleResizeMap_Unchecked(object sender, System.Windows.RoutedEventArgs e)
    {
        Expanded(this, null); //If i remove this line, the app runs fine
    }
}

Visual studio throws this error before the application is completely loaded:

AG_E_PARSER_BAD_PROPERTY_VALUE [Line: 119 Position: 285]

at:

System.Windows.Application.LoadComponent(this, new System.Uri("/Xormis.Silverlight.ExSys;component/Views/Map/MapRadar.xaml", System.UriKind.Relative));

which is located inside a function named public void InitializeComponent()

I have no idea what is happening here, is there something against having event calls inside another event?

  • 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-13T21:30:42+00:00Added an answer on May 13, 2026 at 9:30 pm

    The problem is that you have null events. As soon as the checkbox is created, it immediately raises the Unchecked event, which calls your btnToggleResizeMap_Unchecked handler, which tries to call your Expanded event. Since Expanded is null, an exception is thrown, and it never finishes running the XAML.

    Your code should look like this:

    private void btnToggleResizeMap_Checked(object sender, System.Windows.RoutedEventArgs e) 
    {
        if (NotExpanded != null) 
            NotExpanded(this, null);
    } 
    
    private void btnToggleResizeMap_Unchecked(object sender, System.Windows.RoutedEventArgs e) 
    {
        if (Expanded != null)
            Expanded(this, null);
    } 
    

    For a more thorough description of events, see C# Events and Thread Safety

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

Sidebar

Related Questions

I have been writing unit tests using NUnit and Moq with my Silverlight code
I am using Visual Studio 2010 to create a Silverlight 4 application. I set
I am using a custom default button attached behaviour (as defined here: Silverlight 4
I'm trying to set seletected value to a pre-loaded combobox using silverlight with MVVM.
I'm using Silverlight 4. I have a UserControl whose LayoutRoot is wrapped in a
I'm using Silverlight 4. I have a UserControl whose LayoutRoot is wrapped in a
I'm learning Silverlight using Silverlight 2.0 Unleashed + Silverlight 4.0 Unleashed and, well, just
I'm using the MVVM Light Toolkit with Silverlight. On my UserControl I have a
When using Silverlight 4, is it possible to set an Image to an absolute
I'm using Silverlight toolkit to set the styling for my whole application. 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.