Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6909241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:39:53+00:00 2026-05-27T08:39:53+00:00

Im developing a desktop application in WPF that relies on a webservice to log

  • 0

Im developing a desktop application in WPF that relies on a webservice to log in and get license information. This means that the user logs in and i build a client side (in my desktop application) object with the licensing and the login date etc.

Im using StructureMap and want to pass my IMyUser implementation into my ViewModels constructor (constructor DI). My question is this, where should i put my initialization of my structure map if im to pass my IMyUser implementation into the constructor?

Im thinking after i login and have created the IMyUserObject i can configure StructureMap and pass it the instance of my user object. This would be somewhat “late” in my application (normally i put it in my app class, so its run as the first thing within my application).

If this is not the proper way to utilize the IMyUser and DI please advice, also alternative solitions would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:39:54+00:00Added an answer on May 27, 2026 at 8:39 am

    As this is a question about authorization I think it would be much better handled by a custom IPrincipal implementation.

    When the application starts up, assign an implementation to Thread.CurrentPrincipal. This initial instance should not authorize the user.

    When the user has logged in and received the license information, replace or update Thread.CurrentPrincipal to authorize the user to use the application.

    This is an example of the Ambient Context pattern. You don’t need to involve StructureMap in this interaction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a Java Desktop Application. In the GUI, I want that user
We have a dilemma; developing desktop application using Matisse or Jigloo.. Matisse has this
I am developing a Java Desktop Application . This app needs a configuration to
I am developing a Java Desktop Application and want a light database that can
I am developing a desktop application that will need to collect data (from the
I'm a newbie to WPF and I'm developing a brand new windows desktop application
I'm developing a desktop application. For that I'm creating class libraries. At the development
Im developing desktop java application using maven. I got a *.properties file that I
I am in the process of developing a desktop application that needs a database.
I am developing a desktop application with a MainForm that's grown rather large. There

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.