| Comments

here is some csharp code:

 

<UserControl.Resources>
<ResourceDictionary x:Key="Collection" >
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary x:Name="dict" Source="/Resources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
public static T Load<T>(this string xaml) where T : UIElement
{
T child = null;

Canvas c = XamlReader.Load("<Canvas xmlns:sj='clr-namespace:Slidentity;assembly=Slidentity' "
+ "xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' "
+ "xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>"
+ xaml + "</Canvas>") as Canvas;

child = c.Children[0] as T;
c.Children.Remove(child);

return child;
}
dfad

Please enjoy some of these other recent posts...

Comments