1
votes

I need to create my own Soft Input Panel as none of the input scopes meet my requirements. I can use PhoneChromeBrush as a resource for the background of the panel, but I am not able to find any resource for the color of the keys. I am talking of the keys of either the soft keyboard, soft dial pad etc. In the light theme they are plain white, but in the dark theme not.

Is there a resource I can use? Or is it just a semitransparent white overlaying? What would be the percentage of the transparency? And would it be overlaying PhoneBackgroundBrush or PhoneChromeBrush? Or does anyone know the HEX code of that color? #3A3A3A seems quite close, but still wrong.

Thanks for any ideas.

2
"Or does anyone know the HEX code of that color?" => If you want the hex color code of the keyboard, you can take a screenshot from the emulator, then get the color from a photo editing software.Kevin Gosse
Thanks KooKiz, that did the trick. Well, not quite for the resource, but for the HEX code. I did search the inet for screenshots and got their colors from paint, but never made my own screenshots. I am not sure, why these where off a bit. As I find my question answered, I did add an answer as well. But thanks for getting me on the right track.Thomas Lindner

2 Answers

2
votes

Well, thanks to KooKiz, who got me on the right track, I would like to answer my own question.

This might be considered a work-a-round, but it satisfied me.

  1. It seems there is no resource for this color.

  2. Even the colors of the keys seem to have the same color in different SIPs, they are actually not. Keyboard, dial pad and even date-/timepicker use different colors.

  3. As my soft input panel should match with the dial pad the HEX code of the color would be #FF383838 in dark theme and #FFFFFFFF in light theme.

  4. I am using PhoneBackgroundBrush covered by a semitransparent white (#38FFFFFF) to get my color. In this way in dark theme I will cover #FF000000 with #38FFFFFF resulting in a #FF383838; in the light theme it will cover #FFFFFFFF with #38FFFFFF and the result will be #FFFFFFFF. So this will give me the proper color for my keys, no matter what theme the user is using.

Here an example:

<Grid Background="{StaticResource PhoneBackgroundBrush}" Margin="3" >
    <Grid Background="#38FFFFFF" Margin="0" >
        <TextBlock Text="1" Style="{StaticResource PhoneTextNormalStyle}" />
    </Grid>
</Grid>
1
votes

Have a look at the "ThemeResources.xaml" file in C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.1\Design This will show you the HEX codes for each of the default brushes.

Be sure to check out the versions in eahc of the subfolders too so you can see the difference between the light and dark themes.

For reference, the PhoneChromeBrush in the dark theme is #FF1F1F1F