How do I programatically create an event handler with the name as a variable?
<p>For example:</p>

<pre><code>MySlider.ValueChanged += new RoutedPropertyChangedEventHandler&lt;double&gt;(Slider_ValueChanged);
</code></pre>

<p>The above is well and good except that without a 'Slider_ValueChanged' method present it won't compile.  More than that if I want to programatically create several sliders I might want to give them different handlers with different names.</p>

<p>Ideally I'd like to do something like:</p>

<pre><code>var x = some_handler;
MySlider.ValueChanged += new RoutedPropertyChangedEventHandler&lt;double&gt;(x);
</code></pre>

<p>The basic idea is just to return programatically preconfigured panels of sliders on demand that I can just swap in and out depending on user selected options.  The actual implementation of the event handlers for the programatically created sliders will already be present in the project.</p>

<p>Corrected the code as per Matthew Walton's answer below.</p>
