c# - How to use controls from derived class in base window class -
this question has answer here:
- xaml usercontrol inheritance 2 answers
i creating base window class want use store common code our windows. know windows have text box , combo box used same purpose.
public abstract class windowbase : window { protected virtual void savetextboxvalue() { } protected textbox textboxnotes { get; set; } } public class mywindow : windowbase { public mywindow() { initializecomponent(); textboxnotes = txtnotes; // have set in every inherited class } }
is there way use textbox mywindow classes without need set in every conrete class?
in constructor of abstract class set finding first textbox in window or whatever way u want identify text box.
Comments
Post a Comment