Skip to content

Instantly share code, notes, and snippets.

@follesoe
Created April 28, 2010 08:58
Show Gist options
  • Save follesoe/381894 to your computer and use it in GitHub Desktop.
Save follesoe/381894 to your computer and use it in GitHub Desktop.
<UserControl x:Class="UsercontrolContentControl.Overlay"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<Grid x:Name="LayoutRoot" Background="White">
<ContentControl Content="{Binding OverlayContent}" />
</Grid>
</UserControl>
[ContentProperty("OverlayContent")]
public partial class Overlay
{
public object OverlayContent
{
get { return GetValue(OverlayContentProperty); }
set { SetValue(OverlayContentProperty, value); }
}
public static readonly DependencyProperty OverlayContentProperty =
DependencyProperty.Register("OverlayContent",
typeof(object),
typeof(Overlay),
new PropertyMetadata("", OnOverlayContentChanged));
private static void OnOverlayContentChanged(object sender, DependencyPropertyChangedEventArgs args)
{
}
public Overlay()
{
InitializeComponent();
}
}
<Grid x:Name="LayoutRoot">
<local:Overlay>
<local:MovieInfo />
</local:Overlay>
</Grid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment