Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Cannot set Name attribute value 'Tab1' on element 'MyTabItem'. 'MyTabItem' is under the scope ...

$
0
0

Hello,

I'm using WPF RC1 and I'm trying to create a set of custom control with template to skin the appearance of the TabControl. When I'm trying to use those controls in my application, I'm getting the following error:

"MyPage.xaml(71,69): error MC3093: Cannot set Name attribute value '_Tab1' on element 'MyTabItem'. 'MyTabItem' is under the scope of element 'MyTabControl', which already had a name registered when it was defined in another scope. Line 71 Position 69."

Here is a trimmed version of the application's page XAML.

<

DockPanelLastChildFill="True">
  <
rbn:MyTabControlDockPanel.Dock="Top">
    <
rbn:MyTabItemHeader="Tab1"Name="_Tab1">
      <StackPanel>
        <Button>Hello</Button>

        <Button>Click Me</Button>
      </StackPanel>
    </rbn:MyTabItem>

  </rbn:MyTabControl>
  ...
</DockPanel>

rbn:MyTabControl inherits from TabControl and rbn:MyTabItem inherits from TabItem and are defined in their own library.

Everything looks fine, I'm just looking a way to access the different tab items from the code-behind.

Pascal Binggeli

 

 


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>