我正在嘗試在WP7中創建一個「調色板」。在視覺上,我看起來類似於鍵盤(SIP)或撥號器。 我試圖讓按鈕周圍的邊距比現在小。如何減少WP7中WrapPanel內的按鈕邊距?
但是我這樣做很麻煩 - 但我試過直接設置不同的頁邊距厚度,並附上一個樣式,但似乎無法排序。
這裏是什麼,我在此刻得到的圖像(對不起,我是一個新用戶,以便它只是一個鏈接):
http://i40.tinypic.com/bj8g9f.jpg
而且這裏是我使用的有關XAML。
<phone:PhoneApplicationPage
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tk="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
x:Class="Mathflow.MainPage"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<phone:PhoneApplicationPage.Resources>
<Style x:Key="PaletteObjectStyle" TargetType="Button">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="#1F1F1F"/>
</Setter.Value>
</Setter>
<Setter Property="Margin" Value="0" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style x:Key="PaletteObjectText" TargetType="TextBlock">
<Setter Property="Margin" Value="8" />
</Style>
</phone:PhoneApplicationPage.Resources>
<StackPanel x:Name="LayoutRoot" DataContext="">
<Canvas x:Name="FlowContainer" Height="500">
</Canvas>
<ItemsControl x:Name="Palette" DataContext="{Binding Source={StaticResource FunctionsSource}}" ItemsSource="{Binding FunctionCollection}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<tk:WrapPanel Orientation="Vertical" Height="200" ScrollViewer.VerticalScrollBarVisibility="Disabled" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Style="{Binding Source={StaticResource PaletteObjectStyle}}">
<TextBlock Text="{Binding Display}" Style="{Binding Source={StaticResource PaletteObjectText}}"/>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</phone:PhoneApplicationPage>
非常感謝!任何幫助將不勝感激。
這裏沒有問題。另外,您當前的用戶界面出了什麼問題? –
我假設他的意思是讓矩形周圍的邊緣變小。 –
謝謝! xyzzer是正確的,只是試圖使邊距更小。據此編輯。 –