Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Code extension reports errors for valid usage of BindingExtension with x:DataType in MAUI XAML #1131

Closed
simonrozsival opened this issue May 17, 2024 · 2 comments
Labels
area-maui bug Something isn't working

Comments

@simonrozsival
Copy link
Member

Type: Bug

For the following XAML code, VS Code extension will report an error message XLS0413. The XAML is correct and this error message should not be displayed. The MAUI app builds correctly, XamlC doesn’t report any errors:

<Button Text="{Binding Text, x:DataType=Label}" />

The error message:

The property 'DataType' was not found in type 'BindingExtension'.(XLS0413)

Similarly, the extension reports an unsubstantiated warning for the following (unusual) XAML:

<Button>
  <Button.Text>
    <BindingExtension Path="Text" x:DataType="Label" />
  </Button.Text>
</Button>

The warning message:

The attribute 'DataType' from the XAML namespace is not defined. (XLS1102)

Contrary to expectations, the following XAML, which isn’t correctly understood by the MAUI XamlC compiler, doesn’t produce any warnings:

<Button>
  <Button.Text x:DataType="Label">
    <BindingExtension Path="Text" />
  </Button.Text>
</Button>

Extension version: 0.11.94
VS Code version: Code 1.89.1 (dc96b837cf6bb4af9cd736aa3af08cf8279f7685, 2024-05-07T05:14:32.757Z)
OS version: Darwin arm64 23.4.0
Modes:

System Info
Item Value
CPUs Apple M1 Max (10 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 4, 7, 7
Memory (System) 32.00GB (0.30GB free)
Process Argv /Users/simonrozsival/Projects/dogfooding/MyDailyPriorities --crash-reporter-id d2e2bec8-5081-4be8-b73a-9e3b61ff94de
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
tftest:31042121
vstes627:30244334
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:31000450
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
chatpanelc:31048052
dsvsc021:30996838
724cj586:31013169
pythoncenvpt:31049070
fchga941:31046352
pythonprc:31047982
dwnewjupytercf:31046870
26j00206:31048877

@mgoertz-msft
Copy link
Member

<Button Text="{Binding Text, x:DataType=Label}" />

Verified that this is fixed in the latest C# extension v2.34.12

@simonrozsival
Copy link
Member Author

I confirm the issue is resolved. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-maui bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants