troubleshooting Question

How to Import MS Blend Control Template into VS 2008

Avatar of green3
green3 asked on
.NET Programming
3 Comments1 Solution1206 ViewsLast Modified:
I have created a simple Control Template for a textbox in MS Blend stored in UserControl1.xaml. as part of my Blend Control Library Project.
I want to use this control template in my WPF application in Visual Studio 2008 .
But cant seem to get it referenced.
I have added the Blend Project dll as a reference to my VS Project.
Then I tried adding a reference to the blend control  as a resourcedictionary in Visual Studio, but this is not working. The code attached is from VS and Blend TestCtrlLib is the name of my Blend Project.

It could be the pack syntax I am using in the resource dictionary, I have tried a number of permutations of it, but still get VS error messages about the LoadFrom failing at the resource dictionary line
// Visual Studio code tryinmg to import MS Blend control template:
<UserControl x:Class="SlingChart.VisualStudio.Design.Tuner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:Local="clr-namespace:SlingChart.VisualStudio.Design"
             xmlns:src="clr-namespace:SlingChart;assembly=SlingChart"
    Height="300" Width="300">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/TestCtrlLib;component/UserControl1.xaml" />
            </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
    </UserControl.Resources>
 
////////   MS Blend Control Template Below :
 
<UserControl x:Class="SlingChart.VisualStudio.Design.Tuner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:Local="clr-namespace:SlingChart.VisualStudio.Design"
             xmlns:src="clr-namespace:SlingChart;assembly=SlingChart"
    Height="300" Width="300">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/TestCtrlLib;component/UserControl1.xaml" />
                <ResourceDictionary Source="/SlingChart;component/Themes/ButtonsRD.xaml" />
                <ResourceDictionary Source="/SlingChart;component/Themes/TextBoxsRD.xaml" />
             -->   <ResourceDictionary Source="/SlingChart;component/Themes/TabControlsRD.xaml" /> 
            </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
    </UserControl.Resources>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros