Open rockfordlhotka opened 4 years ago
May I know, How to Test This code?
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.
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.
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.
As per this thread.
The Blazor
PropertyInfo
component has aFriendlyName
property. There should be an equivalent property in theCsla.Xaml.PropertyInfo
component as well.