Click here to Skip to main content
15,890,670 members
Home / Discussions / WPF
   

WPF

 
QuestionSL application does not works-nothing change Pin
picasso28-May-13 18:48
picasso28-May-13 18:48 
AnswerRe: SL application does not works-nothing change Pin
Abhinav S12-May-13 7:45
Abhinav S12-May-13 7:45 
QuestionBinding issues with Treeview C# WPF Pin
bartbartb2-May-13 11:41
bartbartb2-May-13 11:41 
AnswerRe: Binding issues with Treeview C# WPF Pin
Kenneth Haugland3-May-13 2:22
mvaKenneth Haugland3-May-13 2:22 
AnswerRe: Binding issues with Treeview C# WPF Pin
Mycroft Holmes9-May-13 12:23
professionalMycroft Holmes9-May-13 12:23 
QuestionVisualTreeHelper.HitTest / RectangleGeometry not working... Pin
SledgeHammer012-May-13 7:26
SledgeHammer012-May-13 7:26 
AnswerRe: VisualTreeHelper.HitTest / RectangleGeometry not working... Pin
Kenneth Haugland2-May-13 7:38
mvaKenneth Haugland2-May-13 7:38 
QuestionTab Closing Problem Pin
Kevin Marois1-May-13 20:14
professionalKevin Marois1-May-13 20:14 
I posted on this a while back, and I'v tried some things but still cannot get this to work.

The Problem
When I have multiple tabs open, and I click the Close X on a NON-ACTIVE tab, the active tab is closed.

The XAML
<UserControl.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="..\Resources.xaml"/>
        </ResourceDictionary.MergedDictionaries>

        <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 RelativeSource={RelativeSource AncestorType={x:Type TabItem}}, Path=DataContext.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/closetab_24.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>

                            </Button>

                        </Grid>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
          
    </ResourceDictionary>
</UserControl.Resources>


The problem as I see it is that the view model doesn't know which tab fired the command.

Can someone help me figure this out?

Thanks
If it's not broken, fix it until it is

AnswerRe: Tab Closing Problem Pin
AlphaDeltaTheta3-May-13 4:49
AlphaDeltaTheta3-May-13 4:49 
QuestionAsynchronous Call Using MVVM Pin
jonkjon29-Apr-13 10:21
jonkjon29-Apr-13 10:21 
AnswerRe: Asynchronous Call Using MVVM Pin
SledgeHammer0129-Apr-13 10:32
SledgeHammer0129-Apr-13 10:32 
GeneralRe: Asynchronous Call Using MVVM Pin
jonkjon29-Apr-13 10:48
jonkjon29-Apr-13 10:48 
Questionwin32 window as c# wpf control Pin
mkusnjer29-Apr-13 8:58
mkusnjer29-Apr-13 8:58 
AnswerRe: win32 window as c# wpf control Pin
SledgeHammer0129-Apr-13 9:28
SledgeHammer0129-Apr-13 9:28 
GeneralRe: win32 window as c# wpf control Pin
mkusnjer30-Apr-13 5:19
mkusnjer30-Apr-13 5:19 
GeneralRe: win32 window as c# wpf control Pin
SledgeHammer0130-Apr-13 10:58
SledgeHammer0130-Apr-13 10:58 
GeneralRe: win32 window as c# wpf control Pin
mkusnjer1-May-13 8:31
mkusnjer1-May-13 8:31 
GeneralRe: win32 window as c# wpf control Pin
SledgeHammer011-May-13 10:46
SledgeHammer011-May-13 10:46 
GeneralRe: win32 window as c# wpf control Pin
mkusnjer1-May-13 12:11
mkusnjer1-May-13 12:11 
GeneralRe: win32 window as c# wpf control Pin
SledgeHammer011-May-13 12:20
SledgeHammer011-May-13 12:20 
GeneralRe: win32 window as c# wpf control Pin
mkusnjer1-May-13 12:39
mkusnjer1-May-13 12:39 
GeneralRe: win32 window as c# wpf control Pin
SledgeHammer011-May-13 13:00
SledgeHammer011-May-13 13:00 
GeneralRe: win32 window as c# wpf control Pin
mkusnjer1-May-13 13:24
mkusnjer1-May-13 13:24 
AnswerRe: win32 window as c# wpf control Pin
AlphaDeltaTheta3-May-13 4:33
AlphaDeltaTheta3-May-13 4:33 
QuestionDynamically create radiobuttons under the group header that can span to N - number of groups Pin
Rajesh Sajjanar27-Apr-13 10:29
Rajesh Sajjanar27-Apr-13 10:29 

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

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