Home > Net >  Everyone a great god, and consult the program Exception_WasThrown problem
Everyone a great god, and consult the program Exception_WasThrown problem

Time:10-14

Application System is put forward. StackOverflowException: "Exception_WasThrown" how should I change? Request to help beginners c #





Using System;
using System.Collections.Generic;
Using System.Com ponentModel;

The namespace DrawC
{
Internal class JsonClass: INotifyPropertyChanged
{
Public string RunNum
{
The get
{
Return this. RunNum;
}
Set
{
Enclosing RunNum=value;
Enclosing NotifyPropertyChange (" RunNum ");
}
}
Public bool UseNorepeat
{
The get
{
Return this. UseNorepeat;
}
Set
{
Enclosing UseNorepeat=value;
}
}
Public string LuckMan
{
The get
{
Return this. LuckMan;
}
Set
{
Enclosing LuckMan=value;
LuckMan enclosing NotifyPropertyChange (" ");
}
}
Public string SaveText
{
The get
{
Return this. SaveText;
}
Set
{
Enclosing SaveText=value;
Enclosing NotifyPropertyChange (" SaveText ");
}
}
Public List Jsonroot
{
The get
{
Return this. Jsonroot;
}
Set
{
this. Jsonroot=value;
}
}
Public JsonClass ()
{
Enclosing Jsonroot=new List (a);
Enclosing LuckMan="personnel in the draw";
Enclosing RunNum=0 "individual";
Enclosing UseNorepeat=true;
}
The public event PropertyChangedEventHandler PropertyChanged;
Private void NotifyPropertyChange (string propertyName)
{
If (this. PropertyChanged!=null)
{
Enclosing PropertyChanged (this, new PropertyChangedEventArgs (propertyName));
}
}

}
}

CodePudding user response:

Your property value for the get method, returns the attribute value itself, this belongs to the recursive loop, cause stack overflow, should define a private variable stores attribute values, the get method returns the value of private,
  •  Tags:  
  • C#
  • Related