WPF Web application: How to embed in ASP.NET page? - wpf

I am trying to bulid a WPF web application.I have 2 projects in the solution .One is of type WPF web application and another is of type ASP.NET web application where i need to embed the WPF stuff.The XAML file runs file when i set startup project as the WPF web app project.How can i add/embed this into the Default.aspx of my ASP.NET Web app project ?

You are creating what is known as a XBAP (XAML Browser Application).
Follow these deployment instructions from MSDN:
WPF XAML Browser Applications Overview

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,

WP7 - How to embed my xap in a webpage

I have made a Windows Phone 7 app and I would like to embed it in a webpage.
I found two examples to help explain what I want to do:
http://www.lifewaresolutions.com/deluxe_moon_demo_wp7.html
http://help.arcgis.com/en/arcgismobile/10.0/apis/WindowsPhone/samples/start.htm
I have looked at the page sources for both of these websites and have tried to mimic what they have down, but the farthest I have gotten is a webpage with a silverlight app in the middle, but my app doesn't start.
I am not that familiar with web development, but if someone could help me create a simple html page with my wp7 app embedded in it, that would be great.
The Silverlight desktop computer plugin can't execute Windows Phone Silverlight apps.
The two example websites embed a "classic" Silverlight app within a fake Windows Phone chrome.
So basically what you can do to have something similar is:
Create a new Silverlight 4 "classic" project
Implement your app (you can share code between the new project and your existing WP7 code)
Retemplate the controls to make them look like the Windows Phone ones
Embed the app within a WP7 chrome on a website

Embed Silverlight app in a jsp portlet

How to embed a silverlight app in a jsp portlet?
Rgds
I'm not sure the structure of portlets, but since Silverlight is a client technology, anywhere the portlet is delivering HTML content, you would just put your tag for Silverlight and your app.

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.

Silverlight blank browser

I've got a problem with the Silverlight default VS2008 project. Wnen I create a new SL project and choose ASP.NET Web Site web project type all is ok - in my browser I see default template. But when I choose ASP.NET Web application and run it I get blank browser screen with js error: Unhandled Error in Silverlight Application Code: 2104 Category: InitializeError Message: Could not download the Silverlight application. Check web server settings. What's wrong?
Yeah, this happened to me too. It was my MIME types that were not added. You may need to add these to IIS:
.xaml application/xaml+xml
.xap application/x-silverlight-app
.xbap application/x-ms-xbap
Here's a tutorial on how to do so: http://learn.iis.net/page.aspx/262/configuring-iis-for-silverlight-applications/
If this isn't the issue, two other things to check:
Is your project targeting the right
.NET framework (3.5 instead of 2.0)?
Is your start-up projec the ASP.NET
web site project?

Resources