Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am designing an WPF app shell using MEF. I would like to have the app start a "view" upon startup. I also would like the option of having another add-in have a "startup" attribute and then the app would load that one instead. I've made an interface:

[InheritedExport]
public interface IStartupParams
{
    /// <summary>Gets or sets the WindowMode property.</summary>
    WindowMode WindowMode { get; set; }

    /// <summary>Gets or sets the NavigateUri property.</summary>
    string NavigateUri { get; set; }

    /// <summary>Gets or sets the Priority property.</summary>
    int Priority { get; set; }
}

So the app would load multiple IStartupParams concrete classes and select the one with the highest priority.

What do you guys thing about this design? Any ideas?

share|improve this question
add comment

1 Answer

Since you like the startup of items of your app to be configured, I would most certainly push out these configuration items into an external source (appsettings). That way you are able to restore original startup without having to hardcode anything and it will also be easy to accomodate the extensibility and priorities you're describing.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.