Microsoft-ui-xaml: WinUI 3.0: Named elements appear in codebehind intellisense only after building the project

Created on 4 Nov 2019  ·  3Comments  ·  Source: microsoft/microsoft-ui-xaml

Describe the bug
Named elements appear only in code-behind Intellisense after building the project. Looks like the intermediate output folder is not generated/updated when editing the XAML doc.

Steps to reproduce the bug

  1. Create a new WinUI 3.0 UWP app
  2. Add this TextBox to the MainPage.xaml file
<TextBox x:Name="textBox"/>
  1. Save the file
  2. Go to MainPage.xaml.cs and go to the constructor.
  3. Type "textB", you don't get intellisense.

Build the project. Then you get intellisense.

Further tests: Go to the obj folder and navigate down to the MainPage.g.i.cs that contains the textBox field. Change the name of the textBox in the MainPage.xaml file to something else. Note that the MainPage.g.i.cs won't update after this change. The MainPage.g.i.cs file only updates after building the project.

Expected behavior
When changing the MainPage.xaml file, the MainPage.g.i.cs should be generated automatically, so that named elements can be accessed in the codebehind file without manually building the project.

Version Info
OS: Windows 10 1903
NuGet package version: Microsoft.WinUI 3.0.0-alpha.191101.0

bug team-Markup winui3α

Most helpful comment

@danzil, I can repro this in both:
Visual Studio 2019 Preview: Version 16.4.0 Preview 3.0
Visual Studio 2019: Version 16.3.6

All 3 comments

Thanks for the bug report! Any chance you could confirm your version of Visual Studio?

@danzil, I can repro this in both:
Visual Studio 2019 Preview: Version 16.4.0 Preview 3.0
Visual Studio 2019: Version 16.3.6

@danzil I'm using 16.4.0 Preview 3.0.
@kmahone Thanks, great you were able to repo it.

I've created a PR for the docs: https://github.com/MicrosoftDocs/winrt-related/pull/153

Was this page helpful?
0 / 5 - 0 ratings