Click here to Skip to main content
15,889,116 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Third Party Controls Pin
Mycroft Holmes11-Dec-12 12:06
professionalMycroft Holmes11-Dec-12 12:06 
AnswerRe: Third Party Controls Pin
Pete O'Hanlon11-Dec-12 12:43
mvePete O'Hanlon11-Dec-12 12:43 
GeneralRe: Third Party Controls Pin
Kevin Marois12-Dec-12 8:28
professionalKevin Marois12-Dec-12 8:28 
GeneralRe: Third Party Controls Pin
Pete O'Hanlon12-Dec-12 8:29
mvePete O'Hanlon12-Dec-12 8:29 
GeneralRe: Third Party Controls Pin
Kevin Marois12-Dec-12 8:30
professionalKevin Marois12-Dec-12 8:30 
GeneralRe: Third Party Controls Pin
Mycroft Holmes12-Dec-12 12:02
professionalMycroft Holmes12-Dec-12 12:02 
QuestionHow can I Bind a DataTemplate Slider definition to the Code behind? Pin
maycockt10-Dec-12 5:24
maycockt10-Dec-12 5:24 
AnswerRe: How can I Bind a DataTemplate Slider definition to the Code behind? Pin
Alisaunder10-Dec-12 13:52
Alisaunder10-Dec-12 13:52 
In my project I have this xaml code for my slider

HTML
<StatusBarItem Grid.Column="5" Padding="4,0,15,0">
    <StackPanel x:Name="StatusBarSlider" Orientation="Horizontal">
        <TextBlock x:Name="StatusBarItem"
                   Margin="0,1,0,1"
                   Foreground="{Binding Foreground,
                                        ElementName=navigationPane}"
                   Padding="6,0,6,0"
                   Text="{Binding Value,
                                  ConverterParameter=%,
                                  Converter={StaticResource PercentageConverter},
                                  ElementName=scaleSlider}" />

        <RepeatButton Margin="1,0,1,0"
                      CommandTarget="{Binding ElementName=scaleSlider}"
                      ribbon:ScreenTipService.ScreenTipHeader="Zoom Out"
                      Style="{StaticResource {x:Static themes:SharedResourceKeys.StatusBarEmbeddedSliderDecreaseButtonBaseStyleKey}}" />
        <Slider x:Name="scaleSlider"
                Width="100"
                VerticalAlignment="Center"
                IsSnapToTickEnabled="True"
                LargeChange="0.5"
                Maximum="2.0"
                Minimum="0.5"
                ribbon:ScreenTipService.ScreenTipHeader="Zoom"
                SmallChange="0.1"
                TickFrequency="0.1"
                Value="1.0" />
        <RepeatButton Margin="1,0,1,0"
                      CommandTarget="{Binding ElementName=scaleSlider}"
                      ribbon:ScreenTipService.ScreenTipHeader="Zoom In"
                      Style="{StaticResource {x:Static themes:SharedResourceKeys.StatusBarEmbeddedSliderIncreaseButtonBaseStyleKey}}" />
    </StackPanel>
</StatusBarItem>


My code Behind this is

C#
// preparing tab content slider transformation
                    ScaleTransform scaleTransform = new ScaleTransform();
                    Binding scaleXBinding = new Binding("Value");
                    scaleXBinding.Source = scaleSlider;
                    Binding scaleYBinding = new Binding("Value");
                    scaleYBinding.Source = scaleSlider;

                    // binding main form slider to tab content
                    BindingOperations.SetBinding(scaleTransform,
                                                 ScaleTransform.ScaleXProperty,
                                                 scaleXBinding);
                    BindingOperations.SetBinding(scaleTransform,
                                                 ScaleTransform.ScaleYProperty,
                                                 scaleYBinding);


and since I am scaling something being displayed inside a tab I use this

C#
// adding content to new tab                    
                    newTab.Content = Contact2;

                    Contact2.contentContainer.LayoutTransform = scaleTransform;


This binds the slider control to the contents of my contacts. Hope this helps.Thumbs Up | :thumbsup:
GeneralRe: How can I Bind a DataTemplate Slider definition to the Code behind? Pin
maycockt14-Dec-12 1:18
maycockt14-Dec-12 1:18 
QuestionHow does one define IOleServiceProvider in a C# WPF application? Pin
Xarzu10-Dec-12 3:54
Xarzu10-Dec-12 3:54 
AnswerRe: How does one define IOleServiceProvider in a C# WPF application? Pin
Pete O'Hanlon10-Dec-12 4:08
mvePete O'Hanlon10-Dec-12 4:08 
QuestionSetting icons based on Region/city name?! Pin
radkrish9-Dec-12 19:43
radkrish9-Dec-12 19:43 
AnswerRe: Setting icons based on Region/city name?! Pin
Abhinav S9-Dec-12 20:12
Abhinav S9-Dec-12 20:12 
QuestionWPF ComboBox Selected Item Problem Pin
Kevin Marois8-Dec-12 10:48
professionalKevin Marois8-Dec-12 10:48 
AnswerRe: WPF ComboBox Selected Item Problem Pin
Ninja__Turtle8-Dec-12 17:43
Ninja__Turtle8-Dec-12 17:43 
AnswerRe: WPF ComboBox Selected Item Problem Pin
Wayne Gaylard8-Dec-12 18:24
professionalWayne Gaylard8-Dec-12 18:24 
GeneralRe: WPF ComboBox Selected Item Problem Pin
Kevin Marois8-Dec-12 19:37
professionalKevin Marois8-Dec-12 19:37 
GeneralRe: WPF ComboBox Selected Item Problem Pin
Kevin Marois8-Dec-12 19:37
professionalKevin Marois8-Dec-12 19:37 
GeneralRe: WPF ComboBox Selected Item Problem Pin
Wayne Gaylard8-Dec-12 19:39
professionalWayne Gaylard8-Dec-12 19:39 
QuestionAt commands Pin
Pranay Dabholkar7-Dec-12 5:56
Pranay Dabholkar7-Dec-12 5:56 
AnswerRe: At commands Pin
Abhinav S9-Dec-12 20:14
Abhinav S9-Dec-12 20:14 
QuestionCurrency Converter Pin
pjank427-Dec-12 5:44
pjank427-Dec-12 5:44 
AnswerRe: Currency Converter Pin
Pete O'Hanlon7-Dec-12 6:58
mvePete O'Hanlon7-Dec-12 6:58 
GeneralRe: Currency Converter Pin
pjank427-Dec-12 7:38
pjank427-Dec-12 7:38 
QuestionWPF Binding TextBox to Dependency Property Pin
g_ap5-Dec-12 1:02
g_ap5-Dec-12 1:02 

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.