WPF, Cannot register duplicate name 'tabs' in this scope

0

I'm running into a bit of an issue, as the title says. Every time I name an object in XAML, I get an exception.

System.Windows.Markup.XamlParseException
  HResult=0x80131501
  Message='Could not register named object. Cannot register duplicate name 'tabs' in this scope.' Line number '93' and line position '14'.
  Source=PresentationFramework
  StackTrace:
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)

Inner Exception 1:
ArgumentException: Cannot register duplicate name 'tabs' in this scope.

In this case, I'm naming a tabcontrol 'tabs'. Am I missing something? I will also add that I just installed 'ReSharper'...

EDIT: Here's the XAML code. NOTE: I also changed the name (asdasd) to something completely random to ensure I didn't have any duplicates in other code

<TextBlock Grid.Row="0"
           HorizontalAlignment="Center" 
           VerticalAlignment="Center">
    <TextBlock.Style>
        <Style TargetType="TextBlock">
            <Style.Triggers>
                <DataTrigger Binding="{Binding Items.Count, ElementName=asdasd, Mode=OneWay}" Value="0">
                    <Setter Property="Visibility" Value="Visible" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </TextBlock.Style>
</TextBlock>
<TabControl x:Name="asdasd"
            Grid.Row="0"
            ItemsSource="{Binding Application.Tabs, Source={x:Static m:Locator.Instance}}">
    <TabControl.Style>
        <Style TargetType="TabControl" BasedOn="{StaticResource UI_TabControl}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource Self}}" Value="0">
                    <Setter Property="Visibility" Value="Collapsed" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </TabControl.Style>
</TabControl>
c#
wpf
asked on Stack Overflow Mar 22, 2018 by IamMike4Life • edited Mar 23, 2018 by openshac

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0