MarimerLLC / csla

A home for your business logic in any .NET application.
https://cslanet.com
MIT License
1.24k stars 395 forks source link

Add FriendlyName property to XAML PropertyInfo component #1526

Open rockfordlhotka opened 4 years ago

rockfordlhotka commented 4 years ago

As per this thread.

The Blazor PropertyInfo component has a FriendlyName property. There should be an equivalent property in the Csla.Xaml.PropertyInfo component as well.

Freelancingonupwork commented 2 months ago

May I know, How to Test This code?

rockfordlhotka commented 1 month ago

Testing the UI components via unit testing can be difficult, and so it is often best to test them in one of the sample projects.

You may be able to use the WpfExample sample. A PropertyInfo control could be added to the PersonEditPage, and the new property could be used to set the "Name" value via binding instead of having it hard-coded.

https://github.com/MarimerLLC/csla/blob/cf09bc4c90e31e7cac61f10cf7348e3c1bd4c23f/Samples/WpfExample/WpfExample/Pages/PersonEditPage.xaml#L19

Freelancingonupwork commented 1 month ago

Hello, Can you Explain this issue in detail? I have check both Classes (Blazor and xaml). and they are not similar. Like PropertyName is not as field for .net. Constructor or GetPropertyInfo() is not available.

rockfordlhotka commented 1 month ago

They are different because they support different UI frameworks, and because the WPF implementation is a lot older (from around 2006 probably).

At the time, XAML data binding was very exciting and powerful. And it remains powerful, but not as easy as Blazor for sure!

Also, the XAML PropertyInfo control supports both WPF and MAUI, and there are some differences in XAML binding behaviors between those two UI frameworks.

I don't think that this change should be difficult though. If you look at the InformationText property (for example), you can see how the PropertyInfo control implements a property that can be used for data binding from other XAML elements in a page.