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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:48:44+00:00 2026-05-22T14:48:44+00:00

I know its an anti pattern to have WPF specific connections to the presentation

  • 0

I know its an anti pattern to have WPF specific connections to the presentation model.
But in this case i cant avoide it (I use SLIM DX for joystick input and it requires the handle).

So is there a way from the presenation model to get the handle of the window connected to the model?

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-22T14:48:44+00:00Added an answer on May 22, 2026 at 2:48 pm

    If I understand, if your view model is inherited from Screen you can call GetView, cast it to the type of your view, and get access to a control on the view.

    var myView = GetView() as OrderView;
    myView.SlimDX ...
    

    An alternative if you don’t want to reference your view from the VM it might be possible to do what you need in a coroutine.

    “It’s a fairly simple interface to implement. Simply write your code in the “Execute” method and be sure to raise the “Completed” event when you are done, whether it be a synchronous or an asynchronous task. Because coroutines occur inside of an Action, we provide you with an ActionExecutionContext useful in building UI-related IResult implementations. This allows the ViewModel a way to declaratively state it intentions in controlling the view without having any reference to a View or the need for interaction-based unit testing. Here’s what the ActionResultContext looks like:”

    public class ActionExecutionContext
    {
        public ActionMessage Message;
        public FrameworkElement Source;
        public object EventArgs;
        public object Target;
        public DependencyObject View;
        public MethodInfo Method;
        public Func<bool> CanExecute;
        public object this[string key];
    }
    

    http://caliburnmicro.codeplex.com/wikipage?title=IResult%20and%20Coroutines&referringTitle=Documentation

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

Sidebar

Related Questions

I know its stupid asking this question but i cant seems to extra Value(int)
I know its possible because I have seen it on many websites but how
I know its impossible for 100% protection, but something high or that works for
I know its possible to receive a dayClick event on Fullcalendar. But I would
I have a DropDownList and need to know its name in the code behind:
How to run a program and know its PID in Linux? If I have
I know its possible to increase the size of a dynamically allocated array. But
This is probably a really fundamental question, but I'm afraid I don't know much
I know its part of the spring framework, but i don't understand it. Where
I know its pretty basic but I just can't get it to work. it

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.