I am working on some fairly large WPF project with a ton of classes and XAML design files.
But one thing is driving me nuts: The IntelliSense Binding autocompletion sometimes does not display the correct values (mostly on situations where i cannot provide the proper DataType
and nothing baked is being used like eg. the Page
content type)
Thus the actual question is: Is there some way to enforce IntelliSense to use a certain type for the autocompletion?
as random example, take this XAML:
<DataTemplate xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
DataType="{x:Type Accounting}">
<ListView ItemsSource="{Binding Payments}">
<ListView.View>
<GridView>
<!--
Auto completion still assumes the type is Accounting
and displays the properties of Accounting instead of
the required Payments.
-->
<GridViewColumn DisplayMemberBinding="{Binding Bank}"/>
</GridView>
</ListView.View>
</ListView>
</DataTemplate>
And this for the C# Classes:
public class Accounting
{
public List<Payment> Payments { get; set; }
}
public class Payment
{
public string Bank { get; set; }
}
{Binding Path=(xmlNameSpace:TypeName.PropertyName)}
to force a type and get completion on PropertyName.