使用 Prism 将 InitParams 读取到服务中
我正在构建一个 Silverlight 应用程序,它采用单个 InitParam,该 InitParam 将在整个应用程序中使用(至少在许多服务中)。我们正在考虑使用 Prism 构建应用程序,我想知道的是 - 我们如何实例化一个接受此参数并使其全局可用的服务?
I am building a Silverlight application that takes a single InitParam that will be used throughout an application (at least in a number of services). We are looking at building the app using Prism and what I would like to know is - how do we instantiate a service that takes this parameter and makes it globally available?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是在问如何读取 InitParams 或者读完后应该用它做什么?要读取它,您可以在 Application.Startup 事件的 StartupEventArgs 中访问它。
一旦你把它拿出来,我想你可以将它作为命名字符串添加到你的容器中。或者您可以将 StartupEventArgs 粘贴到容器中并根据需要访问它。
Are you asking how to read the InitParams or what you should do with it once you've read it? To read it, you access it in the StartupEventArgs in the Application.Startup event.
Once you get it out, I suppose you could add it to your container as a named string. Or you could just stick the StartupEventArgs in the container and access it as needed.