As I see, WP7 buttons are surrounded by a black space of some pixels. How I can remove it?
I've read this post, but I didn't managed to remove it! Could you please give a working example?
I've tried to wrap button with <Border... />
element, but it didn't work.
this is my XAML
<ItemsControl Name="icCells" Grid.Row="1">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Background="Red" BorderThickness="0" Width="40" Height="40" BorderBrush="Green" Padding="0" Margin="0" />
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
Thanks
You could do that easily in Blend.
Open the project in blend. Right click button and from the menu select Edit Template-> Edit a copy -> Name the style.
On the right side, in the object and timeline window, You can see a grid inside which you have a button background and a contentcontainer. Resize the container to the size of the button, now you wud see no white space. Now this same style can be applied to other buttons too.
You can find some theory here: http://msdn.microsoft.com/en-us/library/ms745683.aspx
Try the following:
Style
XAML
If you want to change the Margin (I made it 0) search for the following in the Style:
If you want to change the Padding (I made it 0) search for the following in the Style:
I do recommend change it a little smaller...I personally think its a little large to much padding