I'm having trouble setting the border color in a Toolkit Datepicker as it appears on a page. I'm not talking about the DatePickerPage. I can set the background and foreground colors, but the border doesn't take hold.
<toolkit:DatePicker x:Name="dpDeliverBy" Header="Deliver By" Grid.Row="6"
HeaderTemplate="{StaticResource MyHeaderTemplate}" Margin="-12, 0, 0, -10" Value=""
BorderBrush="Black" Background="White" BorderThickness="2" Foreground="Black" />
The border doesn't seem to take hold and I don't know what other property to use.
It's an interesting thing that you cannot edit the
DatePickertemplate. I found out by looking at the source code that for some reason it occurs because the template is defined in the main control theme -Generic.xamland it has noBorderBrushproperty defined per se.Download the package - you will need it to build a custom control on top of the existing skeleton.
You should open that theme file and if yo look at the template for
DatePicker, you can edit the values forBorderBrushandBorderThickness. One thing to remember - once you re-compile the source, you need to make sure that you are using the correct library (when referencing in the main project). By default, when you add a Microsoft.Phone.Controls.Toolkit unit, it will reference the library registered in GAC (assuming that you installed the toolkit) and take the one that is located in the SDK folder - you don't want that. Either change the library name or change the local copy.If you need a tutorial for this, I just wrote one.
Here is the modified style (modified in the source code for easier reuse):