Click here to Skip to main content
15,886,110 members
Home / Discussions / WPF
   

WPF

 
QuestionPrism and Login Page problem Pin
gio_ab23-Mar-12 3:25
gio_ab23-Mar-12 3:25 
AnswerRe: Prism and Login Page problem Pin
Abhinav S23-Mar-12 17:27
Abhinav S23-Mar-12 17:27 
QuestionWPF C1Flexgrid Pin
Greeshma M J22-Mar-12 20:24
Greeshma M J22-Mar-12 20:24 
AnswerRe: WPF C1Flexgrid Pin
RugbyLeague23-Mar-12 6:51
RugbyLeague23-Mar-12 6:51 
GeneralRe: WPF C1Flexgrid Pin
Greeshma M J25-Mar-12 18:26
Greeshma M J25-Mar-12 18:26 
QuestionUpload images to Server Pin
sudheesh kumar s22-Mar-12 2:51
sudheesh kumar s22-Mar-12 2:51 
QuestionExpander Styling Question Pin
Kevin Marois20-Mar-12 14:13
professionalKevin Marois20-Mar-12 14:13 
AnswerRe: Expander Styling Question Pin
Varsha Ramnani21-Mar-12 0:49
professionalVarsha Ramnani21-Mar-12 0:49 
For Arrow Direction Change you can Use ControlTemplate.Triggers in ToggleButton ControlTemplate

<Color x:Key="Color4">Orange</Color>
<SolidColorBrush x:Key="ToggleButtonUpArrowBrush" Color="{StaticResource Color4}" />	
<ControlTemplate x:Key="ExpanderToggleButton" TargetType="{x:Type ToggleButton}"> 
        <Grid Width="16" Height="16"> 
            <Path Stroke="{StaticResource ToggleButtonArrowBrush}"
                    Data="M 3,4 l 5,5 5,-5" /> 
            <Path Stroke="{StaticResource ToggleButtonArrowBrush}"
                    Data="M 3,7 l 5,5 5,-5" /> 
            <ContentPresenter VerticalAlignment="Center"
                                HorizontalAlignment="Center"
                                Content="{TemplateBinding Content}" /> 
        </Grid> 
        <ControlTemplate.Triggers>
	     <Trigger Property="IsChecked" Value="true">
                <Setter Property="Data" TargetName="arrow1" Value="M 3,9 l 5,-5 5,5"/>
		<Setter Property="Data" TargetName="arrow2" Value="M 3,6 l 5,-5 5,5"/>
		<Setter Property="Stroke" TargetName="arrow1" Value="{StaticResource ToggleButtonUpArrowBrush}"/>
		<Setter Property="Stroke" TargetName="arrow2" Value="{StaticResource ToggleButtonUpArrowBrush}"/>
             </Trigger>						
	</ControlTemplate.Triggers>
    </ControlTemplate>


And For the Left most Rectangle rather than using a Border use a rectange & use its fill property like
<Style TargetType="Expander">
    <Setter Property="Foreground" Value="{StaticResource ExpanderHeaderTextColor}" />
        <Setter Property="Template">
           <Setter.Value>
           <!-- Control template for Expander -->
                <ControlTemplate TargetType="Expander">
                    <Grid>
                      <Grid.RowDefinitions>
                         <RowDefinition Height="Auto" />
                         <RowDefinition Name="ContentRow" Height="0" />
                      </Grid.RowDefinitions>
                      <!--Header Area-->
                      <Border Name="Border" Grid.Row="0" BorderBrush="{StaticResource ExpanderBorderBrush}"
                                BorderThickness="1">
                      <Grid>
                          <Grid.ColumnDefinitions>
                              <ColumnDefinition Width="20" />
                              <ColumnDefinition Width="*" />
                              <ColumnDefinition Width="20" />
                          </Grid.ColumnDefinitions>
                          <!--Rectangle in the header-->
                         <Rectangle Grid.Row="0" x:Name="LeftPanel" Fill="{StaticResource ExpanderBorderBrush}" Width="10" HorizontalAlignment="Left"/>                          
<!-- The following puts the toggle button in the right hand column, just like I want! -->
                          <ToggleButton Grid.Column="2" IsChecked="{Binding Path=IsExpanded,Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" OverridesDefaultStyle="True" Template="{StaticResource ExpanderToggleButton}"/>
                          <ContentPresenter Grid.Column="1" Margin="5" ContentSource="Header" RecognizesAccessKey="True" />
                            </Grid>
                      </Border>
                      <!--Content Area-->
                      <Border Name="Content"
                                Grid.Row="1"
                                
                                BorderBrush="{StaticResource ExpanderBorderBrush}"
                                BorderThickness="1,0,1,1"
                                CornerRadius="0,0,3,3">
                                <ContentPresenter Margin="4" />
                            </Border>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsExpanded"
                                    Value="True">
                                <Setter TargetName="ContentRow"
                                    Property="Height"
                                    Value="{Binding ElementName=Content,Path=DesiredHeight}" />
                                <Setter TargetName="Border"
                                    Property="BorderBrush"
                                    Value="{StaticResource ExpanderBorderBrush}" />
				<Setter TargetName="LeftPanel" Property="Fill" Value="{StaticResource ToggleButtonUpArrowBrush}"/>                    
                           </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


Hope this is what you were looking for.
"The difference between who you are and who you want to be is what you want to do.... And what you have to do to get where you want to be
may not be pretty or may not come easy..."

"When I get sad, I stop being sad and be awesome instead." - Barney Stinson (from "How I Met Your Mother") - lewax00

GeneralRe: Expander Styling Question Pin
Abhinav S21-Mar-12 4:14
Abhinav S21-Mar-12 4:14 
GeneralRe: Expander Styling Question Pin
Kevin Marois21-Mar-12 7:25
professionalKevin Marois21-Mar-12 7:25 
QuestionWPF Path Pin
Kevin Marois20-Mar-12 8:44
professionalKevin Marois20-Mar-12 8:44 
AnswerRe: WPF Path Pin
Pete O'Hanlon20-Mar-12 11:42
mvePete O'Hanlon20-Mar-12 11:42 
GeneralRe: WPF Path Pin
Kevin Marois20-Mar-12 11:44
professionalKevin Marois20-Mar-12 11:44 
GeneralRe: WPF Path Pin
Kevin Marois20-Mar-12 11:56
professionalKevin Marois20-Mar-12 11:56 
GeneralRe: WPF Path Pin
Pete O'Hanlon20-Mar-12 12:23
mvePete O'Hanlon20-Mar-12 12:23 
AnswerRe: WPF Path Pin
Abhinav S21-Mar-12 4:13
Abhinav S21-Mar-12 4:13 
QuestionBind To Command On ViewModel Pin
Kevin Marois19-Mar-12 13:46
professionalKevin Marois19-Mar-12 13:46 
AnswerRe: Bind To Command On ViewModel Pin
Pete O'Hanlon20-Mar-12 5:28
mvePete O'Hanlon20-Mar-12 5:28 
GeneralRe: Bind To Command On ViewModel Pin
Kevin Marois20-Mar-12 5:55
professionalKevin Marois20-Mar-12 5:55 
GeneralRe: Bind To Command On ViewModel Pin
Pete O'Hanlon20-Mar-12 6:05
mvePete O'Hanlon20-Mar-12 6:05 
Questionslverlight 3.0 Pin
manivinof519-Mar-12 1:47
manivinof519-Mar-12 1:47 
AnswerRe: slverlight 3.0 Pin
Richard MacCutchan19-Mar-12 1:50
mveRichard MacCutchan19-Mar-12 1:50 
GeneralRe: slverlight 3.0 Pin
manivinof519-Mar-12 1:54
manivinof519-Mar-12 1:54 
GeneralRe: slverlight 3.0 Pin
Pete O'Hanlon19-Mar-12 2:00
mvePete O'Hanlon19-Mar-12 2:00 
GeneralRe: slverlight 3.0 Pin
manivinof519-Mar-12 2:05
manivinof519-Mar-12 2:05 

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.