Using ActiveX with Silverlight - silverlight

I would really like to use Silverlight for a project I'm working on but I will need to interact with an application running on the user's desktop. Is it possible to do this with Silverlight, or am I stuck with ASP.NET + ActiveX?

You can use Silverlight as an ActiveX component in a standard windows application... See alternate hosting: http://code.msdn.microsoft.com/silverlightalthost
If you have to do this via a Web application, you could write a custom signed ActiveX component and interact with it from Silverlight (via JS bridge)

Silverlight applications run in a sandbox on the client and cannot communicate outside except through sockets or ports. You'll probably have to go ActiveX.

Related

How does Server Side works?

I am developing an Extjs App and I have to use a DLL on my app. Someone in this forum told me that it is not possible to make it directly with Extjs but that I have to make it works with a Server Side.
I am new at Dlls and also Server Side is a new term for me. Someone may explay me how Server Side works and How can I make it works with a Dll into my Extjs App.
It depends on the dll, WHat is the dll's use and the purpose.
Extjs is a Web application framework, It is possible to use Windows apps in a web browser, but this generally implies use of a browser plugin.
For example using a scanner app, I had to use a Twain web app plugin.

How to automate a Silverlight based web application using selenium?

I am trying to automate a web application using selenium, however that application is developed using Silverlight. Hence, i am not able to inspect the elements in the web page. Could anyone please suggest on how to tackle this problem?
Out of the box, selenium won't natively support testing a Silverlight-based web app. There is https://code.google.com/archive/p/silverlight-selenium/, but it doesn't look like that project is currently being maintained. Beyond that, Silverlight itself is not longer under development, and it won't run on recent versions of Chrome or Edge (or Android or iOS).

How to cast from Windows.UI.Xaml.UIElement to System.Windows.Controls.UIElement

I'm trying to create a new UI for an app I developed for the Windows Store using the Windows Runtime API. This new client is going to be a WPF Desktop App. I'm trying to reuse as much code as I can but I'm facing several issues.
Fortunately there's a way to use WinRT in a WPF Desktop app (see this and this)
Now I'm blocked by the following issue:
The MediaCapture class has a method to start the preview of a device, after I've started the preview I can create a CaptureElement to display the preview.
CaptureElement is part of Windows.UI.Xaml.Controls and cannot be used in containers from System.Windows.Controls in which the WPF UI is built.
Am I going anywhere with this approach? what would you recommend? How can I display the preview of a device in the WPF app?
Thanks in advance
CaptureElement can't be used in desktop applications - the documentation says "[Windows Store apps only]". In general - the UI controls from WPF and WinRT/XAML can't be used outside of their respective domains (desktop/immersive UI). In a WPF app you need to use WPF controls - e.g. DirectShow for camera capture,

Screen scraping silverlight browser application info

I'm registered to a site which uses a silverlight application that shows some personal information.
My goal is to be able to read some data from the silverlight application.
Is it possible?
I know that this could be done to a regular web page using curl.
but, what about silverlight application?
Does it store the information to a file or something like that?
Thanks
You can use White, a tool for automating windows applications, to get information out of a running Silverlight application. White is mainly used to perform functional testing of applications, but it should allow you to extract information from the application as well.
Look here for an example of White and Silverlight: http://www.codeplex.com/wikipage?ProjectName=white

Recording Screen Interactions using UI Automation for Silverlight controls

I am trying to use UI Automation to record screen interactions in my Silverlight app. I have the Automation Peers for my control setup but am not able to figure out how to track these controls.
For my WPF app I would get hold of AutomationElement.RootElement and then navigate down to my App and setup Automation event Handlers on the controls I am interested in.
How would I do the same for Silverlight app? I want the screen recorder to start automatically whenever my app runs. The screen recorder has to sit within my App. But the System.Windows.Automation silverlight namespace doesn't have a AutomationElement class. So how would I do this in Silverlight?
Thanks
Shivaprasad
As you observed, the AutomationElement class doesn't exist in Silverlight: the UIAutomation API is available only in the full .Net framework. Silverlight is only supported as an UI Automation provider - that is, Silverlight applications can be controlled by UI Automation, but they are not able to control other applications.
For this reason, I don't think you're going to be able to create your screen recorder within the Silverlight application - unless you are prepared to resort to some nasty hacks.
Such hacks might include:
Using Silverlight COM Automation to call the new UIAutomation COM API. Users would be required to have the COM API installed on their machines in addition to Silverlight.
Create a "server" application in .Net that you can run on the target machine that does the actual UIAutomation work, then communicate with this from your Silverlight application using WCF.

Resources