Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 278493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T01:14:51+00:00 2026-05-12T01:14:51+00:00

I downloaded a WPFToolkit source, because I wanted to override the default generic template

  • 0

I downloaded a WPFToolkit source, because I wanted to override the default generic template of a DatePicker. For example, I wanted to override this TextBox:

<primitives:DatePickerTextBox x:Name="PART_TextBox" 
            Grid.Row="0" Grid.Column="0" 
            Foreground="{TemplateBinding Foreground}"                  
            HorizontalContentAlignment="Stretch"
            VerticalContentAlignment="Stretch" />

That means that writing this in my project :

<Style TargetType="{x:Type toolkit:DatePickerTextBox}">
                <Setter Property="Text" Value="Bitte wählen" />
                <Setter Property="MinHeight" Value="20" />

works perfectly.
But what if I want to change VerticalContentAlignment="Stretch" to VerticalContentAlignment="Center" ?? The default style always overrides it.
Thanks for response!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T01:14:52+00:00Added an answer on May 12, 2026 at 1:14 am

    Ok I downloaded a Source of those controls, took this Style directly from Microsoft and applied it on my DatePicker. It worked!

    Look especially at this:

    This is where i style my inner TextBox.

    <!-- DatePicker -->
        <Style x:Key="DatePickerStyle"  TargetType="{x:Type toolkit:DatePicker}">
            <Setter Property="Foreground" Value="#FF333333" />
            <Setter Property="IsTodayHighlighted" Value="True" />
            <Setter Property="SelectedDateFormat" Value="Short" />
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="Padding" Value="3,2,0,2"/>
            <!--<Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint=".5,0" StartPoint=".5,1">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>-->
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type toolkit:DatePicker}">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}" 
                                Padding="{TemplateBinding Padding}">
                            <Border.Child>
                                <Grid x:Name="PART_Root"
                                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                    <Grid.Resources>
                                        <!-- Main DatePicker Brushes -->
                                        <SolidColorBrush x:Key="DisabledBrush" Color="#A5FFFFFF" />
    
                                        <!-- Button Template -->
                                        <ControlTemplate x:Key="DropDownButtonTemplate" TargetType="Button">
                                            <Grid>
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0" />
                                                            <vsm:VisualTransition To="MouseOver" GeneratedDuration="0:0:0.1" />
                                                            <vsm:VisualTransition To="Pressed" GeneratedDuration="0:0:0.1" />
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal" />
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="#FF448DCA"/>
                                                                <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                                    <SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                                <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                                    <SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                                <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                                    <SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
                                                                    <SplineColorKeyFrame KeyTime="0" Value="#FF448DCA"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                                <DoubleAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                    <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                                                </DoubleAnimationUsingKeyFrames>
                                                                <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                                    <SplineColorKeyFrame KeyTime="0" Value="#EAFFFFFF"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                                <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                                    <SplineColorKeyFrame KeyTime="0" Value="#C6FFFFFF"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                                <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                                    <SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                                <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                                    <SplineColorKeyFrame KeyTime="0" Value="#F4FFFFFF"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Disabled" />
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
    
                                                <!--Start UI-->
                                                <Grid Height="20" Width="20" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0" Background="#11FFFFFF" FlowDirection="LeftToRight">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="20*"/>
                                                        <ColumnDefinition Width="20*"/>
                                                        <ColumnDefinition Width="20*"/>
                                                        <ColumnDefinition Width="20*"/>
                                                    </Grid.ColumnDefinitions>
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="23*"/>
                                                        <RowDefinition Height="19*"/>
                                                        <RowDefinition Height="19*"/>
                                                        <RowDefinition Height="19*"/>
                                                    </Grid.RowDefinitions>
                                                    <Border Margin="-1" Grid.ColumnSpan="4" Grid.Row="0" Grid.RowSpan="4" BorderThickness="1" BorderBrush="#FF45D6FA" Opacity="0" CornerRadius="0,0,1,1" x:Name="Highlight"/>
                                                    <Border x:Name="Background" Margin="0,-1,0,0" Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="3" BorderThickness="1" BorderBrush="#FFFFFFFF" Opacity="1" CornerRadius=".5" Background="#FF1F3B53"/>
                                                    <Border x:Name="BackgroundGradient" Margin="0,-1,0,0" Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="3" BorderThickness="1" BorderBrush="#BF000000" Opacity="1" CornerRadius=".5">
                                                        <Border.Background>
                                                            <LinearGradientBrush StartPoint=".7,0" EndPoint=".7,1">
                                                                <GradientStop Color="#FFFFFFFF" Offset="0" />
                                                                <GradientStop Color="#F9FFFFFF" Offset="0.375" />
                                                                <GradientStop Color="#E5FFFFFF" Offset="0.625" />
                                                                <GradientStop Color="#C6FFFFFF" Offset="1" />
                                                            </LinearGradientBrush>
                                                        </Border.Background>
                                                    </Border>
                                                    <Rectangle Grid.ColumnSpan="4" Grid.RowSpan="1" StrokeThickness="1">
                                                        <Rectangle.Stroke>
                                                            <LinearGradientBrush EndPoint="0.48,-1" StartPoint="0.48,1.25">
                                                                <GradientStop Color="#FF494949"/>
                                                                <GradientStop Color="#FF9F9F9F" Offset="1"/>
                                                            </LinearGradientBrush>
                                                        </Rectangle.Stroke>
                                                        <Rectangle.Fill>
                                                            <LinearGradientBrush EndPoint="0.3,-1.1" StartPoint="0.46,1.6">
                                                                <GradientStop Color="#FF4084BD"/>
                                                                <GradientStop Color="#FFAFCFEA" Offset="1"/>
                                                            </LinearGradientBrush>
                                                        </Rectangle.Fill>
                                                    </Rectangle>
                                                    <Path HorizontalAlignment="Center" Margin="4,3,4,3" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" Grid.Column="0" Grid.Row="1" Fill="#FF2F2F2F" Stretch="Fill" Data="M11.426758,8.4305077 L11.749023,8.4305077 L11.749023,16.331387 L10.674805,16.331387 L10.674805,10.299648 L9.0742188,11.298672 L9.0742188,10.294277 C9.4788408,10.090176 9.9094238,9.8090878 10.365967,9.4510155 C10.82251,9.0929432 11.176106,8.7527733 11.426758,8.4305077 z M14.65086,8.4305077 L18.566387,8.4305077 L18.566387,9.3435936 L15.671368,9.3435936 L15.671368,11.255703 C15.936341,11.058764 16.27293,10.960293 16.681133,10.960293 C17.411602,10.960293 17.969301,11.178717 18.354229,11.615566 C18.739157,12.052416 18.931622,12.673672 18.931622,13.479336 C18.931622,15.452317 18.052553,16.438808 16.294415,16.438808 C15.560365,16.438808 14.951641,16.234707 14.468243,15.826504 L14.881817,14.929531 C15.368796,15.326992 15.837872,15.525723 16.289043,15.525723 C17.298809,15.525723 17.803692,14.895514 17.803692,13.635098 C17.803692,12.460618 17.305971,11.873379 16.310528,11.873379 C15.83071,11.873379 15.399232,12.079271 15.016094,12.491055 L14.65086,12.238613 z" Grid.ColumnSpan="4" Grid.RowSpan="3"/>
                                                    <Ellipse HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#FFFFFFFF" StrokeThickness="0" Grid.ColumnSpan="4" Width="3" Height="3"/>
                                                    <Border Grid.ColumnSpan="4" Grid.Row="0" Grid.RowSpan="4" BorderThickness="1" BorderBrush="#B2FFFFFF" Opacity="0" CornerRadius="0,0,.5,.5" x:Name="DisabledVisual"/>
                                                </Grid>
                                                <!--End UI-->
                                            </Grid>
                                        </ControlTemplate>
                                    </Grid.Resources>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Button x:Name="PART_Button" Grid.Row="0" Grid.Column="1"
                                            Template="{StaticResource DropDownButtonTemplate}"
                                            Foreground="{TemplateBinding Foreground}" 
                                            Width="20"
                                            Margin="3,0,3,0" 
                                            Focusable="False" 
                                            VerticalAlignment="Top"
                                            HorizontalAlignment="Left" />
                                    <primitives:DatePickerTextBox x:Name="PART_TextBox"                                                                       
                                                Grid.Row="0" Grid.Column="0" 
                                                Foreground="{TemplateBinding Foreground}"
                                                BorderThickness="1" BorderBrush="{StaticResource ButtonFont_DarkGray}" 
                                                Text="Bitte wählen" MinHeight="20"
                                                HorizontalContentAlignment="Stretch"
                                                VerticalContentAlignment="Center" >
                                    </primitives:DatePickerTextBox>
                                    <Grid x:Name="PART_DisabledVisual" 
                                          Opacity="0" 
                                          IsHitTestVisible="False" 
                                          Grid.Row="0" Grid.Column="0"
                                          Grid.ColumnSpan="2">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <Rectangle Grid.Row="0" Grid.Column="0" RadiusX="1" RadiusY="1" Fill="#A5FFFFFF"/>
                                        <Rectangle Grid.Row="0" Grid.Column="1" RadiusX="1" RadiusY="1" Fill="#A5FFFFFF" Height="18" Width="19" Margin="3,0,3,0" />
                                        <Popup x:Name="PART_Popup" 
                                               PlacementTarget="{Binding ElementName=PART_Button}"
                                               Placement="Bottom" 
                                               StaysOpen="False"
                                               AllowsTransparency="True" />
                                    </Grid>
                                </Grid>
                            </Border.Child>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 135k
  • Answers 135k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Without really knowing more, it sounds more like you want… May 12, 2026 at 7:01 am
  • Editorial Team
    Editorial Team added an answer Global $some_external_var; function myfunction() { Global $some_external_var; if (!empty($some_external_var)) do… May 12, 2026 at 7:01 am
  • Editorial Team
    Editorial Team added an answer No. But as long as you are generating your own… May 12, 2026 at 7:01 am

Related Questions

I'm using the latest WPF toolkit , specifically the DatePicker . Everything works fine,
I have downloaded WPFToolkit, and I am using the DataGrid provided in this package.
I downloaded a package installer for Python 2.6.1, but when I use the python
I downloaded a plugin for an Office product that prompts you for your SharePoint

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.