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 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'm looking for a WinForms control that would allow me to display data in
I'm looking for an SQL client app that can display subdatasheets like the following:
I am looking to display an array from 128 to 512 bytes in size
I'm looking to have text display vertically, first letter at the bottom, last letter
I'm looking for a way to display multiple colors in a single C#/.NET label.
I'm looking for ways to display a single row of data as a single
I'm looking for a way to display a VNC viewer in a thick/rich java
I am looking for a method to display virtual rows in an MS Access
Looking to see if there's an existing method or application to increase display size
I'm looking for an application that would lock my computer and display a screensaver

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.