WPF View not rendering on changing contentControl bound property
I am changing user controls on my main window using a bound property on a content control.

XMAL:  

    <ContentControl Grid.Row="0" Content="{Binding MainContent, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"></ContentControl>

PROPERTY:
    
    private UserControl _mainContent;
    public UserControl MainContent
    {
      get
      {
        return _mainContent;
      }
      set
      {
        _mainContent = value;
        OnPropertyChanged();
      }
    }

CODE BEHIND:

    MainContent = new TestUserControl();

ON PROPERTY CHANGED:

        public event PropertyChangedEventHandler PropertyChanged;

    protected virtual void OnPropertyChanged(string propertyName)
    {
      if (this.PropertyChanged != null)
      {
        this.PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
      }
    }

    protected virtual void OnPropertyChanged()
    {
      string propertyName = new System.Diagnostics.StackTrace().GetFrame(1).GetMethod().Name.Substring(4);
      OnPropertyChanged(propertyName);
    }

My Problem is that on one specific test machine (similar to others, nothing unique or strange about it. Windows 7, 4GB Ram etc), when changing the usercontrols using this mechanism, the application hangs. 

Looking at my logs, the Change command is received, the new user control is instantiated, the constructor runs. The Main Content Property is set, the OnPropertyChanged event fires

and then nothing. The application hangs and windows says its not responding and closes the app.

The OnLoaded event of the user control never gets fired.

This happens on loading any user control this way on the specific machine.

Ideas, comments are all welcome. Idea how to debug this one are welcome.


WPF View not rendering on changing contentControl bound property
===

I am changing user controls on my main window using a bound property on a content control.

XMAL:  

    <ContentControl Grid.Row="0" Content="{Binding MainContent, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"></ContentControl>

PROPERTY:
    
    private UserControl _mainContent;
    public UserControl MainContent
    {
      get
      {
        return _mainContent;
      }
      set
      {
        _mainContent = value;
        OnPropertyChanged();
      }
    }

CODE BEHIND:

    MainContent = new TestUserControl();

ON PROPERTY CHANGED:

        public event PropertyChangedEventHandler PropertyChanged;

    protected virtual void OnPropertyChanged(string propertyName)
    {
      if (this.PropertyChanged != null)
      {
        this.PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
      }
    }

    protected virtual void OnPropertyChanged()
    {
      string propertyName = new System.Diagnostics.StackTrace().GetFrame(1).GetMethod().Name.Substring(4);
      OnPropertyChanged(propertyName);
    }

My Problem is that on one specific test machine (similar to others, nothing unique or strange about it. Windows 7, 4GB Ram etc), when changing the usercontrols using this mechanism, the application hangs. 

Looking at my logs, the Change command is received, the new user control is instantiated, the constructor runs. The Main Content Property is set, the OnPropertyChanged event fires

and then nothing. The application hangs and windows says its not responding and closes the app.

The OnLoaded event of the user control never gets fired.

This happens on loading any user control this way on the specific machine.

Ideas, comments are all welcome. Idea how to debug this one are welcome.

