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 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:
I know its possible to increase the size of a dynamically allocated array. But
I know its a bit too early, but I've been trying out Go (Google's
I know its simple but: fieldset label.inline does mean that all labls with the
I know its part of the HTML5 spec, but sometimes WebKit doesn't conform to
I know it's not the jQuery SVG library causing this issue, but when rendering
I know its a silly question but i am stuck into it from 2
Im newbie in C# and don't know its syntax. But I know a bit

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.