locked
ArgumentNullException was thrown on "Binding": Value cannot be null. RRS feed

  • Question

  • Hi Guys,

    Strang thing happens with Binding.

    I have model class, I define resource and use this resource in Binding.

    Model looks easy -- nothing special:

     public class ScriptVariables : ModelBase
        {
            private string _BusinessName;
            public string BusinessName
            {
                get { return _BusinessName; }
                set
                {
                    _BusinessName = value;
                    RaisePropertyChangeEvent("BusinessName");
                }
            }
    //other properties...
    }

    And XAML:

    ..
    <TextBlock Grid.Row="1" Grid.Column="2" Text="{Binding Path=BusinessName, Mode=TwoWay, Source={StaticResource ScriptVariables}}" />
    <TextBox Grid.Row="1" Grid.Column="2" Text="{Binding Path=BusinessName, Mode=TwoWay, Source={StaticResource ScriptVariables}}" />
    ...
     
    And this is error:


    Any idea whats going on?

    If I bind to TextBlock - no problem (Green arrow on the picture), but at the same time binding to TextBlock make VS2010 be upset -(((
     

    Friday, July 23, 2010 8:28 AM

All replies

  •  

        What will happen if you ignore the warning , compile and run your app anyway.

        If you app goes OK, I suggest you leave it along.

    Monday, July 26, 2010 3:21 AM
  • If I just ignore it - program works properly 

    Monday, July 26, 2010 8:45 AM
  • Hi vit100,

    I have the same problem. Dou you found the solution ?

    Tanks,

    Wednesday, December 22, 2010 4:59 AM
  • yeh, honesly i don't remember what was the reason....

    show your code, i will have a look 

    Wednesday, December 22, 2010 8:49 AM