简体   繁体   中英

XAML not refreshing in Visual Studio

I have an issue with my XAML window in Visual Studio 2017, however the issue is only happening in one of my two projects.

I have a <grid> in both projects and I had many rows in said grid, so in an effort to clean up my code I found https://rachel53461.wordpress.com/2011/09/17/wpf-grids-rowcolumn-count-properties/ which allows me to specify the columns and rows like this:

<Grid Common:GridHelpers.ColumnCount="2"
      Common:GridHelpers.StarColumns="0"
      Common:GridHelpers.RowCount="14">
...
</Grid>

Now in my program where everything works you see the following:

工作的

Now in my program where the XAML in Visual Studio is failing:

不工作

As you can see, for some reason, in one of the projects the XAML window doesn't seem to know how many rows I have defined, yet I know it works properly because in the other project it displays it as expected.

When I run the program, the grid is drawn correctly at run time, this is purely a XAML issue, but I have no error messages, no warnings, it simply doesn't draw in Visual Studio correctly for one of my two projects.

  • The code is identical between projects
  • I've restarted Visual Studio
  • I've rebooted the computer
  • The actual code dependency code is in a DLL that is shared between the two applications so I know it's not that
  • It executes and displays properly when running the application
  • I've done a clean and rebuild all
  • I've manually deleted the bin/obj folders in the front end UI
  • The two projects were actually copies of each other, ironically the one that works is the copy and the one that is failing was the original

Does anyone have any ideas why Visual Studio isn't doesn't seem to realize how many rows there are defined for one project but it does for another?

I found my issue, in case someone else encounters this problem.

In my project that was having a problem, I had previously clicked the "Disable project code" in the XAML window so it wasn't executing the required custom code.

Here's an image I found on Google:
禁用

Whoops!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM