Click here to Skip to main content
15,887,585 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: SQLite Manager Pin
Mycroft Holmes22-Jul-15 14:22
professionalMycroft Holmes22-Jul-15 14:22 
GeneralRe: SQLite Manager Pin
Richard MacCutchan22-Jul-15 22:18
mveRichard MacCutchan22-Jul-15 22:18 
AnswerRe: SQLite Manager Pin
Pete O'Hanlon22-Jul-15 22:49
mvePete O'Hanlon22-Jul-15 22:49 
GeneralRe: SQLite Manager Pin
Kevin Marois23-Jul-15 3:50
professionalKevin Marois23-Jul-15 3:50 
QuestionDataBinding to an Icon Pin
Member 1027274820-Jul-15 8:23
Member 1027274820-Jul-15 8:23 
AnswerRe: DataBinding to an Icon Pin
Herman<T>.Instance23-Jul-15 11:31
Herman<T>.Instance23-Jul-15 11:31 
GeneralRe: DataBinding to an Icon Pin
Member 1027274824-Jul-15 1:36
Member 1027274824-Jul-15 1:36 
QuestionWPF Expander - Change Image Pin
Kevin Marois15-Jul-15 6:29
professionalKevin Marois15-Jul-15 6:29 
I've created a style that allows me to use a custom image in place of the default up/down arrow in an expander. How can I create this style so that I can set the image in the place where the expander is used, instead of setting it in the style.

Thanks

Sorry, a bit long. The image is after the second comment
    <!-- ********** BASE EXPANDER STYLE********** -->
  <Style x:Key="BaseLiveViewExpanderStyle" 
           TargetType="{x:Type Expander}">

<pre>
    <Setter Property="Foreground" Value="White"/>
    <Setter Property="Background" Value="{StaticResource Gray3}"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="BorderBrush" Value="{StaticResource NormalBrush}"/>
    <Setter Property="BorderThickness" Value="2"/>
    <Setter Property="FontFamily" Value="{StaticResource AppFontName}"/>
    <Setter Property="FontSize" Value="{StaticResource NormalFontSize}"/>

</Style>

<!-- ********** SENSOR LIST EXPANDER HEADER STYLE********** -->
<Style x:Key="SensorListExpanderDownHeaderStyle" 
       TargetType="{x:Type ToggleButton}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type ToggleButton}">
                <Border Padding="{TemplateBinding Padding}">
                    <Grid Background="Transparent" SnapsToDevicePixels="False">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="19"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Image Source="/DFT.Falcon6.Shared;component/Media/Images/sensor_list_normal_16.png"/>
                        <ContentPresenter Grid.Column="1" 
                                              x:Name="cp"
                                              HorizontalAlignment="Left" 
                                              Margin="4,0,0,0" 
                                              RecognizesAccessKey="True" 
                                              SnapsToDevicePixels="True" 
                                              VerticalAlignment="Center"/>
                    </Grid>
                </Border>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsChecked" Value="false">
                        <Setter Property="Visibility" TargetName="cp" Value="Collapsed"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

<!-- ********** SENSOR LIST EXPANDER STYLE********** -->
<Style x:Key="sensorListExpanderStyle" 
       TargetType="{x:Type Expander}"
       BasedOn="{StaticResource BaseLiveViewExpanderStyle}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type Expander}">
                <Border BorderBrush="{TemplateBinding BorderBrush}" 
                        BorderThickness="{TemplateBinding BorderThickness}" 
                        Background="{TemplateBinding Background}" 
                        CornerRadius="3" 
                        SnapsToDevicePixels="true">
                    <DockPanel>
                        <ToggleButton x:Name="HeaderSite" 
                                      ContentTemplate="{TemplateBinding HeaderTemplate}" 
                                      ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" 
                                      Content="{TemplateBinding Header}" 
                                      DockPanel.Dock="Top" 
                                      Foreground="{TemplateBinding Foreground}" 
                                      FontWeight="{TemplateBinding FontWeight}" 
                                      FontStyle="{TemplateBinding FontStyle}" 
                                      FontStretch="{TemplateBinding FontStretch}" 
                                      FontSize="{TemplateBinding FontSize}" 
                                      FontFamily="{TemplateBinding FontFamily}" 
                                      HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                      IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" 
                                      Margin="1" 
                                      MinWidth="0" 
                                      MinHeight="0" 
                                      Padding="{TemplateBinding Padding}" 
                                      Style="{StaticResource SensorListExpanderDownHeaderStyle}" 
                                      VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        <ContentPresenter x:Name="ExpandSite" 
                                          DockPanel.Dock="Bottom" 
                                          Focusable="false" 
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                          Margin="{TemplateBinding Padding}" 
                                          Visibility="Collapsed" 
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </DockPanel>
                </Border>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsExpanded" Value="true">
                        <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>



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

QuestionCustom Drop Down Menu Button Pin
Kevin Marois7-Jul-15 8:05
professionalKevin Marois7-Jul-15 8:05 
AnswerRe: Custom Drop Down Menu Button Pin
Richard Deeming7-Jul-15 11:36
mveRichard Deeming7-Jul-15 11:36 
GeneralRe: Custom Drop Down Menu Button Pin
Kevin Marois7-Jul-15 11:42
professionalKevin Marois7-Jul-15 11:42 
QuestionApply Styles To Custom Control Pin
Kevin Marois7-Jul-15 5:36
professionalKevin Marois7-Jul-15 5:36 
AnswerRe: Apply Styles To Custom Control Pin
Richard Deeming7-Jul-15 6:57
mveRichard Deeming7-Jul-15 6:57 
GeneralRe: Apply Styles To Custom Control Pin
Kevin Marois7-Jul-15 7:03
professionalKevin Marois7-Jul-15 7:03 
GeneralRe: Apply Styles To Custom Control Pin
Richard Deeming7-Jul-15 7:07
mveRichard Deeming7-Jul-15 7:07 
GeneralRe: Apply Styles To Custom Control Pin
Kevin Marois7-Jul-15 7:10
professionalKevin Marois7-Jul-15 7:10 
GeneralRe: Apply Styles To Custom Control Pin
Richard Deeming7-Jul-15 7:13
mveRichard Deeming7-Jul-15 7:13 
GeneralRe: Apply Styles To Custom Control Pin
Kevin Marois7-Jul-15 7:19
professionalKevin Marois7-Jul-15 7:19 
GeneralRe: Apply Styles To Custom Control Pin
Richard Deeming7-Jul-15 7:41
mveRichard Deeming7-Jul-15 7:41 
GeneralRe: Apply Styles To Custom Control Pin
Kevin Marois7-Jul-15 7:55
professionalKevin Marois7-Jul-15 7:55 
GeneralRe: Apply Styles To Custom Control Pin
Richard Deeming7-Jul-15 8:17
mveRichard Deeming7-Jul-15 8:17 
GeneralRe: Apply Styles To Custom Control Pin
Kevin Marois7-Jul-15 8:18
professionalKevin Marois7-Jul-15 8:18 
Questioncheck out of canvas Pin
ngthtra29-Jun-15 21:36
ngthtra29-Jun-15 21:36 
QuestionProblem in Show/Hide Control in a WPF User Control Pin
Ashfaque Hussain29-Jun-15 20:50
Ashfaque Hussain29-Jun-15 20:50 
AnswerRe: Problem in Show/Hide Control in a WPF User Control Pin
Richard Deeming30-Jun-15 1:10
mveRichard Deeming30-Jun-15 1:10 

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.