Code Monkey home page Code Monkey logo

Comments (7)

ProviceUnify avatar ProviceUnify commented on August 15, 2024

Important: solution can be buit and works fine - Bindings work. Doesn't work autocomplete exactly

from avaloniavs.

workgroupengineering avatar workgroupengineering commented on August 15, 2024

Try adding the following target to your YourApp.Desktop.csproj

https://github.com/AvaloniaUI/Avalonia/blob/fde8a65157cd9242c1cc0f70f9c9f2705cf56757/packages/Avalonia/AvaloniaBuildTasks.targets#L238-L254

Unload and Lood YourApp.Desktop.csproj or restart VS

Build solution

from avaloniavs.

ProviceUnify avatar ProviceUnify commented on August 15, 2024

Try adding the following target to your YourApp.Desktop.csproj

https://github.com/AvaloniaUI/Avalonia/blob/fde8a65157cd9242c1cc0f70f9c9f2705cf56757/packages/Avalonia/AvaloniaBuildTasks.targets#L238-L254

Unload and Lood YourApp.Desktop.csproj or restart VS

Build solution

Doesn't give any affect. Still no autocomplete. Tried add to YourApp.csproj too for sure

from avaloniavs.

ProviceUnify avatar ProviceUnify commented on August 15, 2024

Checked Same code on Rider Trial - works perfectly (but i cant use Rider for dev anyway). Problem is in VS extension exactly

from avaloniavs.

ProviceUnify avatar ProviceUnify commented on August 15, 2024

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="..."

from avaloniavs.

timunie avatar timunie commented on August 15, 2024

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

from avaloniavs.

maxkatz6 avatar maxkatz6 commented on August 15, 2024

No, whitespaces should be supported there, as it's a valid XML.

from avaloniavs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.