Not sure that this is the right forum, since I suspect this is a generic Dot Net thing (?) …
I have a WPF project (although not sure that this matters). I add a new form - lets say Login
, and I add a button, named MyButton1.
In my Delphi days, I always liked to keep the Form file code limited to the raw event definitions (e.g. Initialisation, and control events, e.g. OnClick). So the Control OnClick event would just contain the method DoMyButton1OnClick. I would then add a second code file for logic related to the Login form - say MyLoginRoutines.pas. DoMyButton1OnClick would be a method in this second file.
This keeps everything clean (at least for me!)
In my current project, this second file (MyLoginRoutines) is set up with the same class as the Login (OK because the first form had the “Partial” attribute).
Now the problem —
If I select MyButton1 in the designer, and look at the properties/events, then double click on the Click event to generate the event code, that code template is generated in the second MyLoginRoutines.pas file, not in the original Login,xaml.pas file.
Is there any way to force the event to be generated in the original Login.xaml.pas file?
(Or am I doing something stupid anyway?)
Any thoughts welcome.