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 6661673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:18:31+00:00 2026-05-26T02:18:31+00:00

Ok, so what I am looking to do is to display some sort of

  • 0

Ok, so what I am looking to do is to display some sort of login control (maybe a UserControl with a TextBox and PasswordBox) when the app is started.

In a non-mvvm situation, a way of doing this would be to use the PopUp primitive control, add the usercontrol as a child element and off you go.

In an MVVM situation, i’m a bit confused about how you would achieve a simmilar result.

I have looked into messaging with the DialogMessage and this is fine for displaying a typical MessageBox, but what about a custom usercontrol?

any help would be fantastic! I can’t seem to find any demo code of this anywhere.

  • 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-26T02:18:31+00:00Added an answer on May 26, 2026 at 2:18 am

    In a MVVM situation you can use a delegate to let your View open the dialog when the ViewModel requests it.

    You define a delegate at the VM:

    public Func<LoginResult> ShowLoginDialogDelegate;
    

    In your View you define the function that will be called:

    private LoginResult ShowLoginDialog()
    {
        LoginResult result;
        // show a dialog and get the login data
        return result;
    }
    

    Then you “connect” the delegate and method in the View:

    _viewModel = new MyViewModel();
    DataContext = _viewModel;
    _viewModel.ShowLoginDialogDelegate += ShowLoginDialog;
    

    And now you can use it in your ViewModel e.g. when a command is executed like that:

    LoginResult result = ShowLoginDialogDelegate();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking for some advice in regards to getting a very quick display
I am looking for some sort of message box that occurs at the cursor.
What I am looking for Display a grid within a three.js scene that fills
I am looking to display heightmaps from the video game Battlefield 2 as images
I'll preface by saying that I'm new at web development. I'm looking to display
I'm looking for the best method to display a category list in Android. What
I'm looking for a way to display 1 as 01, so basically everything below
I am looking for a solution to display many items (10's of thousands) in
I'm looking for a way to display fractions (½, ¼, etc) within a textfield
I am looking for a method to display virtual rows in an MS Access

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.