Subversion Repositories Projects

Rev

Blame | Last modification | View Log | RSS feed

<UserControl x:Class="MKLiveView.ArtificialHorizon.ArtificialHorizon"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:MKLiveView.ArtificialHorizon"
             mc:Ignorable="d" Height="240" Width="240"
             DataContext="{Binding RelativeSource={RelativeSource Self}}">
    <Grid>
        <Image Margin="0,0,0,0">
            <Image.Source>
                <DrawingImage>
                    <DrawingImage.Drawing>
                        <DrawingGroup>
                            <DrawingGroup>
                                <DrawingGroup>
                                    <DrawingGroup.Transform>
                                        <TransformGroup>
                                            <RotateTransform x:Name="RollAngle" Angle="{Binding Roll, UpdateSourceTrigger=PropertyChanged}" CenterX="120" CenterY="120" />
                                            <TranslateTransform x:Name="PitchAngle" Y="{Binding Pitch, UpdateSourceTrigger=PropertyChanged}" />
                                        </TransformGroup>
                                    </DrawingGroup.Transform>

                                    <ImageDrawing ImageSource="horizon.png" Rect="0,0,240,240" />
                                </DrawingGroup>

                                <DrawingGroup.ClipGeometry>
                                    <EllipseGeometry Center="120,120" RadiusX="60" RadiusY="60">
                                    </EllipseGeometry>
                                </DrawingGroup.ClipGeometry>
                            </DrawingGroup>

                            <DrawingGroup>
                                <ImageDrawing ImageSource="Scale.png" Rect="0,0,240,240" />
                                <ImageDrawing ImageSource="Wings.png" Rect="0,0,240,240" />
                            </DrawingGroup>
                            <DrawingGroup>
                                <DrawingGroup>
                                    <ImageDrawing ImageSource="Home.png" Rect="0,0,240,240" />

                                    <DrawingGroup.Transform>
                                        <TransformGroup>
                                            <RotateTransform x:Name="RotateHome" Angle="0" CenterX="120" CenterY="120" />
                                        </TransformGroup>
                                    </DrawingGroup.Transform>
                                </DrawingGroup>
                                <DrawingGroup>
                                    <ImageDrawing ImageSource="Heading1.png" Rect="0,0,240,240" />

                                    <DrawingGroup.Transform>
                                        <TransformGroup>
                                            <RotateTransform x:Name="Rotate" Angle="0" CenterX="120" CenterY="120" />
                                        </TransformGroup>
                                    </DrawingGroup.Transform>
                                </DrawingGroup>

                            </DrawingGroup>
                            <DrawingGroup.ClipGeometry>
                                <EllipseGeometry Center="120,120" RadiusX="120" RadiusY="120">
                                </EllipseGeometry>
                            </DrawingGroup.ClipGeometry>
                       </DrawingGroup>
                    </DrawingImage.Drawing>
                </DrawingImage>
            </Image.Source>
        </Image>
    </Grid>
</UserControl>