I am creating a base window class that I want to use to store the common code for all our windows. I know all windows have text box and combo box that are used for the 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; // Now I have to set this in every inherited class
}
}
Is there a way to use the TextBox from the MyWindow classes without the need to set it in every conrete class?