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

  • SEARCH
  • Home
  • 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 7544343
In Process

The Archive Base Latest Questions

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

This questions is not really about code but application design. I have an app

  • 0

This questions is not really about code but application design.
I have an app that needs authentication, to do that I have a pop up that appears on the main page when the user is not logged in.

My question is how to make this right, following the mvvm pattern. I think that the popup control should be in the code behind of the view, but who sends the order to show it? The view model or the model? Should the code behind check with the viewmodel if the user is authenticated (I don’t think that this is the correct aproach) ?

I’ve been studying the mvvm pattern and started to use mvvm light as a simple and clean way to separate the business from the presentation layer.

This problem was the first that I couldn’t figure it out by myself.

Thanks

  • 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-30T08:39:01+00:00Added an answer on May 30, 2026 at 8:39 am

    you can do it like this. With the DataContext of the UserControl set to the current user:

    <UserControl DataContext="{Binding Path=User}">
    <Popup IsOpen="{Binding Path=IsAuthenticated, Converter={StaticResource BoolToOpposite}">
      ...
    </Popup>
    </Control>
    

    You might have to read up on Converters or call the Property IsNotAuthenticated to move forward quicker.

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

Sidebar

Related Questions

I've seen many questions about this, but i've never really got the answer that
I'm not really sure how to title this question but basically I have an
This is kind of related to my previous question, but not really. I have
I realize that similar questions have been asked about this before here on SO,
This is a question not really about programming (is not specific to any language
This is not really a question because I just solved the problem, but I
This is not really a programming question but please bear with me as I
This is not a really technical question but is required for a system I
There are a few questions that approach an answer to this question, but none
I know this question is not really important.. however I've been wondering: Which of

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.