Style addin

Mar 19, 2008 at 7:43 AM
my addin is control object. i want to design the addin with style tag in xaml. how to do?

<Style TargetType="addin:WPFAddInHostView">
<Setter Property="Opacity" Value="0.5"/>
<Grid Name="grid">
<Canvas Name="AdContent"/>

public Window1()
void LoadAddin()
String path = Environment.CurrentDirectory;
String[] warnings = AddInStore.Rebuild(path);
IList<AddInToken> tokens = AddInStore.FindAddIns(typeof(HostViews.WPFAddInHostView), path);
addins = new List<HostViews.WPFAddInHostView>();

foreach (AddInToken token in tokens)
HostViews.WPFAddInHostView c;

if (token.ToString().Contains("Image"))
c = token.Activate<HostViews.WPFAddInHostView>(AddInSecurityLevel.FullTrust);
c.ImageSource = "E:\\imageData\\D0002698512";



in above code, my style doesnt work,why?
Mar 27, 2008 at 11:36 PM
The style from the host is not automatically propegated over to the add-in. If you want to define a style for use by the add-in you should define it as part of the add-in view, and not inside the host application.

Transparency in particular will not work because windows doesn't support transparency across HWNDS (which WPF uses to parent WPF controls across AppDomain boundaries), but other style elements are valid and can be defined on the add-in side view.