Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom TabItem header with text and image - not sure how to proceeed
    primarykey
    data
    text
    <p>I have a TabControl in my XAML which is just an empty control as the TabItems are dynamically generated at runtime.</p> <p>My problem is I want to have the tab title and an image (a "settings" image) in the Header but I'm not sure how to go about this. As I said, I'm generating the TabItems on the fly so how and where would a template to do this fit in and where would I put it etc? Would a TabItem header template apply to TabItem controls created dynamically? (I am assuming/hoping so!)</p> <p>I've googled and searched around here but no-one quite seems to be doing what I'm doing... just wondering if someone could give me some guidance.</p> <pre><code>&lt;Grid Name="MainGrid" Background="#333333" ShowGridLines="False" &gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="50"/&gt; &lt;RowDefinition Height="*"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;Grid Grid.Row="0" ToolTip="Settings"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="*"/&gt; &lt;ColumnDefinition Width="*"/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;TextBlock Grid.Column="0" Text="RoboNews" Foreground="SkyBlue" FontSize="32" Padding="5"/&gt; &lt;Button Name="btnSettings" Background="Transparent" Grid.Column="1" BorderBrush="#333333" BorderThickness="0" HorizontalAlignment="Right" Click="btnSettings_Click" ToolTip="Click for menu"&gt; &lt;!--&lt;Image Source="Images/Settings48x48.png"/&gt;--&gt; &lt;Image Source="/Images/MenuOpen.png" Width="36" /&gt; &lt;/Button&gt; &lt;/Grid&gt; &lt;TabControl Name="tabCategories" Grid.Row="1" Background="Black" SelectionChanged="tabCategories_SelectionChanged"&gt; &lt;/TabControl&gt; &lt;/Grid&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.
    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