<UserControl
    x:Class="MECF.Framework.UI.Client.IndustrialControl.PipeLine"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:converters="clr-namespace:MECF.Framework.UI.Client.IndustrialControl.Converters"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="clr-namespace:MECF.Framework.UI.Client.IndustrialControl"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Width="489"
    Height="95"
    mc:Ignorable="d">
    <UserControl.Resources>
        <converters:MultiplesValueConverter x:Key="multiConverter" />
        <converters:VisibilityConverter x:Key="visibilityConverter" />
    </UserControl.Resources>
    <Grid>
        <Grid x:Name="grid1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="auto" />
            </Grid.ColumnDefinitions>
            <Canvas
                x:Name="canvas1"
                Grid.Column="0"
                Width="{Binding ElementName=grid1, Path=ActualHeight}"
                Height="{Binding ElementName=grid1, Path=ActualHeight}"
                ClipToBounds="True">
                <Ellipse
                    x:Name="ellipe1"
                    Grid.Column="0"
                    Canvas.Left="{Binding ElementName=grid1, Path=ActualHeight, Converter={StaticResource multiConverter}, ConverterParameter=0}"
                    Canvas.Top="{Binding ElementName=grid1, Path=ActualHeight, Converter={StaticResource multiConverter}, ConverterParameter=0}"
                    Width="{Binding ElementName=grid1, Path=ActualHeight, Converter={StaticResource multiConverter}, ConverterParameter=2}"
                    Height="{Binding ElementName=grid1, Path=ActualHeight, Converter={StaticResource multiConverter}, ConverterParameter=2}"
                    Margin="0,0,0,0">
                    <Ellipse.Fill>
                        <RadialGradientBrush GradientOrigin="0.5,0.5" RadiusX="0.5" RadiusY="0.5">
                            <GradientStop Offset="0" Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:PipeLine}}, Path=EdgeColor}" />
                            <GradientStop Offset="0.5" Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:PipeLine}}, Path=CenterColor}" />
                            <GradientStop Offset="1" Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:PipeLine}}, Path=EdgeColor}" />
                        </RadialGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>
            </Canvas>
            <Canvas
                x:Name="canvas2"
                Grid.Column="2"
                Width="{Binding ElementName=grid1, Path=ActualHeight}"
                Height="{Binding ElementName=grid1, Path=ActualHeight}"
                ClipToBounds="True">
                <Ellipse
                    x:Name="ellipe2"
                    Canvas.Left="{Binding ElementName=grid1, Path=ActualHeight, Converter={StaticResource multiConverter}, ConverterParameter=-1}"
                    Canvas.Top="{Binding ElementName=grid1, Path=ActualHeight, Converter={StaticResource multiConverter}, ConverterParameter=-1}"
                    Width="{Binding ElementName=grid1, Path=ActualHeight, Converter={StaticResource multiConverter}, ConverterParameter=2}"
                    Height="{Binding ElementName=grid1, Path=ActualHeight, Converter={StaticResource multiConverter}, ConverterParameter=2}">
                    <Ellipse.Fill>
                        <RadialGradientBrush GradientOrigin="0.5,0.5" RadiusX="0.5" RadiusY="0.5">
                            <GradientStop Offset="0" Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:PipeLine}}, Path=EdgeColor}" />
                            <GradientStop Offset="0.5" Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:PipeLine}}, Path=CenterColor}" />
                            <GradientStop Offset="1" Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:PipeLine}}, Path=EdgeColor}" />
                        </RadialGradientBrush>
                    </Ellipse.Fill>
                </Ellipse>
            </Canvas>
            <Rectangle Grid.Column="1" Stretch="Fill">
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Offset="0" Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:PipeLine}}, Path=EdgeColor}" />
                        <GradientStop Offset="0.5" Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:PipeLine}}, Path=CenterColor}" />
                        <GradientStop Offset="1" Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:PipeLine}}, Path=EdgeColor}" />
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
        </Grid>
        <Path
            x:Name="path1"
            StrokeDashArray="5,5"
            StrokeDashOffset="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:PipeLine}}, Path=LineOffect}"
            StrokeThickness="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:PipeLine}}, Path=PipeLineWidth}"
            Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:PipeLine}}, Path=PipeLineActive, Converter={StaticResource visibilityConverter}}">
            <Path.Stroke>
                <SolidColorBrush Color="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:PipeLine}}, Path=ActiveLineCenterColor}" />
            </Path.Stroke>
        </Path>
    </Grid>
</UserControl>
