Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8199589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:12:06+00:00 2026-06-07T06:12:06+00:00

I created a custom control and what to use a ContentControl inside that control

  • 0

I created a custom control and what to use a ContentControl inside that control for use of the MVVM design pattern however my control does not like this when I run the application. For testing I also tried other standard controls but none of them work inside the custom control… just more custom controls that are dependant on the parent custom control.

Does anybody suggest how to place standard controls such as the ContentControl inside a custom control?

Cheers.

EDIT

XamlParseException -> ‘Add value to collection of type
‘System.Collections.ObjectModel.ObservableCollection(Ribbon_Framework.RibbonTabItem)’
threw an exception.’ Line number ‘8’ and line position ’14’.

    <Ribbon:Ribbon AutomaticStateManagement="True" x:Name="Ribbon">
        <ContentControl x:Name="SearchRibbon" Content="{Binding Path=SearchRibbon}" ContentTemplate="{DynamicResource SearchRibbonTemplate}" />
    </Ribbon:Ribbon>

Inside the contentcontrol ->

<DataTemplate x:Key="SearchRibbonTemplate">
    <ItemsControl ItemsSource="{Binding}">
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <Ribbon:RibbonTabItem Header="Search">
                    <Ribbon:RibbonGroupBox Header="{Binding Path=DisplayName}" Width="100">
                        <Ribbon:Button Width="100" Icon="{Binding Path=TemplateResource}" LargeIcon="{Binding Path=TemplateResource}" Command="{Binding Path=Commands}" />
                    </Ribbon:RibbonGroupBox>
                </Ribbon:RibbonTabItem>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
</DataTemplate>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:12:07+00:00Added an answer on June 7, 2026 at 6:12 am

    Your Ribbon control expects an object of RibbonTabItem type (since it houses an

    ObservableCollection<RibbonTabItem> 
    

    so you can only add the RibbonTabItem class to it – you need to make sure your control allows other elements inside it. Some 3rd party controls get round this by providing a content control inside the inner item of their custom control (i.e. let RibbonTabItem have a ContentControl inside it) or allow you to customise the item template

    You need to change your implementation of Ribbon or change the functionality of RibbonTabItem for this to work. Look at ItemsControl.Items property and see what type that is. You should try using that type for your ObservableCollection

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that if I created a custom control, say MyLabel in App_Code ..
Basically, I have created a custom control that uses an UpdatePanel, and as I
I've created a custom user control that has several properties. One specifies which database
I have created a custom control which derives from Panel. I use it to
I've created a custom control that is intended to be used as a button
I've created a custom control for use in my Silverlight application. Its template is
I have created a custom TaskButton control that takes an image and text. The
I have created a custom server control. So far this control renders some html
I have created a custom server control that inherits from CompositeControl. In the CreateChildControls
I'm using the automation API to create custom control patterns. Now that I've created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.