Hi folks,
Nice to see you,our team are using your CSLA, and I am using Csla3.8 for Wpf binding, I have a problem when I used PropertyStatus in defining my CreateContainer view like this(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="{Bindin Path=Model.LocationId,Mode=TwoWay}".(Since I uncommented this statement,the codes run)
So which way can I use if I want to implement the validation of Property using PropertyStatus?
I think you are using Beta 1?
I do think there was a bug in Beta 1 when using dot notation to index into a property.
If you are trying to use Beta 1 for anything but testing, that is probably a mistake. Since you say this is urgent, you are probably trying to use it for more than testing :(
However, Beta 2 should be available in the next few days. I am mostly waiting to find out if the BusyAnimation bug has been resolved, and then I will release Beta 2.
I think (but I don't know for sure) that it will fix your problem.
You can always pull the latest code from the svn repository and see if your problem has been fixed. The svn path is svn://svn.lhotka.net/csla/core/branches/V3-8-x.
Thanks for your reply,but I could not access the svn://svn.lhotka.net/csla/core/branches/V3-8-x,
could you tell me the way to access it?
Hi Rocky,
I think our team is using 3.8 alpha version, not the beta1 version,
Also I differ the different version in http://www.lhotka.net/cslanet/Repository.aspx
I tried to find the your fix codes about PropertyStatus in this link, but I found that there are not any changes about in PropertyStatus between the version(svn://svn.lhotka.net/csla/core/branches/V3-8-x) and the 3.8 alpha version(which our team is just using).
In other word, the PropertyStatus.cs in the 3.8 alpha version(which our team is just using) is the latest version code base on your changes logs in the link I metioned.
also I differ the difference from the three version
Revision4288 Revision4271 Revision4267 in link
I found that the PropertyStatus codes in 3.8 alpha(which version I am just using) is same as the codes in Revision4288. (i.e. I think maybe there is a small bug in PropertyStatus needed to be fixed)
This is an urgent problem, thanks for you help.
> This is an urgent problem, thanks for you help.
How can you have an urgent problem with alpha code?
If this is really urgent then you need to help me. Remember that
CSLA .NET is free, which means there’s no support (unless you’d
like to pay for it).
You can create a small repro of this problem that occurs on Beta
1 – and by small I mean something you can put in a zip file that I can
unzip, build and run without having to download dependencies, etc. To do this
you’ll need to replicate the issue without using your DI framework –
I don’t have time to sift through complex UI/config code. In other words,
I’m not going to get pulled into debugging interactions with some random
UI framework that’s not included in the .NET standard install.
If you get me such a repro I’ll look at it and try to
identify/fix the issue.
Actually the simplest thing for you and me is if you can take the MVVMexperiment solution (SL or WPF) and get it to fail.
This app already uses the "Model.Property" syntax with PropertyStatus. And you can easily change the DataListViewModel constructor to not create an instance of the Model, which means it will be null.
But that works - having a null Model value is perfectly acceptible - so I'm having a hard time understanding or replicating your issue.
Hmm. I thought perhaps the problem was that the DataContext itself was null. But that doesn't trigger the problem either - I just created a simple XAML form that uses PropertyStatus with dot notation for the property name, with no DataContext at all:
<UserControl x:Class="SilverlightApplication3.MainPage"
xmlns:csla="clr-namespace:Csla.Silverlight;assembly=Csla"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
<Grid x:Name="LayoutRoot">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBox Text="{Binding Path=Model.Name, Mode=TwoWay}" Width="150" Margin="5"/>
<csla:PropertyStatus Property="{Binding Path=Model.Name}" Margin="5" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBox Text="{Binding Path=Model.City, Mode=TwoWay}" Width="150" Margin="5"/>
<csla:PropertyStatus Property="{Binding Path=Model.City}" Margin="5" />
</StackPanel>
</StackPanel>
</Grid>
</UserControl>
Clearly when this form is initialized it will create the PropertyStatus controls along with the TextBox controls, and DataContext is null, because it is never set to anything (there's not even a business class in this project).
But this works fine too - so DataContext being null is OK, and Model being null is OK (based on the MVVMexperimentSL project).
So I'm really at a loss as to what your app is doing to get something to be null...
Copyright (c) Marimer LLC