wpf - How could I reuse my code behind? -


i have 2 controls quite different layout, xaml structure quite similar (same kind of containers , same element names), their code behind identical. unfortunately, far, had repeat code event handlers on each of 2 classes.

i in process of extracting common functionality satellite classes, using composition, still redundancy of constructors, field declarations, , initialization bothers me lot.

so question boils down to:

is there way avoid redundant code behind code when 2 usercontrols have layout differences, identical code-behind?

wpf seperates concerns using controltemplate can changed. "code-behind" behavior. not need viewmodel that.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -