Home > Net >  A c # under the online demo of WPF, the display will object reference not set to an instance of an o
A c # under the online demo of WPF, the display will object reference not set to an instance of an o

Time:09-26

As shown in figure, a c # under the online demo of WPF, the display will object reference not set to an instance of an object, could you tell me how to solve?

CodePudding user response:

Installation steps:

Via NuGet GUI (right-click on your project, click the NuGet package management, choice of online and search MahApps. Metro) or a package manager console:

PM> Install - Package MahApps. Metro

CodePudding user response:

Nuget package already all reduction but still won't do

CodePudding user response:

Check the app. The xaml code if there is a format error, etc

CodePudding user response:

The compiler MahApps. Metro is difficult, and suggest download version 1.6.5 source, to empty the machine nuget cache open the solution after compile,

If you just want to use MahApps Metro, and through the demo to study its using method,
Before it is best at compile MahApps. Metro out of solution, leaving only the Demo project.
Then for the Demo project reference MahApps. Metro 1.6.5 version of the nuget package

Can skip the MahApps. So the compilation of the Metro itself, reduce compilation fails.

CodePudding user response:

reference 4 floor JDD1997 response:
MahApps. Metro is difficult to compile, recommended download version 1.6.5 source, to empty the machine nuget cache open the solution after compile,

If you just want to use MahApps Metro, and through the demo to study its using method,
Before it is best at compile MahApps. Metro out of solution, leaving only the Demo project.
Then for the Demo project reference MahApps. Metro 1.6.5 version of the nuget package

Can skip the MahApps. So the compilation of the Metro itself, reduce compile failed.

Use is 1.6.5 version

CodePudding user response:

Is commonly, an error object is null
To view the object from where come of, is it possible to null
Assume an error object obj, sometimes need
 
If (obj!=null)
{
Contains the obj code;
}

Try this one instead
  •  Tags:  
  • C#
  • Related