我試圖隱藏wp8.it的做工精細下拉列表中,但是顯示space.How我可以刪除這個空間,使向上和downwords基於顯示/隱藏列表隱藏下拉在WP8
按鈕組
是否有其他方法來隱藏textblock.because System.Windows.Visibility.Collapsed不工作文本塊。
<Grid HorizontalAlignment="Left" Height="661" Margin="0,130,0,0" VerticalAlignment="Top" Width="440">
<Grid>
<TextBox HorizontalAlignment="Left" Height="65" Margin="-3,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="433" GotFocus="WatermarkTB_GotFocus" Foreground="Gray"
LostFocus="WatermarkTB_LostFocus" x:Name="txtsearch" Text="Search" BorderBrush="LightGray"/>
<toolkit:ListPicker x:Name="lstLocations" Foreground="Black"
BorderThickness="0.2" SelectionMode="Single" SelectionChanged="Locations_SelectionChanged"
VerticalAlignment="Bottom" Margin="10,0,23,500" BorderBrush="Black" Height="88" >
<toolkit:ListPicker.ItemTemplate>
<DataTemplate>
<StackPanel >
<TextBlock Text="{Binding name}" Foreground="Black" FontSize="18"/>
</StackPanel>
</DataTemplate>
</toolkit:ListPicker.ItemTemplate>
<toolkit:ListPicker.FullModeItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding name}"
FontSize="28"
Foreground="White"
/>
</StackPanel>
</DataTemplate>
</toolkit:ListPicker.FullModeItemTemplate>
</toolkit:ListPicker>
<toolkit:ListPicker x:Name="lstSubLocations" Foreground="Black"
BorderThickness="0.2" SelectionMode="Single" SelectionChanged="lstSubLocations2_SelectionChanged"
VerticalAlignment="Bottom" Margin="10,0,23,460" ExpansionMode="FullScreenOnly" Visibility="Collapsed" BorderBrush="Black" Height="64" >
<toolkit:ListPicker.ItemTemplate>
<DataTemplate>
<StackPanel >
<TextBlock Text="{Binding name}" Foreground="Black" FontSize="18"/>
</StackPanel>
</DataTemplate>
</toolkit:ListPicker.ItemTemplate>
<toolkit:ListPicker.FullModeItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding name}"
FontSize="28"
Foreground="White"
/>
</StackPanel>
</DataTemplate>
</toolkit:ListPicker.FullModeItemTemplate>
</toolkit:ListPicker>
<toolkit:ListPicker x:Name="lstSubLocations2" Foreground="Black"
BorderThickness="0.2" SelectionMode="Single"
VerticalAlignment="Bottom" Margin="10,0,23,390" ExpansionMode="FullScreenOnly" BorderBrush="Black" Height="64" Visibility="Collapsed" >
<toolkit:ListPicker.ItemTemplate>
<DataTemplate>
<StackPanel >
<TextBlock Text="{Binding name}" Foreground="Black" FontSize="18" />
</StackPanel>
</DataTemplate>
</toolkit:ListPicker.ItemTemplate>
<toolkit:ListPicker.FullModeItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding name}"
FontSize="28"
Foreground="White"
/>
</StackPanel>
</DataTemplate>
</toolkit:ListPicker.FullModeItemTemplate>
</toolkit:ListPicker>
</Grid>
<Grid Margin="0 170 0 0">
<Button Content="Search Jobs" x:Name="Serachjob" FontSize="20" Foreground="White" HorizontalAlignment="Left" Margin="0,172,0,0" VerticalAlignment="Top" Width="204" Grid.ColumnSpan="2" BorderThickness="0" Click="Serachjob_Click">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/Image/jobseeker.png"/>
</Button.Background>
</Button>
<Button Content="Advanced Search" x:Name="Advanced_Search" Foreground="White" FontSize="20" HorizontalAlignment="Left" Margin="202,172,0,0" VerticalAlignment="Top" Width="215" BorderThickness="0" Click="Advanced_Search_Click">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/Image/loginEmp.png"/>
</Button.Background>
</Button>
<Button Content="Post Resumes" x:Name="Post_Resume" FontSize="20" Foreground="White" HorizontalAlignment="Left" Margin="0,222,0,0" VerticalAlignment="Top" Width="204" Grid.ColumnSpan="2" BorderThickness="0" Click="Post_Resume_Click">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/Image/jobseeker.png"/>
</Button.Background>
</Button>
<Button Content="Browse Jobs" x:Name="Browse_Jobs" Foreground="White" FontSize="20" HorizontalAlignment="Left" Margin="202,222,0,0" VerticalAlignment="Top" Width="215" BorderThickness="0" Click="Browse_Jobs_Click">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="/Image/loginEmp.png"/>
</Button.Background>
</Button>
</Grid>
</Grid>
發佈您的XAML代碼或更加描述您的問題。如果你在'StackPanel'中有你的控件,那麼使用Collapsed會導致所有東西都被推上去。基本上,如果控制不存在於Visual Tree中。 – 2015-03-31 00:05:10
@ChubosaurusSoftware thnks for reply.I已更新問題與我的XAML文件 – hii 2015-03-31 06:54:18