WPF: How to make Tab Header to show three different icons?

Our WPF application needs Tab header to show three different icons and Foreground.
If tab is not selected, show one icon and black foreground. If tab is selected, show another icon and white foreground. If tab is selected and also require show Chromestyle, show third icon and red foreground.
we have tried the following code. However, MultiDataTrigger section does not work.
<TabItem x:Name="tabItemSetup" Header="Setup">
<TabItem.HeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<Image x:Name="imgSetup" Height="50" Width="65" Source="Resources/Images/UNSELECTED_Setup Icon.png" DockPanel.Dock="Top" />
<TextBlock x:Name="txtSetup" Text="{Binding}" Foreground="Black" Style="{StaticResource TabTextStyle}" DockPanel.Dock="Bottom" FontFamily="Eras ITC" FontSize="13.333"/>
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type TabItem}}}" Value="True">
<Setter TargetName="txtSetup" Property="Foreground" Value="White"/>
<Setter TargetName="imgSetup" Property="Source" Value="Resources/Images/SELECTED_Setup Icon.png"/>
</DataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsChromeStyle}" Value="True"/>
<Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type TabItem}}}" Value="True"/>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter TargetName="txtSetup" Property="Foreground" Value="Red"/>
<Setter TargetName="imgSetup" Property="Source" Value="Resources/Images/Chrome SELECTED_Setup Icon.png"/>
</MultiDataTrigger.Setters>
</MultiDataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</TabItem.HeaderTemplate>
</TabItem>
Does anyone know how to make it work? Thx!
JaneC

Where is the IsChromeStyle property defined? It is the Header, i.e. the string "Setup" that is the DataContext of the HeaderTemplate and the a string has no property called IsChromeStyle so you must specify a source for the binding.
If for example the DataContext object of the TabControl, or the parent of the TabControl (for example the window or whatever) has a property called IsChromeStyle you could bind to this one using a RelativeSource:
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding DataContext.IsChromeStyle, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="True"/>
<Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type TabItem}}}" Value="True"/>
</MultiDataTrigger.Conditions>
Then it should work. It is the binding that fails.
Please remember to close your threads by marking helpful posts as answer.

Similar Messages

  • The Header in my home page is truncated. My home page Header is cut off. The header appears in Internet Explorer, but not in Mozilla Firefox 3.6.13. How to make the header display in Firefox?

    The Header in my home page is truncated. My home page Header is cut off. The header appears in Internet Explorer, but not in Mozilla Firefox 3.6.13. How do make the header display?

    (Images or animations do not show) worked well.

  • How to make Finder NOT to show files from a specific folder in "All My Files"?

    Hello!
    Can someone please advice how to make finder NOT to show files from a specific folder in "All My Files"? See the attach - I recently installed Civilization 5 from Steam and now I have a lot of unneeded files (*.log and *.ini) shown in  All My Files colder in Finder.
    I don't want to see them. Any advise?

    Using "All my Files" was very handy before all this rubbish popped up. =(

  • My tabs no longer show the correct icon with each one, just generic ones now?

    I have Windows 8.1 and the newest version of Firefox. My tabs used to show the website icon for each tab. Now there are only 4 correct icons and the others have a generic blue disc in a box. I liked just having the recognizable icons. Can I get that back?

    You can check these prefs on the <b>about:config</b> page and make sure that they have the default value true.
    *browser.chrome.favicons
    *browser.chrome.site_icons
    You can open the <b>about:config</b> page via the location bar and you can accept the warning and click "I'll be careful" to continue.

  • How to make a backup if the Storage & Backup icon is missing?

    how to make a backup if the Storage & Backup icon is missing?

    http://www.apple.com/icloud/setup/ios.html
    Sounds like you have an account, so two options I would say.
    Try turning it off, then off and see what options you get, or sync your phone to iTunes and click on the summary and choose the iCloud option.

  • How to make a header ?

    I'm working on a website with dreamweaver, and i had a template on photoshop saved for it, however it's been corrupted.
    How can i make a header like this from scratch ? baring in mind, I am prety much imcompetent with Photoshop
    the wbsite is www.fitnesscovered.co.uk
    the header such as "begin your healthier lifestyle" or on the other pages is exactly what I'm trying to re-create
    Thank you

    Hi there, here's a tutorial for how to build that image. It may seem long, but never fear! The steps are actually quite simple.
    1) Create a file in the dimensions of the image (872 x 379 for the "begin your healthier lifestyle" banner).
    2) Place the desired photo into the document by copying and pasting or by going to File > Place.
    3) Select the Type Tool and click the area of the image where you would like the text to start. Please see the screenshot below for details on how to change the appearance of your text.
    4) Select the Rectangle Tool highlighted below and draw a rectangle around your text. Change the color at the top of the window as shown below. Your text will be obscured, but we will fix that in the next step.
    5) In your Layers Panel, drag the layer containing the rectangle you just made below your text layer.
    6) To create the second line of text and rectangle, you can simply duplicate the layers you made, then edit them. Select both layers by clicking on the text layer, the shift-clicking on the rectangle layer. Next, control click on the selected layers to open a flyout. Choose duplicate layers. In your canvas, it will look like nothing happened, but the layers will show up in your layers panel.
    7) Hit command V to select the Move Tool. You can now click and drag the rectangle and text layers to reposition them.
    8) Revisit Step 3 for how to select your text to change it.
    9) To change the dimensions of the rectangle, select the rectangle layer and press command T to enter Transform Mode.
    I hope this helps! Please let us know if you have any other questions about this technique.

  • How can make the header repeat in every page?

    I followed the instructions in pages' help nad it does work for text heardes, however it does not work with images and graphics.
    Daoes anyone know how to make graphic and/or images headers repeat in each page?
    Thanks in advance.
    Ruben

    Make them Master Objects:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=182&highlight=letter head&mforum=iworktipsntrick
    Peter

  • How to make SWF in GoLive show in IE in v5, 6 or 8

    I would like to get a Flash file to work in Internet Explorer
    v5, 6 and 8. I am creating a site and the flash clip won't play in
    these browsers (but will in IE v7). Does anyone have any ides?
    Thanks.

    EDIT: I see you mentioned that yourself but the header of your question was 'How to make SWF file work in interactive PDF'. Strictly speaking, forgetting the iPad, the answer would be: export the animation from InDesign to SWF, delete the animation and now place the exported SWF back on the page. Then export to interactive PDF.
    Still won't work on iPad however!
    On Desktop this will work in PDF *if* Flash player is installed on that desktop for Adobe reader/Acrobat 10 and later; versions 9 and earlier have 'build in' Flash players...

  • How to make Tab jump the proper way?

    Hi,
    I have different components on a panel - JComboBoxes, JTextFields, JCheckBoxes, etc.
    I'd like to make Tab first jump only on JTextFields and on other components after all JTextFields have been visited.
    Could anyone please direct me where I should look for API or tutorial on how to implement Tab jump direction??

    http://java.sun.com/j2se/1.4.1/docs/api/java/awt/event/FocusAdapter.html

  • How to make editing cell to show up caret and taking keyboard event

    Hello everyone:
    I have the following problem with table editing.
    1. using mouse clicking, the editing cell will have cursor and taking keyboard event.(no problem with it)
    2. just type in data, it will show up in the selected cell, but the editing cell do not have cursor visible and also do not fire the keyboard event.
    I have problem with this one. So how to make editing cell to have caret visible and taking keyboard event.
    Thank you very much!
    --tony                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi,
    you should subclass JTable and overwrite two methods.
    1. protected boolean processKeyBinding(javax.swing.KeyStroke ks,
    java.awt.event.KeyEvent e,
    int condition,
    boolean pressed)
    to store the current keyboard event,
    2.public boolean editCellAt(int row,int column,java.util.EventObject e)
    to fix the problem with isCellEditable and curret position and direct the event into proper place.

  • How to make tabs take custom heights

    Hey Guys
    i have Jdev 11.1.1.6.0
    i want to make tabs in normal and hover and selected state to take my custom height.
    i give it in css my custom height but i really suffered it doesn't work it takes default height and its small
    waiting for your support from experts.
    Thanks guys :)

    try dimensionsFrom="children" in either your panelStretchLayout or in Tab

  • How to populate an internal table from three different tables

    My requirement is to populate an itab by retrieving data from three diff db tables,
    ekko,ekpo and Ekbe.
    below is the code for data retrieval .
    SELECT EBELN INTO TABLE IT_EKKO FROM EKKO WHERE EBELN IN S_EBELN.
      IF NOT IT_EKKO[] IS INITIAL.
        SELECT  EBELP TXZ01 NETWR BUKRS INTO CORRESPONDING FIELDS OF TABLE IT_EKPO FROM EKPO FOR ALL ENTRIES IN IT_EKKO
          WHERE EBELN EQ IT_EKKO-EBELN.
    IF NOT IT_EKPO[] IS INITIAL.
          SELECT  EMATN WAERS WERKS GJAHR BEWTP INTO CORRESPONDING FIELDS OF TABLE IT_EKBE FROM EKBE FOR ALL ENTRIES IN IT_EKPO
            WHERE EBELN EQ IT_EKPO-EBELN
             AND  EBELP EQ IT_EKPO-EBELP
             AND  BEWTP EQ 'E' OR BEWTP EQ 'Q'.
            ENDIF.
            ENDIF.
    please tell me how to populate data from it_ekko,it_ekpo and it_ekbe into an internal table ITAB.

    Hi Mayana,
    You take one final structure & final internal table, & within that structure take all the fields which is required to be displayed as a final output.
    for data fetching from different table, you take three different structures & three internal table for that, because into corresponding fields of table is not good for performance wise. Use into table syntax.
    follow the below example:(similarly)
    sort it_klah by key fields.
    LOOP AT IT_KSSK INTO WA_KSSK.
        READ TABLE IT_KLAH INTO WA_KLAH WITH KEY CLINT = WA_KSSK-CLINT
                                                 KLART = WA_KSSK-KLART.
        IF SY-SUBRC EQ 0.
          MOVE:  WA_KLAH-OBJEK to WA_final-OBJEK.
    Read another table........(2nd one)
    IF SY-SUBRC EQ 0.
          MOVE:  ....................................
          APPEND WA_final TO IT_final.
        ENDIF.
    clear wa_final.
      ENDLOOP.
    finally display it_final records.
    Hope this can solve your problems.
    Regards,
    Tutun

  • HT1975 Why does the location on my iphone show three different places when I'm not even there?

    When I use the iphone app find myiphone- why does it sometimes show 3 different addresses and streets when locating the phone.

    Because GPS is not perfect, especially when the device is inside a building.

  • WPF: How to make the first column does not show row separator and Left column separator in DataGrid?

    Our WPF application uses DataGrid.
    One of request is that first column of DataGrid does not show row separator and also does not show Left column separator. So it looks like the first column does not belong to the DataGrid. However, when select a row, the cell of first column still get selected.
    How do we make it? Thx!
    JaneC

    Hi Magnus,
    Thanks for replying our question and provide your solution!
    Your solution works by setting "HorizontalGridLinesBrush" and "VerticalGridLinesBrush" to {x:Null} in the DataGrid style and modify "CellStyle" in first column as following:
    <DataGridTextColumn MinWidth="32"
    Binding="{Binding CellName}"
    CanUserReorder="False"
    CanUserSort="False"
    Header="Cell}"
    IsReadOnly="true" >
    <DataGridTextColumn.CellStyle>
    <Style TargetType="DataGridCell">
    <Setter Property="IsEnabled" Value="False"></Setter>
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type DataGridCell}">
    <Border BorderThickness="0" BorderBrush="{x:Null}"
    Background="{Binding Background, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Margin="-1">
    <Grid Background="{TemplateBinding Background}" VerticalAlignment="Center" Height="42">
    <ContentPresenter VerticalAlignment="Center"/>
    </Grid>
    </Border>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    </DataGridTextColumn.CellStyle>
    </DataGridTextColumn>
    We found another way to achieve it by using DataGridRowHeader. The good way to use DataGridRowHeader is that we do not need to make the first column ReadOnly (click on first column does not select whole row anymore). Select RowHeader in a row will select
    whole row. Move scroll bar horizontally, the row header still keep in visible area.
    <Style TargetType="{x:Type DataGridRowHeader}" x:Key="dataGridRowHeaderStyle">
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="HorizontalAlignment" Value="Center" />
    <Setter Property="Height" Value="42" />
    <Setter Property="SeparatorBrush" Value="{x:Null}" />
    <Setter Property="FontSize" Value="16" />
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type DataGridRowHeader}">
    <Grid>
    <Border x:Name="rowHeaderBorder"
    BorderThickness="0"
    Padding="3,0,3,0"
    Background="{Binding Background, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
    BorderBrush="{x:Null}">
    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
    </Border>
    </Grid>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    <DataGrid>
    <DataGrid.RowHeaderStyle>
    <Style TargetType="DataGridRowHeader" BasedOn="{StaticResource dataGridRowHeaderStyle}">
    <Setter Property="Content" Value="{Binding CellName}" />
    <Setter Property="Width" Value="35"/>
    </Style>
    </DataGrid.RowHeaderStyle>
    </<DataGrid>
    JaneC

  • How to make tabs show up selectively in different pages?

    Hi,
    I'm new to APEX and getting my hands dirty now...
    I have a standard Tab Set called "TS1", which has 2 tabs (say, tab1 and tab2) in there. Since tabs are under "shared component", so it appears that they are shared throughout all the 10 pages I have.
    How can I make the tabs show up selectively in different pages? For example, I want tab1 and tab2 showing up in page1-9, but NOT in page10. There's a "conditions" (Condition Type), but it has many types and I don't know how to use it.
    Please kindly help!
    Thanks much,
    Helen

    I have a similar requirement. I have several tabs (Operations, Maintenance, Safety, etc.) and users get individually assigned rights. I have a table where I have all the users listed and I added one column for each tab so I can set whether or not that user has access to that tab. You could go the same thing with groups if you want.
    Basically, my table looks like this:
    USER_ID, USER_NM, PWD_HASH, SAFETY_TAB, MAINT_TAB, OPER_TAB, etc.
    where each of the _TAB fields is set up as a VARCHAR2(2) for just Y/N.
    On my home page, I assign an APPLICATION_ITEM called G_USER_ID (Global User ID) on login so I can track who it is. Then I set the condition statement on the tab to SQL QUERY RETURNS AT LEAST ONE ROW
    using the following query:
    select SAFETY_TAB from APEX_USERS
    where SAFETY_TAB = 'Y'
      and USER_ID = :G_USER_IDThis example would be for the Safety tab, but you can easily substitute others. It works pretty slick.

Maybe you are looking for

  • ITunes 10.2.1 wiped out everything

    Hey! Automatically installed the 10.2.1 update last night. Opened iTunes this morning and guess what? No music, no podcasts, no nothing at all. Looking in my music folder in my home folder, seems like everything has been deleted. The album artwork an

  • X200 Tablet - BlueScreen Windows Vista and Windows 7

    I have some troubles with my laptop, it sometime happens Bluescreen with these notice, after upgrade windows 7 from Vista I also have this error. Please help me to fix BlueScreen, I fell unhappy when it immediately turn off and retart because of this

  • Is there a way to see those deleted stale computers in SCCM 2012?

    Hi, There is an option in SCCM 2012 to only discover computers that have logged on to a domain in a given period of time and I believe that it deletes stale computers given that condition, right? Is there a way I can see those deleted computers? This

  • How to enable back ipad if on disabled mode?

    Anybody can help me on this , I forget my passcode. How to enable back my Ipad?

  • MOVED: how to disable on-board graphic

    This topic has been moved to MSI Notebooks & Netbooks. https://forum-en.msi.com/index.php?topic=171267.0