I have 4+ imported properties in a class and some code that needs at least 4 properties to execute
Are there any PRISM or MEF events that would help instead of putting notify on each setter and then checking for nulls ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can have your class implement the IPartImportsSatisfiedNotification interface. Then the OnImportsSatisfied method will be called once all the imports have been satisfied. Put your “post-build” code in this method.
This way you know all your parts have been imported and that it is safe to use them.