Click here to Skip to main content
15,897,273 members
Home / Discussions / WPF
   

WPF

 
QuestionAccess xml file from .xaml page Pin
arkiboys18-Feb-11 5:16
arkiboys18-Feb-11 5:16 
AnswerRe: Access xml file from .xaml page Pin
Abhinav S18-Feb-11 6:24
Abhinav S18-Feb-11 6:24 
QuestionMVVM: Best Practices and Design Patterns Pin
IngoVals18-Feb-11 4:54
IngoVals18-Feb-11 4:54 
AnswerRe: MVVM: Best Practices and Design Patterns Pin
Abhinav S18-Feb-11 6:20
Abhinav S18-Feb-11 6:20 
AnswerRe: MVVM: Best Practices and Design Patterns Pin
SledgeHammer0118-Feb-11 6:56
SledgeHammer0118-Feb-11 6:56 
AnswerRe: MVVM: Best Practices and Design Patterns Pin
BubingaMan22-Feb-11 4:35
BubingaMan22-Feb-11 4:35 
QuestionOpen WPF Application from within Excel Add-In Pin
muelito18-Feb-11 3:18
muelito18-Feb-11 3:18 
Question2 different styles - 2 different objects - both affected the same way??? Pin
bigwillyca17-Feb-11 6:35
bigwillyca17-Feb-11 6:35 
I have 2 styles. One targeting a ToggleButton and one targeting a checkbox. However when I run the application, if I click one, both change. I've pasted my code, I'm totally stuck.
<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	x:Class="WpfApplication1.MainWindow"
	x:Name="Window"
	Title="MainWindow"
	Width="640" Height="480">
    <Window.Resources>
        <LinearGradientBrush x:Key="Button_Pill_Selected_Background" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFC6D3D9" Offset="0"/>
            <GradientStop Color="#FFE1E7EB" Offset="0.991"/>
            <GradientStop Color="#FFCFD9DF" Offset="0.467"/>
            <GradientStop Color="#FFE1E7EB" Offset="0.556"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="Button_Pill_Selected_BorderBrush" Color="#FF415469"/>
        <LinearGradientBrush x:Key="Button_Pill_Unselected_Background" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="White" Offset="0"/>
            <GradientStop Color="#FFD5DEE8" Offset="0.991"/>
            <GradientStop Color="White" Offset="0.461"/>
            <GradientStop Color="#FFE3E8EF" Offset="0.556"/>
        </LinearGradientBrush>

        <Style x:Key="ZoomToggleButtonStyle" TargetType="CheckBox">
            <Setter Property="Template" x:Name="zoomTemplate">
                <Setter.Value>
                    <ControlTemplate TargetType="CheckBox"  x:Name="zomtemplate">
                        <Grid x:Name="zoomToggleButton">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CheckStates">
                                    <VisualState x:Name="Indeterminate"/>
                                    <VisualState x:Name="Checked">
                                        <Storyboard>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFC6D3D9"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE1E7EB"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFCFD9DF"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE1E7EB"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.991"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.467"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.556"/>
                                            </DoubleAnimationUsingKeyFrames>

                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="White"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFD5DEE8"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="White"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE3E8EF"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.991"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.461"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.556"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>

                                    <VisualState x:Name="Unchecked">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFC6D3D9"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE1E7EB"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFCFD9DF"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE1E7EB"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.991"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.467"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomLeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.556"/>
                                            </DoubleAnimationUsingKeyFrames>

                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="White"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFD5DEE8"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="White"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE3E8EF"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.991"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.461"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="zoomRightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.556"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>

                                    </VisualState>

                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <StackPanel Orientation="Horizontal">
                                <Border x:Name="zoomLeftSide" BorderBrush="{StaticResource Button_Pill_Selected_BorderBrush}" BorderThickness="1" CornerRadius="12,0,0,12" Background="{StaticResource Button_Pill_Selected_Background}" Height="24" Width="30">
                                    <StackPanel Orientation="Horizontal">
                                        <Image x:Name="ZoomLeftImage" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,3,0,3"/>

                                    </StackPanel>
                                </Border>
                                <Border x:Name="zoomRightSide" BorderBrush="#FF415469" BorderThickness="1" CornerRadius="0,12,12,0" Background="{StaticResource Button_Pill_Unselected_Background}" Height="24" Width="30" RenderTransformOrigin="0.5,0.5">
                                    <StackPanel Orientation="Horizontal">
                                        <Image x:Name="ZoomRightImage" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,3,0,3"/>
                                    </StackPanel>
                                </Border>
                            </StackPanel>

                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ToggleButtonStyle" TargetType="ToggleButton">
            <Setter Property="Template" x:Name="panTemplate">
                <Setter.Value>
                    <ControlTemplate TargetType="ToggleButton" x:Name="toggletemplate">
                        <Grid x:Name="panSelectToggleButton">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CheckStates">
                                    <VisualState x:Name="Indeterminate"/>
                                    <VisualState x:Name="Checked">
                                        <Storyboard>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFC6D3D9"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE1E7EB"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFCFD9DF"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE1E7EB"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.991"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.467"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.556"/>
                                            </DoubleAnimationUsingKeyFrames>

                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="White"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFD5DEE8"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="White"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE3E8EF"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.991"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.461"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.556"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>

                                    <VisualState x:Name="Unchecked">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFC6D3D9"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE1E7EB"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFCFD9DF"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE1E7EB"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.991"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.467"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="LeftSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.556"/>
                                            </DoubleAnimationUsingKeyFrames>

                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="White"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFD5DEE8"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="White"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFE3E8EF"/>
                                            </ColorAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.991"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.461"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="RightSide" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Offset)">
                                                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.556"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>

                                    </VisualState>

                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <StackPanel Orientation="Horizontal">
                                <Border x:Name="LeftSide" BorderBrush="{StaticResource Button_Pill_Selected_BorderBrush}" BorderThickness="1" CornerRadius="12,0,0,12" Background="{StaticResource Button_Pill_Selected_Background}" Height="24" Width="75">
                                    <StackPanel Orientation="Horizontal">
                                        <Image x:Name="leftImage" Width="12" Source="" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,3,0,3"/>
                                        <TextBlock Text="Pan" FontFamily="Segoe UI" FontSize="14" Foreground="#FF1B4C85" VerticalAlignment="Center" Margin="5,3,0,3"/>
                                    </StackPanel>
                                </Border>
                                <Border x:Name="RightSide" BorderBrush="#FF415469" BorderThickness="1" CornerRadius="0,12,12,0" Background="{StaticResource Button_Pill_Unselected_Background}" Height="24" Width="75" RenderTransformOrigin="0.5,0.5">
                                    <StackPanel Orientation="Horizontal">
                                        <Image x:Name="rightImage" Width="12" Source="" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,3,0,3"/>
                                        <TextBlock Text="Select" FontFamily="Segoe UI" FontSize="14" Foreground="#FF1B4C85" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,3,0,3"/>
                                    </StackPanel>
                                </Border>
                            </StackPanel>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="testToggleButtonStyle" TargetType="ToggleButton">
            <Setter Property="Width" Value="20"/>
            <Setter Property="Height" Value="20"/>


        </Style>
    </Window.Resources>
    <Grid x:Name="LayoutRoot">
        <StackPanel>
            <ToggleButton x:Name="pan" Style="{StaticResource ToggleButtonStyle}" Margin="20,20,20,20" />
            <CheckBox x:Name="zoom" Style="{StaticResource ZoomToggleButtonStyle}"  Margin="20,20,20,20"/>
            <CheckBox Style="{StaticResource testToggleButtonStyle}" x:Name="test" Margin="20,20,20,20"/>
        </StackPanel>
    </Grid>
</Window>

AnswerRe: 2 different styles - 2 different objects - both affected the same way??? Pin
dasblinkenlight18-Feb-11 3:06
dasblinkenlight18-Feb-11 3:06 
GeneralRe: 2 different styles - 2 different objects - both affected the same way??? Pin
bigwillyca18-Feb-11 5:02
bigwillyca18-Feb-11 5:02 
QuestionHow to sort the items under some node in Silverlight tree view? Pin
Tesic Goran17-Feb-11 3:20
professionalTesic Goran17-Feb-11 3:20 
AnswerRe: How to sort the items under some node in Silverlight tree view? Pin
SledgeHammer0117-Feb-11 7:14
SledgeHammer0117-Feb-11 7:14 
GeneralRe: How to sort the items under some node in Silverlight tree view? Pin
Tesic Goran17-Feb-11 19:35
professionalTesic Goran17-Feb-11 19:35 
Answersymbols not loaded Pin
cmichaelgraham17-Feb-11 3:04
cmichaelgraham17-Feb-11 3:04 
GeneralRe: symbols not loaded Pin
SledgeHammer0117-Feb-11 7:12
SledgeHammer0117-Feb-11 7:12 
GeneralRe: symbols not loaded Pin
Abhinav S17-Feb-11 17:49
Abhinav S17-Feb-11 17:49 
QuestionHow to restyle tab control in WPF Pin
Tridip Bhattacharjee16-Feb-11 23:09
professionalTridip Bhattacharjee16-Feb-11 23:09 
AnswerRe: How to restyle tab control in WPF Pin
SledgeHammer0117-Feb-11 7:10
SledgeHammer0117-Feb-11 7:10 
QuestionOpen a new Window from a Page in silverlight 4.0 Pin
Member-495917616-Feb-11 22:54
Member-495917616-Feb-11 22:54 
AnswerRe: Open a new Window from a Page in silverlight 4.0 Pin
#realJSOP17-Feb-11 7:11
professional#realJSOP17-Feb-11 7:11 
Questionbackground worker Pin
arkiboys14-Feb-11 3:48
arkiboys14-Feb-11 3:48 
AnswerRe: background worker Pin
Pete O'Hanlon14-Feb-11 10:08
mvePete O'Hanlon14-Feb-11 10:08 
GeneralRe: background worker Pin
arkiboys15-Feb-11 2:40
arkiboys15-Feb-11 2:40 
GeneralRe: background worker PinPopular
Ian Shlasko15-Feb-11 3:16
Ian Shlasko15-Feb-11 3:16 
GeneralRe: background worker Pin
musefan15-Feb-11 3:44
musefan15-Feb-11 3:44 

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.