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 8256005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:43:09+00:00 2026-06-08T01:43:09+00:00

I am struggling to put a ContentPresenter in a Toolbar. I have a UserControl,

  • 0

I am struggling to put a ContentPresenter in a Toolbar. I have a UserControl, DashboardView, with a viewmodel, DashboardViewModel. My ContentPresenter is set up like so:

in the UserControl.Resources, I have:

<DataTemplate DataType="{x:Type DashboardVM:DashboardViewModel}">
     <Dashboard:DashboardView />
</DataTemplate>

and in the toolbar:

<ToolBarTray Margin="0" DockPanel.Dock="Top">
    <ToolBar Band="0" BanIndex="0">
        <--! other stuff -->
    <ToolBar Band="0" BandIndex="1" MinWidth="500" ToolBarTray.IsLocked="True">
          <ContentPresenter Content="{Binding Path=DashboardViewModel}" />
    </ToolBar>
</ToolBarTray>

The ContentPresenter does not appear when executing. The other ToolBar does.

I’ve put the ContentPresenter outside of the toolbar in a Grid and it appears fine. So it’s something with the ToolBar, but I cannot figure out what.

UPDATE: I’ve also attempted (among many things) putting the ContentPresenter in a MenuItem, like this:

            <ToolBar Band="0" BandIndex="1">
                <MenuItem>
                    <MenuItem.Header>
                        <ContentPresenter Content="{Binding Path=DashboardViewModel}"/>
                    </MenuItem.Header>
                </MenuItem>
            </ToolBar>

Still not showing up.

More info:

DashboardView:

<UserControl x:Class="Wsi.Common.View.Dashboard.DashboardView"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:Dashboard="clr-namespace:Wsi.Common.ViewModel.Dashboard"
         xmlns:view="clr-namespace:Wsi.Common.View.Dashboard"
         MinWidth="500"
         MinHeight="30"
         MaxHeight="70">

<UserControl.Resources>
    <DataTemplate DataType="{x:Type Dashboard:DashboardItemViewModel}">
        <view:DashboardItemView />
    </DataTemplate>
</UserControl.Resources>

<StackPanel MaxHeight="70" Orientation="Horizontal">
    <ContentPresenter x:Name="fileSystemDashboardItem" Content="{Binding Path=FileSystemDashboardItemViewModel}" />
    <ContentPresenter x:Name="spreadHealthDashboardItem" Content="{Binding Path=SpreadHealthDashboardItemViewModel}" />
    <ContentPresenter x:Name="spreadStatsDashboardItem" Content="{Binding Path=SpreadStatsDashboardItemViewModel}" />
    <ContentPresenter x:Name="acquisitionStatsDashboardItem" Content="{Binding Path=AcquisitionStatsDashboardItemViewModel}" />
    <ContentPresenter x:Name="backhaulHealthDashboardItem" Content="{Binding Path=BackhaulHealthDashboardItemViewModel}" />
    <ContentPresenter x:Name="serverHealthDashboardItem" Content="{Binding Path=ServerHealthDashboardItemViewModel}" />
</StackPanel>

DashboardViewModel simply holds properties as above for the sub-viewModels, just {get; set;}

As mentioned before, this worked beautifully in a row by itself in the View, above the ToolBarTray.

TIA!

Janene

  • 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-08T01:43:10+00:00Added an answer on June 8, 2026 at 1:43 am

    Answering my own question… there was nothing wrong with my code. The items in the Contents of the ContentPresenter exceeded the width of the toolbar. The toolbar displayed nothing as the contents were too wide.

    An entire day chasing a bug that just needs me to make my s**t smaller and smarter about resizing.

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

Sidebar

Related Questions

I am struggling to resolve this . I have a table like this .
Struggling with a bit of a mystery regarding a ghost like JESSIONID Cookie. I'm
Struggling with styling the mouse over for a button ... I have managed to
Im struggling with this one. I have a list of items and on a
Iam struggling with NHibernate and its lazyload. I have a structure which I simplified
been struggling with an issue now for a day or two. I have an
I'm stll relatively new to cakephp (1.3) and struggling with where to put the
I'm struggling with updating my ListView after the user have deleted a row from
I'm struggling a bit to put together what I thought was a simple task.
I am struggling to get my LogIn/Registering system working. I have a register.aspx page

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.