Click here to Skip to main content

Silverlight / WPF

 
QuestionHow to play an Audio File After another has Finished in WPF MediaElement PinmemberVuyiswa Maseko4-Jan-13 4:58 
AnswerRe: How to play an Audio File After another has Finished in WPF MediaElement PinprotectorPete O'Hanlon4-Jan-13 5:13 
GeneralRe: How to play an Audio File After another has Finished in WPF MediaElement PinmemberVuyiswa Maseko4-Jan-13 7:08 
QuestionWPF tutorial book website pdf Pinmemberfrazzle-me1-Jan-13 11:44 
AnswerRe: WPF tutorial book website pdf PinmvpRichard MacCutchan1-Jan-13 23:31 
GeneralRe: WPF tutorial book website pdf Pinmemberfrazzle-me2-Jan-13 2:47 
GeneralRe: WPF tutorial book website pdf PinprotectorPete O'Hanlon2-Jan-13 6:48 
GeneralRe: WPF tutorial book website pdf PinmvpRichard MacCutchan2-Jan-13 7:09 
GeneralRe: WPF tutorial book website pdf PinprotectorPete O'Hanlon2-Jan-13 7:10 
AnswerRe: WPF tutorial book website pdf PinmvpAbhinav S2-Jan-13 3:21 
GeneralRe: WPF tutorial book website pdf Pinmemberfrazzle-me2-Jan-13 8:08 
AnswerRe: WPF tutorial book website pdf PinmemberFernando E. Braz2-Jan-13 6:15 
GeneralRe: WPF tutorial book website pdf Pinmemberfrazzle-me2-Jan-13 8:07 
QuestionWPF Tab Styling Question #2 PinmemberKevin Marois1-Jan-13 9:59 
Ok, so I have my tab style working. The tabs now show the text and a close button. Here's my style:
 
<Style TargetType="{x:Type TabItem}">
    <Setter Property="HeaderTemplate">
        <Setter.Value>
            <DataTemplate >
                <Grid HorizontalAlignment="Stretch" Height="22">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="20" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="2"  ></RowDefinition>
                        <RowDefinition Height="Auto" ></RowDefinition>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="1" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabItem} }, Path=Header}"
                                VerticalAlignment="Bottom" Margin="4,0,8,0"/>
                                
                    <Button Grid.Row="1" 
                            Grid.Column="1"
                            Height="16"
                            Width="16"
                            BorderBrush="{x:Null}" Background="{x:Null}" 
                            Foreground="#FF224A71" 
                            VerticalAlignment="Center" 
                            Padding="3,0"
                            Command="{Binding CloseTabCommand}">
                                    
                        <TextBlock Text="x"
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Center"
                                    Margin="0,0,0,2"/>
 
                        <Button.ToolTip>
                            <controls:ToolTipEx Style="{StaticResource TooltipStyle}"
                                                HeaderText="Close"
                                                Icon="/FMG.UI.WPF;component/Media/Images/home_16.png"
                                                ContentAreaText="Closes this tab"/>
 

                        </Button.ToolTip>                                    
                        <Button.OpacityMask>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="Black" Offset="0"/>
                                <GradientStop Color="#4BFFFFFF" Offset="1"/>
                            </LinearGradientBrush>
                        </Button.OpacityMask>
                                    
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <!--<Controls:CloseTabbedViewAction />-->
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Button>
                </Grid>
            </DataTemplate>
        </Setter.Value>
    </Setter>
</Style>
 
You can see the button is bound to a CloseTabCommand.
 
When I run it, the command isn't fired. Here's the command from the VM:
 
private ICommand _CloseTabCommand;
public ICommand CloseTabCommand
{
    get
    {
        if (_CloseTabCommand == null)
            _CloseTabCommand = new RelayCommand(p => closeTabExecuted(), p => closeTabCanExecute());
 
        return _CloseTabCommand;
    }
}
 
What am I doing wrong?
 
Thanks
If it's not broken, fix it until it is

AnswerRe: WPF Tab Styling Question #2 PinprotectorPete O'Hanlon1-Jan-13 10:48 
GeneralRe: WPF Tab Styling Question #2 PinmemberKevin Marois1-Jan-13 10:55 
GeneralRe: WPF Tab Styling Question #2 PinprotectorPete O'Hanlon1-Jan-13 10:56 
GeneralRe: WPF Tab Styling Question #2 PinmemberKevin Marois1-Jan-13 11:06 
GeneralRe: WPF Tab Styling Question #2 PinmentorWayne Gaylard2-Jan-13 0:00 
GeneralRe: WPF Tab Styling Question #2 PinprotectorPete O'Hanlon2-Jan-13 0:08 
GeneralRe: WPF Tab Styling Question #2 PinmemberKevin Marois2-Jan-13 16:41 
GeneralRe: WPF Tab Styling Question #2 PinprotectorPete O'Hanlon2-Jan-13 22:05 
GeneralRe: WPF Tab Styling Question #2 PinmemberKevin Marois2-Jan-13 22:40 
QuestionWPF TabItem Styling Question PinmemberKevin Marois30-Dec-12 12:16 
AnswerRe: WPF TabItem Styling Question PinprotectorPete O'Hanlon30-Dec-12 12:40 
GeneralRe: WPF TabItem Styling Question PinmemberKevin Marois30-Dec-12 16:16 
QuestionList Item Fore & Back Colors PinmemberKevin Marois29-Dec-12 8:52 
QuestionMVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? PinmemberMember 137073829-Dec-12 2:58 
AnswerRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? PinmemberSledgeHammer0129-Dec-12 8:22 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? PinmemberMember 137073829-Dec-12 16:44 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? PinmemberSledgeHammer0129-Dec-12 17:26 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? PinmemberMember 137073829-Dec-12 18:00 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? PinmemberSledgeHammer0129-Dec-12 18:25 
GeneralRe: MVVM:How to bind the MenuItem Command of ListBoxItem ContextMenu dynamically? PinmemberMember 137073829-Dec-12 20:02 
Questionmm PinmemberAishwarya aishu28-Dec-12 1:44 
AnswerRe: mm PinmvpRichard MacCutchan28-Dec-12 6:59 
Generalsiverlight PinmemberAishwarya aishu28-Dec-12 1:42 
GeneralRe: siverlight PinmvpRichard MacCutchan28-Dec-12 6:57 
QuestionDataTrigger bind to a Property Pinmembermbv80023-Dec-12 18:01 
AnswerRe: DataTrigger bind to a Property PinprotectorPete O'Hanlon23-Dec-12 20:17 
AnswerRe: DataTrigger bind to a Property PinmentorWayne Gaylard23-Dec-12 20:39 
QuestionWPF Adorner Issues PinmvpJohn Simmons / outlaw programmer17-Dec-12 11:52 
AnswerRe: WPF Adorner Issues PinmemberSledgeHammer0118-Dec-12 5:49 
GeneralRe: WPF Adorner Issues PinmvpJohn Simmons / outlaw programmer20-Dec-12 10:09 
GeneralRe: WPF Adorner Issues PinmemberSledgeHammer0121-Dec-12 5:50 
QuestionSilverlight Dynamic indexed binding [modified] PinmemberMember 934221816-Dec-12 19:02 
QuestionThird Party Controls PinmemberKevin Marois11-Dec-12 8:22 
AnswerRe: Third Party Controls PinmemberMycroft Holmes11-Dec-12 13:06 
AnswerRe: Third Party Controls PinprotectorPete O'Hanlon11-Dec-12 13:43 
GeneralRe: Third Party Controls PinmemberKevin Marois12-Dec-12 9:28 

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
Web01 | 2.8.150123.1 | Last Updated 27 Jan 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid