问题
Dev machine: Windows 7 64bit desktop. Visual Studio 2008 Professional.
Not sure what the cause is but the behavior is this: I can develop in VS on this desktop just fine. Have done some class libraries and windows forms with no issues from what I have seen. However in WPF project I cannot get any content to render in window when I run the project. A simple hello world in wpf like this:
<Window x:Class="test"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Hello" Height="300" Width="300">
<Grid>
<TextBlock Text="Hello World" />
</Grid>
Renders an empty window with a white background. Also, I have noticed that if I resize the window the white area does not resize correctly with the window. Is this a graphics driver issue or a framework install issue or?
回答1:
As proposed by Anderson Imes in his comments, it ended up being the Video card drivers which I had installed before NVidia released a new, supposedly Windows 7 compliant, driver on July 7th. Updated the drivers and Hello World is back in business.
回答2:
I am having the exact same issue, but all was fine until just a few days ago. WPF projects just just stopped working for me, same as you describe. I suspected a recent windows update, so i uninstalled them, rebooted and still does not work. There is no available 64 bit driver available for my video card (Mobility Radeon™ X1400)
Any other suggestions out there?
回答3:
It's now 2013 and WPF Still renders a blank screen. Looks like WPF is not ready for prime time yet. Going back to browser applications.
来源:https://stackoverflow.com/questions/1258316/wpf-windows-7-64bit-no-content-rendered