OK, renunciar a: ¿qué tengo que cambiar a esta StackPanel a continuación para que ponga el: Texto¿Por qué StackPanel no colocará textblock a la izquierda y botón a la derecha en Silverlight?
- el extremo izquierdo de la forma del botón
- el extremo derecho de forma.
alt text http://tanguay.info/web/external/stackPanelLeftRight.png
<UserControl x:Class="TestData333.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<Grid x:Name="LayoutRoot" Background="White">
<Border CornerRadius="10" Background="Yellow" Padding="20">
<StackPanel VerticalAlignment="Top" HorizontalAlignment="Left">
<ScrollViewer Background="Beige"
Height="230"
Width="360">
<StackPanel>
<TextBlock x:Name="TheContent"
Foreground="Navy"
FontSize="14"
TextWrapping="Wrap"/>
</StackPanel>
</ScrollViewer>
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="ProgressIndicator" Text="Ready..."
HorizontalAlignment="Left"/>
<Button Content="Load Data"
Width="100"
HorizontalAlignment="Right"
Click="Button_Load"
Margin="0 5 0 0"/>
</StackPanel>
</StackPanel>
</Border>
</Grid>
</UserControl>
RESPUESTA:
Descargado Silverlight 3 toolkit que tiene DockPanel, instalado, System.Windows.Controls referencia, a continuación, siguiendo XAML:
<UserControl x:Class="TestData333.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
Width="400" Height="300">
<Grid x:Name="LayoutRoot" Background="White">
<Border CornerRadius="10" Background="Yellow" Padding="20">
<StackPanel VerticalAlignment="Top" HorizontalAlignment="Left">
<ScrollViewer Background="Beige"
Height="230"
Width="360">
<StackPanel>
<TextBlock x:Name="TheContent"
Foreground="Navy"
FontSize="14"
TextWrapping="Wrap"/>
</StackPanel>
</ScrollViewer>
<toolkit:DockPanel Margin="0 5 0 0">
<TextBlock toolkit:DockPanel.Dock="Left" x:Name="ProgressIndicator" Text="Ready..."
FontSize="12"
HorizontalAlignment="Left"/>
<Button toolkit:DockPanel.Dock="Right" Content="Load Data"
Width="100"
HorizontalAlignment="Right"
Click="Button_Load"/>
</toolkit:DockPanel>
</StackPanel>
</Border>
</Grid>
</UserControl>
alt text http://tanguay.info/web/external/silverlightDockPanel.png
sí, esa es la manera que lo hago en WPF, pero estoy usando Silverlight en el momento, aunque Silverlight 3, siento ver que no hay un panel de conexión en esta versión, buscando alguna solución ... –
Estoy bastante seguro de que el kit de herramientas de control de Silverlight tiene un panel de puertos –
¿Silverlight no tiene un DockPanel? Tengo que prestar más atención a las etiquetas de las preguntas. Asumí automáticamente que era una pregunta de WPF, ¡pero no tenía idea de que no había un DockPanel en Silverlight! –