Csla 41 Unable to access Protected object

Csla 41 Unable to access Protected object

Old forum URL: forums.lhotka.net/forums/t/10620.aspx


tzfj7l posted on Wednesday, August 17, 2011

Hi Rocky,

I am migrating my application from Csla version # 3.6.1.0 to 4.1.0.0 along with .Net 2008 to 2010. I  have problems in the following class.

Csla.Xaml. Property Status

in 3.6  Object Source and DependencyObject Target are public where as in 4.1 Object Source is protected and there is no Dependency object Target. Could you please let me know how to fix this one. Thank you.

 

 

 

 

 

 

 

 

 

private 

 

void SetStatusControl()

{

 

 

   if (Template != null && DesignModeHelper.IsInDesignMode == false)

   {

 

    PropertyStatus status = this.GetTemplateChild("PART_PropertyStatus") as PropertyStatus;

    if (status != null)

     {

 

 

            if  (IsValidatable)

           {

                status.Property =

this.ValidationPropertyName;

                status.Source =

this.DataContext; // (object Source is protected cannot access)

                dataContext =

this.DataContext;

            }

             status.Target =

this;   // (does not contain a definition for Target in 4.1)

       }

   }

}

RockfordLhotka replied on Wednesday, August 17, 2011

The PropertyStatus control was largely rewritten from 3.6 to 3.8. Please look at the current sample apps in the Samples download - several of them use the current PropertyStatus control.

Copyright (c) Marimer LLC