Click here to Skip to main content
       

Silverlight / WPF

 
QuestionRoutedEvent vs AttachedEvent Pinmemberdevvvy29-Jan-13 22:30 
AnswerRe: RoutedEvent vs AttachedEvent PinprotectorPete O'Hanlon29-Jan-13 22:51 
GeneralRe: RoutedEvent vs AttachedEvent [modified] Pinmemberdevvvy29-Jan-13 23:02 
GeneralRe: RoutedEvent vs AttachedEvent PinprotectorPete O'Hanlon30-Jan-13 0:45 
GeneralRe: RoutedEvent vs AttachedEvent Pinmemberdevvvy30-Jan-13 2:40 
GeneralRe: RoutedEvent vs AttachedEvent PinprotectorPete O'Hanlon30-Jan-13 2:44 
GeneralRe: RoutedEvent vs AttachedEvent Pinmemberdevvvy30-Jan-13 3:08 
QuestionWPF Tab Item Close Button [modified] PinmemberKevin Marois29-Jan-13 18:03 
I created a tab stle so that it has a close button. The button is bound to a command:
<Style TargetType="{x:Type TabItem}">
    <Setter Property="ContextMenu">
        <Setter.Value>
            <ContextMenu>
                <MenuItem Header="Close"
                            Command="{Binding CloseTabCommand}"/>
                <MenuItem Header="Close All But This" 
                            Command="{Binding CloseAllOtherTabsCommand}"/>
                <MenuItem Header="Float"
                            Command="{Binding FloatTabCommand}"/>
            </ContextMenu>
        </Setter.Value>
    </Setter>
</Style>
 
I tried this:
<MenuItem Header="Close"
            Command="{Binding CloseTabCommand}"
            CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type TabItem}}}"/>
 
but I get null passed to the command.
 
I need to pass along a reference to the tab. Can someone show me how to get the tab in this style and pass it as a parameter?
 

 
Thank you
If it's not broken, fix it until it is


modified 30-Jan-13 0:12am.

AnswerRe: WPF Tab Item Close Button PinmemberSledgeHammer0129-Jan-13 19:02 
GeneralRe: WPF Tab Item Close Button PinmemberKevin Marois2-Feb-13 15:33 
GeneralRe: WPF Tab Item Close Button PinmemberSledgeHammer012-Feb-13 18:25 
QuestionCustom Control Template for beginners Pinmemberjeffdavis870329-Jan-13 9:12 
AnswerRe: Custom Control Template for beginners PinmemberSledgeHammer0129-Jan-13 11:32 
GeneralRe: Custom Control Template for beginners Pinmemberjeffdavis870329-Jan-13 12:10 
GeneralRe: Custom Control Template for beginners PinmemberSledgeHammer0129-Jan-13 12:46 
GeneralTreeview Selection Pinmembervijilvs11628-Jan-13 23:03 
QuestionProblem With TreeViewItem Tooltip [modified] PinmemberKevin Marois26-Jan-13 15:39 
GeneralRe: Problem With TreeViewItem Tooltip PinmemberThomas Duwe29-Jan-13 1:46 
QuestionHow to get a value from treeview. Pinmemberboryborawski26-Jan-13 12:06 
QuestionConstant header and footer Pinmembercolumbos1492725-Jan-13 23:11 
AnswerRe: Constant header and footer PinmvpRichard MacCutchan26-Jan-13 0:05 
QuestionWPF.MDI Pinmembercolumbos1492725-Jan-13 8:37 
AnswerRe: WPF.MDI PinmemberAbhishek Pant25-Jan-13 9:29 
GeneralRe: WPF.MDI Pinmembercolumbos1492725-Jan-13 22:11 
GeneralRe: WPF.MDI PinmemberAbhishek Pant25-Jan-13 22:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 25 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid