how to use PropertyStatus in CSLA3.8

how to use PropertyStatus in CSLA3.8

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


HenryYu posted on Thursday, October 22, 2009

Currently, I have not find the approach to use PropertyStatus in CSLA3.8, and this is an urgent problem, thanks very much to who could you help me.

I used PropertyStatus in defining my CreateContainer view by this way(it is metioned in http://www.lhotka.net/cslabugs/edit_bug.aspx?id=492):

<csla:PropertyStatus Property="{Bindin Path=Model.LocationId,Mode=TwoWay}"  TargetControl="{Binding ElementName=LocationIdTextBox}" />

 

But when I  executed this statement to get my defined view:

createContainerWin.Content = _container.Resolve<IContainerEditViewModel>().View

It throw an exception(Resolution of the dependency failed, type = "CambridgeSoft.COE.Inventory.Modules.ContainerModule.Interfaces.IContainerEditViewModel", name = "". Exception message is: The current build operation (build key Build Key[CambridgeSoft.COE.Inventory.Modules.ContainerModule.ContainerActions.ContainerEditViewModel, null]) failed: Object reference not set to an instance of an object. (Strategy type BuildPlanStrategy, index 3)

which seemed like the progress creating view,Also I found the true reason is about this using way :PropertyStatus Property="{Binding Path=Model.LocationId,Mode=TwoWay}".

 

Through my debugging program, I think the true reason is in SetSource() in PropertyStatus class.

_source = GetRealSource(binding.DataItem, _bindingPath);  

 

Since binding.DataItem always return null.

I think binding.DataItem should return Container object by our right configration to <csla:PropertyStatus>node.

 

Also I used it by this way <csla:PropertyStatus Grid.Row="1" Grid.Column="2" Property="{Binding Path=Model.ContainerName,Mode=TwoWay,Source=Model}"
                                     TargetControl="{Binding ElementName=NameTextBox}" />

 

the code still can not run.

 

 

But currently I have not find the right configuration approach to resolve this.

RockfordLhotka replied on Thursday, October 22, 2009

This seems like a duplicate post from http://forums.lhotka.net/forums/thread/37347.aspx?

Copyright (c) Marimer LLC