Can you use multiple app domains in silverlight? - silverlight

Can you use multiple app domains in silverlight? If so, are there any special restrictions?

Depends on what you mean. By default, each Silverlight application runs in what is, effectively, a separate App Domain. But you can't programmatically control application domains like you do in the full .NET runtime. The System.AppDomain namespace is there, but all the "CreateXXXX" methods are missing. Compare the .NET 4.0 docs with the Silverlight docs to see what I mean.

Related

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,

Can DotNetOpenAuth be used within a Silverlight application

I have used DotNetOpenAuth previously in an ASP.net website and it works fine. But now I wanted to create a Silverlight app. Unfortunately I can't reference DotNetOpenAuth.dll, since this is not compiled against the Silverlight CLR. Is there a solution to use open authentication from Silverlight?
DotNetOpenAuth currently has this as an open issue for the group. Here's the link for the post and here is the link for the tracked item. There is this control a third party created, however it appears to me like it is not very secure so use it at your own risk. I only mention it because it could be a potential band-aid depending on the needs of your project.

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

TestPage.aspx in silverlight

I am a beginner in silverlight. I want to know what is TestPage.aspx and TestPage.html in silverlight. Actually i have google it but din't get enough information. Can any one give me answer??
TestPage.aspx and TestPage.html are the pages which will host your Silverlight content. As you might know, Silverlight is just a project (not a web application) and needs a page that can host it.
These pages are created by default and help you to test your XAML content during your development, which you can later remove from your project.
TestPage.html is dynamically generated by the Silverlight application as part of the Debug process. If you take a look at the Debug tab for the application properties you will see an option to Dynamically generate a test page. If this is selected then you TestPage.html is created in the /Bin/Debug folder of your Silverlight application.
A better solution is to create a web application in the same solution as your Silverlight application then in the properties for the web application go to the Silverlight Applications tab and add your existing Silverlight app to the web project. Also make sure that the Silverlight checkbox is ticked in the Debuggers section of the Web tab of your web application.

Using ActiveX with 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.

Resources