Closed ProviceUnify closed 6 months ago
Important: solution can be buit and works fine - Bindings work. Doesn't work autocomplete exactly
Try adding the following target to your YourApp.Desktop.csproj
Unload and Lood YourApp.Desktop.csproj
or restart VS
Build solution
Try adding the following target to your
YourApp.Desktop.csproj
Unload and Lood
YourApp.Desktop.csproj
or restart VSBuild solution
Doesn't give any affect. Still no autocomplete. Tried add to YourApp.csproj
too for sure
Checked Same code on Rider Trial - works perfectly (but i cant use Rider for dev anyway). Problem is in VS extension exactly
Well. Found out reason of this bug and how to fix it. This code will have available autocomplete for bindings:
<UserControl
...
x:DataType="vm:IdentificationViewModel">
<StackPanel>
<TextBlock>Identification View!</TextBlock>
<TextBlock Text="{Binding PageName}"/> <!-- VS will suggest you "PageName" prop from VM here -->
<Button Command="{Binding ButtonBindingTestCommand}">Press me!</Button>
</StackPanel>
</UserControl>
This one WILL NOT have autocomplete for bindings:
<UserControl
...
x:DataType= "vm:IdentificationViewModel"> <!-- watch here: space(s) (or tab(s)) between x:DataType= AND "..." (value) -->
<StackPanel>
<TextBlock>Identification View!</TextBlock>
<TextBlock Text="{Binding }"/> <!-- VS will not suggest you any of your props from VM here -->
<Button Command="{Binding }">Press me!</Button>
</StackPanel>
</UserControl>
Reason was a Spaces or Tabs between x:DataType=
attribute and its value "..."
. For proper work it should be seamlessly x:DataType="..."
Reason was a Spaces or Tabs between x:DataType= attribute and its value "...". For proper work it should be seamlessly x:DataType="..."
don't know if we can have an XAML warning for this. /cc @maxkatz6
No, whitespaces should be supported there, as it's a valid XML.
Describe the bug
Autocomplete
Ctrl
+Space
for< ...={Binding ...} .../>
doesn't work in Visual Studio 2022 mostly. It works in simple solutions, in some other solutions but it is unable yo use this feature in some other solutions.Code of AlgorithmsViewModel.cs
:Code of AlgorithmsView.cs
Code of MainView.cs (part)
Code of MainViewModel.cs
To Reproduce
public type name => "value"
or using[ObservableProperty]
- not matter)...ViewModel.cs
and try to useBinding
autocompleteCtrl
+Space
Expected behavior
See variant of user defined props bottom:
BUT
Got empty list with default entries (here i have defined
PageName
prop in ViewModel also):Avalonia version
11.0.10
OS
Windows
Additional context
I already used:
I have:
x:DataType
in .axaml headerDesign.DataContext
in .axaml header