<Window x:Class="WpfTest.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:c="clr-namespace:WpfTest"
    Title="Window1" Height="480" Width="640">
    
    <Window.Resources>
        <c:SolarSystem x:Key="sol"/>
        <DataTemplate x:Key="PlanetTemplate">
        	<StackPanel Orientation="Horizontal">
        		<Image HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Stretch" Width="81" Height="79" Source="{Binding Image, Mode=Default}" Stretch="Fill"/>
        		<StackPanel Width="294.317" Height="78.668">
        			<TextBlock HorizontalAlignment="Left" Width="106.333" Height="26.667" Text="{Binding Name, Mode=Default}" TextWrapping="Wrap" FontSize="21.333" FontWeight="Bold"/>
        			<TextBlock HorizontalAlignment="Stretch" Margin="0,0,8,0" Width="Auto" Height="51" Text="{Binding Details, Mode=Default}" TextWrapping="Wrap"/>
        		</StackPanel>
        		
        	</StackPanel>
        </DataTemplate>
    </Window.Resources>
    <Grid>
        <StackPanel>
            <Button Width="200" Height="50"  VerticalAlignment="Top" 
                    Margin="50,25,50,50" RenderTransformOrigin="0.5, 0.5"
                    Content="{Binding ElementName=Slider, Path=Value}" ContentStringFormat="F" Click="Button_Click">
                <Button.RenderTransform>
                    <RotateTransform Angle="{Binding 
                        ElementName=Slider,
                        Path=Value}"></RotateTransform>

                </Button.RenderTransform>
            </Button>

            <Slider Name="Slider" Width="400" Minimum="1" Maximum="360"></Slider>
            <ListBox Width="400" Height="242" Margin="112,25,112,0" 
                     ItemsSource="{Binding Source={StaticResource sol}, Path=SolarSystemObjects}" IsSynchronizedWithCurrentItem="True" ItemTemplate="{DynamicResource PlanetTemplate}"/>
        </StackPanel>
    </Grid>
</Window>
