Use Slider to control the Transformation : Slider Data Binding « Windows Presentation Foundation « C# / CSharp Tutorial

Home
C# / CSharp Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statement
5.String
6.struct
7.Class
8.Operator Overload
9.delegate
10.Attribute
11.Data Structure
12.Assembly
13.Date Time
14.Development
15.File Directory Stream
16.Preprocessing Directives
17.Regular Expression
18.Generic
19.Reflection
20.Thread
21.I18N Internationalization
22.LINQ
23.GUI Windows Forms
24.Windows Presentation Foundation
25.Windows Communication Foundation
26.Workflow
27.2D
28.Design Patterns
29.Windows
30.XML
31.XML LINQ
32.ADO.Net
33.Network
34.Directory Services
35.Security
36.unsafe
C# / C Sharp
C# / C Sharp by API
C# / CSharp Open Source
C# / CSharp Tutorial » Windows Presentation Foundation » Slider Data Binding 
24.27.4.Use Slider to control the Transformation
<StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Label Content="Angle" />
    <ScrollBar Name="angle" Orientation="Horizontal" Value="0" Minimum="0" Maximum="360" />
    <TextBlock HorizontalAlignment="Center" Text="{Binding ElementName=angle, Path=Value}" />

    <Label Content="CenterX" />
    <ScrollBar Name="xcenter" Orientation="Horizontal" Value="0" Minimum="-100" Maximum="100" /> 
    <TextBlock HorizontalAlignment="Center" Margin="12" Text="{Binding ElementName=xcenter, Path=Value}" />

    <Label Content="CenterY" />
    <ScrollBar Name="ycenter" Orientation="Horizontal" Value="0" Minimum="-100" Maximum="100" />
    <TextBlock HorizontalAlignment="Center" Margin="12" Text="{Binding ElementName=ycenter, Path=Value}" />

    <Canvas>

        <Button Name="btn" Content="Button" Canvas.Left="100" Canvas.Top="100">
            <Button.RenderTransform>
                <RotateTransform
                    Angle="{Binding ElementName=angle, Path=Value}"
                    CenterX="{Binding ElementName=xcenter, Path=Value}"
                    CenterY="{Binding ElementName=ycenter, Path=Value}" />
            </Button.RenderTransform>
        </Button>

        <StackPanel>
            <TextBlock Text="{Binding ElementName=btn, Path=ActualWidth}" />
            <TextBlock Text="::" />
            <TextBlock Text="{Binding ElementName=btn, Path=ActualHeight}" />
        </StackPanel>
    </Canvas>
</StackPanel>
WPF Use Slider To Control The Transformation
24.27.Slider Data Binding
24.27.1.Use Slider to control the ScaleTransformUse Slider to control the ScaleTransform
24.27.2.Use Slider to control SkewTransformUse Slider to control SkewTransform
24.27.3.Use Slider to control TranslateTransformUse Slider to control TranslateTransform
24.27.4.Use Slider to control the TransformationUse Slider to control the Transformation
24.27.5.Bind Slider value to TextBlockBind Slider value to TextBlock
24.27.6.Use Slider to control the BlurUse Slider to control the Blur
24.27.7.Use Slider to control Drop ShadowUse Slider to control Drop Shadow
24.27.8.Use Slider to control the EmbossUse Slider to control the Emboss
24.27.9.Use Slider to control the GlowUse Slider to control the Glow
24.27.10.Use Slider to control the BevelUse Slider to control the Bevel
24.27.11.Binding ProgressBar with SliderBinding ProgressBar with Slider
24.27.12.Two way data binding between Slider and ProgressBarTwo way data binding between Slider and ProgressBar
24.27.13.Use Slider to control Path ScalingUse Slider to control Path Scaling
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.