Note that there are some explanatory texts on larger screens.

plurals
  1. POAmbiguous type reference. A type named `VisualState` occurs in at least two namespaces
    primarykey
    data
    text
    <p>What is the following error?</p> <blockquote> <p>Ambiguous type reference. A type named 'VisualState' occurs in at least two namespaces, 'System.Windows' and 'System.Windows'. Consider adjusting the assembly XmlnsDefinition attributes.</p> </blockquote> <p>UserControl:</p> <pre><code>&lt;UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="ButtonWPF.MyButtonAdd" x:Name="AddButton" d:DesignWidth="84" d:DesignHeight="87"&gt; &lt;UserControl.Resources&gt; &lt;Style x:Key="ButtonStyle1" TargetType="{x:Type Button}"&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="{x:Type Button}"&gt; &lt;Grid x:Name="grid" RenderTransformOrigin="0.5,0.5"&gt; &lt;Grid.RenderTransform&gt; &lt;TransformGroup&gt; &lt;ScaleTransform/&gt; ............. &lt;Trigger Property="IsDefaulted" Value="True"/&gt; &lt;Trigger Property="IsMouseOver" Value="True"/&gt; &lt;Trigger Property="IsPressed" Value="True"/&gt; &lt;Trigger Property="IsEnabled" Value="False"/&gt; &lt;/ControlTemplate.Triggers&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; &lt;/UserControl.Resources&gt; &lt;Grid x:Name="LayoutRoot" Height="79" Width="72"&gt; &lt;Button Content="" HorizontalAlignment="Left" Height="61" Style="{DynamicResource ButtonStyle1}" VerticalAlignment="Top" Width="57"/&gt; &lt;/Grid&gt; &lt;/UserControl&gt; </code></pre> <p>MainWindow:</p> <pre><code>&lt;Window x:Class="ButtonWPF.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dg="http://schemas.microsoft.com/wpf/2008/toolkit" xmlns:my="clr-namespace:ButtonWPF" Title="winGroup" Height="637" Width="638" FontSize="15" FontWeight="Bold"&gt; &lt;Grid&gt; &lt;my:MyButtonAdd HorizontalAlignment="Left" Margin="540,519,0,0" x:Name="btnAdd" VerticalAlignment="Top" IsEnabled="True"/&gt; &lt;/Grid&gt; &lt;/Window&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

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