views:

28

answers:

2

I know with Silverlight you can control the width and height of the Silverlight section within the web page. However, it seems like from what I can tell when you are using XBAP you give the entire browser page area over to WPF. Is there a way to have an HTML and have XBAP be embedded within a rectangle of that HTML page? Or is this only possible with Silverlight?

+1  A: 

I haven't tried, but you could probably host the Xbap in an iFrame.

KeithMahoney
That makes sense. But actually surrounding a WPF "rectangle" with HTML elements within the same frame is impossible?
jkohlhepp
+1  A: 

If you set the Width and Height of the page you can control its size. Using the following default generated XAML, run it and have a play with the Width and Height:

<Page   x:Class="WpfBrowserApplication1.Page1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        mc:Ignorable="d" 
        d:DesignHeight="300" d:DesignWidth="300"
        Title="Page1"
        Width="400"
        Height="400"
        >
    <Grid Background="Red">

    </Grid>
</Page>
slugster
But if it's size is smaller than the full browser window, can you have HTML elements in the parts of the window that are not filled by the WPF elements?
jkohlhepp
@jkohlhepp - if that is your intention why don't you use Silverlight?
slugster
I'm currently doing a feature comparison between Silverlight and WPF for an upcoming project. So the whole point of this question was to help with that decision. :-)
jkohlhepp