I want to make sure I'm not missing something here....
You have a class (Customer - perhaps implemented in "Customer.cs") that holds the data for a Customer/PrizeList. You want to be able to access this class in the event handler?
Can't you just declare a variable in the class (class global), then create a new instance of the class in the "Window_Loaded" event of the form (and do whatever you need to do to load the data)? You can then use this instance down in the event handler for "CellEndEdit"? Something like this:
public partial class MainWindow : Window
{
private Customer c_oCust = null;
public MainWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
c_oCust = new Customer("Bob");
}
private void cmdOK_Click(object sender, RoutedEventArgs e)
{
if (c_oCust.TestCust(textBox1.Text))
{
MessageBox.Show("Yay!");
}
else
{
MessageBox.Show("The name in the object is: " + c_oCust.ToString());
}
}
}
That is, if the variable holding the instance of the "Customer" class is stored at the class level, any event handlers/methods should be able to see it.
Hopefully I'm not off the mark here and this helps.