mauede
Well-known member
I am trying to convert a working Console UI application into a WPF one. I use an s/w library from Varian Medical Systems, called Velocity API, whose documentation is scarce and somewhat misleading. Velocity API hardcoded logic is built on context. My Console UI application calls several sequential Velocity API methods. However, a GUI must allow for consistent, event-driven actions.
I need one, maybe more, “state” variables to update the context expected by each Velocity API method. I declare most of the properties “public” and accessed through {get; set;}. I do not have a clear understanding of how such properties work. For example, one of my “state” variables is a Boolean variable called “FirstPass” that Is to distinguish between the first time a patient’s CT scan has been selected and the user’s second or n_th choice. Failure to provide the expected context causes the system to throw a memory access violation exception upon calling a Velocity method. The above-mentioned property is defined as follows:
This property must be set “true” at the application start time and when another patient‘s data is loaded. It must be set “false” after a CT scan has been selected. Unluckily, the runtime value of such a state variable, which I check through the debugger, Is not what I expect. I attribute that to my not clear understanding of the {get; set;} mechanism. I am afraid I am not using it correctly. I would appreciate some clarifying explanations and examples. Thank you very much in advance.
I need one, maybe more, “state” variables to update the context expected by each Velocity API method. I declare most of the properties “public” and accessed through {get; set;}. I do not have a clear understanding of how such properties work. For example, one of my “state” variables is a Boolean variable called “FirstPass” that Is to distinguish between the first time a patient’s CT scan has been selected and the user’s second or n_th choice. Failure to provide the expected context causes the system to throw a memory access violation exception upon calling a Velocity method. The above-mentioned property is defined as follows:
C#:
private bool _firstPass;
public bool FirstPass
{
get {return _firstPass;}
set {_firstPass = value;}
}
Last edited by a moderator: