Note that there are some explanatory texts on larger screens.

plurals
  1. POContentControl does not render at another Assembly
    text
    copied!<p>I created some custom control in main assembly (WPF Application) and tested it - all was be ok. Then I replaced this control to the separate assembly (EB.Controls).</p> <p>At the start up assembly (WPF Application) I added /Themes/generic.xaml file to import my custom control:</p> <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; &lt;ResourceDictionary.MergedDictionaries&gt; &lt;ResourceDictionary Source="/EB.Controls;component/HeadButton.xaml" /&gt; &lt;/ResourceDictionary.MergedDictionaries&gt; &lt;/ResourceDictionary&gt; </code></pre> <p>But control does not render. Here is the my control XAML:</p> <pre><code> &lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Controls="clr-namespace:EB.Controls" &gt; &lt;ControlTemplate TargetType="Controls:HeadButton" x:Key="HeadButtonTemplate"&gt; &lt;Border Background="{TemplateBinding Background}" CornerRadius="0.2" BorderBrush="White" BorderThickness="1"&gt; &lt;Grid&gt; &lt;ContentPresenter/&gt; &lt;/Grid&gt; &lt;/Border&gt; &lt;/ControlTemplate &gt; &lt;Style TargetType="Controls:HeadButton"&gt; &lt;Setter Property="Template" Value="{StaticResource HeadButtonTemplate}"/&gt; &lt;/Style&gt; &lt;/ResourceDictionary&gt; </code></pre> <p>And .cs:</p> <pre><code>namespace EB.Controls { [TemplateVisualState(Name = VisualStates.MouseOver, GroupName = VisualStates.CommonStates)] [TemplateVisualState(Name = VisualStates.Normal, GroupName = VisualStates.CommonStates)] public class HeadButton : Button { public HeadButton() { DefaultStyleKey = typeof (HeadButton); } public override void OnApplyTemplate() { base.OnApplyTemplate(); } } </code></pre> <p>Where I've done mistake?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload