You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When developing an Xamarin.Forms application, we often tend to set the binding context by injection or some kind of service that handles orchestration of views - viewmodels. One of the challanges when working with the XAML is making sure bindings are correct and not getting help from the IDE when you go to definition on the properties in the IDE.
One helpful way is using x:DataType. It helps you with compiling the binding and it will give an error when something is wrong.
When using this in a Datatemplate, you do get intellisense. When using it on a page or a contentview, there is no intellisense. There is no help from the IDE when you go to definition of the bindings, you end up in object, not to the class that holds the properties.
A workaround for me is to use the old WPF trick of using dblend:DataContext. This helps intellisense, but it feels unesseary when x:Datatype could provide the same behavior. Go to definition would also be extremely helpful, as you often want to inspect the binding target directly from the binding in the XAML.
When starting off MAUI we can make sure that this is in place from the start, so I wanted to create the feature request issue here to highlight it.
This is most likely a visual studio feature support, but I want to flag it here as well. 👍
here is a Xamarin.Forms issue that highlight the same feature request.
This discussion was converted from issue #97 on September 14, 2020 20:30.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
When developing an
Xamarin.Forms
application, we often tend to set the binding context by injection or some kind of service that handles orchestration of views - viewmodels. One of the challanges when working with the XAML is making sure bindings are correct and not getting help from the IDE when you go to definition on the properties in the IDE.One helpful way is using
x:DataType
. It helps you with compiling the binding and it will give an error when something is wrong.When using this in a
Datatemplate
, you do get intellisense. When using it on a page or a contentview, there is no intellisense. There is no help from the IDE when you go to definition of the bindings, you end up inobject
, not to the class that holds the properties.A workaround for me is to use the old WPF trick of using dblend:DataContext. This helps intellisense, but it feels unesseary when
x:Datatype
could provide the same behavior. Go to definition would also be extremely helpful, as you often want to inspect the binding target directly from the binding in the XAML.When starting off MAUI we can make sure that this is in place from the start, so I wanted to create the feature request issue here to highlight it.
This is most likely a visual studio feature support, but I want to flag it here as well. 👍
here is a Xamarin.Forms issue that highlight the same feature request.
Beta Was this translation helpful? Give feedback.
All reactions