|
Another update...decided that I wanted a richer option than just hacking the control to not expand, so I wrapped the control in a Viewbox, and used an initParam to set up the width of the Viewbox, if it's set by the <object> element (I've simplified
the markup for clarity...the additional Canvas element is necessary since the Viewbox can only have one child):
SimplePlayer.xaml:
<my1:Viewbox x:Name="TheViewbox">
<Canvas Width="300" Height="100">
<Rectangle x:Name="hiddenRect" />
<Canvas x:Name="MidCanvas" >
...
</Canvas>
<Canvas x:Name="LeftCanvas" >
...
</Canvas>
<Canvas x:Name="rightCanvas" >
...
</Canvas>
<Canvas >
...
</Canvas>
</Canvas>
</my1:Viewbox>
Added the following to Application_Startup in App.xaml.cs:
this.Resources.Add("playerWidth", double.Parse(GetInitParam(e.InitParams, "PlayerWidth", "0")));
And added the following to Page_Loaded in SimplePlayer.xaml.cs:
if (App.Current.Resources["playerWidth"].ToString() != "0") {
TheViewbox.Width = (double)App.Current.Resources["playerWidth"];
}
I'm betting there's probably a more elegant way to pull it off, but this works for me, and gives me all of what I was looking for, without sacrificing any of the player functionality. You can see it in action at
http://www.communitymegaphone.com/ (click the "Podcast" tab in the left hand pane to see the inline players).
|