Grid fully covers (as a white rectangle) my WPF window after VS update

This forum is meant for questions and discussions about the X# language and tools
Post Reply
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Grid fully covers (as a white rectangle) my WPF window after VS update

Post by ic2 »

I made the mistake to update Visual Studio 2019 for the first time in a year.

Directly afterwards, in a WPF project I am working on the grid shows a large white rectangle covering half the window. I noticed that the Margins of the grid weren't quite logically chosen and I brought it back to what you see below (with a small part of the others controls within the grid). Nothing special I'd say. But now, every time I open the Design window, the grid fully covers the rest of the window, in white. The only thing which helps is select the content between the <Grid> </Grid), cut it and directly paste it again. Then I see the other controls again.

Before I post this to Answers.Microsoft or developercommunity.visualstudio.com where almost any poster will get replies like "not enough info to answer..." most of the times, I hope someone has an idea here.

It's a bit frustrating to have to select-Ctrl X-Ctrl V every time I want to see or change the Design of the window.

EDIT: I've copied the whole directory with the solution to a PC with VS2019 16.11.5 (instead of 16.11.31), an even older version, and there the WPF design windows correctly, as it did on my regular Pc before I was so stupid to update VS.

Dick

Code: Select all

<Window>
<c:comment>
This is followed by the usual WPF lines)
</c:comment>
	<Grid Margin="0,0,0,0">
		<PdfViewer:PdfViewerControl Name="pdfViewerControl" Margin="10,25,00,00" Width="1450" Height="750" Loaded="PDFControlLoaded"/>

		<CheckBox Name="checkBoxSelectPage" FlowDirection="RightToLeft" FontSize="8" ToolTip="xxx" Content="Select this page" VerticalContentAlignment="Center" Click="SelectCheckBox_Click" HorizontalAlignment="Left" Margin="9,4,0,0" VerticalAlignment="Top" Height="15" Background="CornflowerBlue" Width="89">
			<CheckBox.LayoutTransform>
				<ScaleTransform ScaleX="1.6" ScaleY="1.5" />
			</CheckBox.LayoutTransform>
		</CheckBox>
		<TextBlock Text="A" FontFamily="Wingdings 3" FontSize="25"  HorizontalAlignment="Left" Margin="156,0,0,0" VerticalAlignment="Center" Height="24" Width="26" />
	</Grid>
</Window>
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Re: Grid fully covers (as a white rectangle) my WPF window after VS update

Post by ic2 »

I eventually posted this issue in https://developercommunity.visualstudio ... e/10514707 and this time I didn't get the usual Feedback bot replies but one from a real person (Anne Yang, who seems to be Principal Engineering Group Manager at for Azure, based in Taiwan), which was great!

I eventually had to repair VS and perform a couple of tricks, no real cause - well in case you are interested in the xth time I had to solve some random VS error, just click the URL. Bottom line, it is solved for now and if anyone gets here with some random problem too, this URL may be useful.

Dick
Post Reply