Share via

Binding in xaml

GerritV_IT 21 Reputation points
2021-03-05T12:35:59.12+00:00

Have made a app with serveral bindings in xaml thrue a class from the model or ViewModel folder. But last it cost me a lot of time and searching why I did not get and see value. The problem was, had made a typo mistake in xaml with the name of the property from a class in one of these folders. When coding have always to less time, so a typo is easy to made. Is there a way IntellenseSense can help me with that, otherwise than not making a typo mistake of copy/paste the propertyName

Developer technologies | .NET | Xamarin
Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.

0 comments No comments

Answer accepted by question author

JessieZhang-MSFT 7,721 Reputation points Microsoft External Staff
2021-03-08T06:44:04.943+00:00

Hello,

Welcome to our Microsoft Q&A platform!

For this, you can add event DelegateLogListener to get the log in the Output Window.

We just need to add the following code in file App.xaml.cs:

  Xamarin.Forms.Internals.Log.Listeners.Add(new DelegateLogListener((arg1, arg2) => Debug.WriteLine(arg2)));  

The full code is :

   public App()  
{  
 // Where the magic happens…   
 Xamarin.Forms.Internals.Log.Listeners.Add(new DelegateLogListener((arg1, arg2) => Debug.WriteLine(arg2)));  
  
 InitializeComponent();  
  
 MainPage = new MainPage();  
}  

You can check article Detecting Xamarin.Forms Binding Errors in the Output Window.

And you can also find a sample at the bottom of above link: https://github.com/jfversluis/BindingFailureOutputSample

For more details,you can check:

https://github.com/xamarin/Xamarin.Forms/issues/2639

Best Regards,

Jessie Zhang

---
If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.