Click here to Skip to main content
16,008,183 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Adding datagrid cell images at runtime doesn't appear in cell Pin
alleyes22-Jul-12 17:07
professionalalleyes22-Jul-12 17:07 
GeneralUnintended Save Issue WPF Pin
eddieangel20-Jul-12 7:20
eddieangel20-Jul-12 7:20 
GeneralRe: Unintended Save Issue WPF Pin
Ian Shlasko20-Jul-12 7:31
Ian Shlasko20-Jul-12 7:31 
GeneralRe: Unintended Save Issue WPF Pin
eddieangel20-Jul-12 7:37
eddieangel20-Jul-12 7:37 
GeneralRe: Unintended Save Issue WPF Pin
Ian Shlasko20-Jul-12 7:45
Ian Shlasko20-Jul-12 7:45 
GeneralRe: Unintended Save Issue WPF Pin
eddieangel20-Jul-12 7:49
eddieangel20-Jul-12 7:49 
GeneralRe: Unintended Save Issue WPF Pin
Ian Shlasko20-Jul-12 8:16
Ian Shlasko20-Jul-12 8:16 
QuestionButton Style Question Pin
Kevin Marois19-Jul-12 9:21
professionalKevin Marois19-Jul-12 9:21 
I created the following button style. I want to set the image's opacity to 50% when the button is disabled. I have the Image.Style code in there, but how do I bind the IsEnabled to the button? See my comment in line.

<Style TargetType="{x:Type controls:FlatButton}"
            x:Key="FlatButtonStyle">

    <Setter Property="Height" Value="35"/>
    <Setter Property="Width" Value="80"/>
    <Setter Property="Margin" Value="2"/>

    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type controls:FlatButton}">

                <Border x:Name="TheBorder"
                        Background="Transparent"
                        BorderBrush="#6F6F6F"
                        BorderThickness="0"
                        CornerRadius="2">

                    <StackPanel Orientation="Horizontal">

                        <Image Source="{TemplateBinding ImageSource}"
                                Grid.Row="0"
                                Grid.Column="0"
                                Width="16" 
                                Height="16"
                                Margin="3,0,2,0"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Stretch="Fill">

                            <Image.Style>
                                <Style TargetType="Image">
                                    <Style.Triggers>
                                        <!--How do I bind to the IsEnabled property on the button?-->
                                        <Trigger Property="IsEnabled" Value="False">
                                            <Setter Property="Opacity" Value="0.5" />
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </Image.Style>

                        </Image>

                        <TextBlock Text="{TemplateBinding Caption}"
                                    Grid.Row="0"
                                    Grid.Column="1"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    Margin="10"
                                    Foreground="#5D5D9D"
                                    FontSize="12"
                                    TextWrapping="WrapWithOverflow"/>


                    </StackPanel>

                </Border>

                <ControlTemplate.Triggers>
                    <Trigger Property="IsMouseOver"
                                    Value="True">
                        <Setter TargetName="TheBorder"
                                    Property="BorderThickness"
                                    Value=".5">
                        </Setter>
                    </Trigger>

                </ControlTemplate.Triggers>

            </ControlTemplate>

        </Setter.Value>
    </Setter>
</Style>

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

AnswerRe: Button Style Question Pin
Wayne Gaylard19-Jul-12 20:15
professionalWayne Gaylard19-Jul-12 20:15 
Questiontip for scrollviewer Pin
caradri18-Jul-12 23:10
caradri18-Jul-12 23:10 
GeneralRe: tip for scrollviewer Pin
Wayne Gaylard18-Jul-12 23:38
professionalWayne Gaylard18-Jul-12 23:38 
GeneralRe: tip for scrollviewer Pin
caradri19-Jul-12 1:16
caradri19-Jul-12 1:16 
GeneralRe: tip for scrollviewer Pin
Mycroft Holmes19-Jul-12 12:48
professionalMycroft Holmes19-Jul-12 12:48 
GeneralRe: tip for scrollviewer Pin
Christian Amado19-Jul-12 17:43
professionalChristian Amado19-Jul-12 17:43 
GeneralRe: tip for scrollviewer Pin
Pete O'Hanlon19-Jul-12 20:20
mvePete O'Hanlon19-Jul-12 20:20 
GeneralRe: tip for scrollviewer Pin
Mycroft Holmes19-Jul-12 23:19
professionalMycroft Holmes19-Jul-12 23:19 
GeneralRe: tip for scrollviewer Pin
Pete O'Hanlon19-Jul-12 23:27
mvePete O'Hanlon19-Jul-12 23:27 
AnswerRe: tip for scrollviewer Pin
Christian Amado20-Jul-12 0:56
professionalChristian Amado20-Jul-12 0:56 
GeneralRe: tip for scrollviewer Pin
Pete O'Hanlon20-Jul-12 1:32
mvePete O'Hanlon20-Jul-12 1:32 
AnswerRe: tip for scrollviewer Pin
Christian Amado20-Jul-12 3:37
professionalChristian Amado20-Jul-12 3:37 
GeneralRe: tip for scrollviewer Pin
Pete O'Hanlon20-Jul-12 4:03
mvePete O'Hanlon20-Jul-12 4:03 
QuestionHow to open second page on click event Pin
Vikash Yadav16-Jul-12 23:15
Vikash Yadav16-Jul-12 23:15 
AnswerRe: How to open second page on click event Pin
maciej.tokarz17-Jul-12 3:01
maciej.tokarz17-Jul-12 3:01 
AnswerRe: How to open second page on click event Pin
Mycroft Holmes17-Jul-12 12:39
professionalMycroft Holmes17-Jul-12 12:39 
AnswerRe: How to open second page on click event Pin
Abhinav S17-Jul-12 16:01
Abhinav S17-Jul-12 16:01 

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.