Tech Off Thread

1 post

A WPF XAML glass bead inspired by the mac title bar widgets ( Can be used in a button or other controls)

Back to Forum: Tech Off
  • User profile image
    Mauricio Feijo

    Generic Forum Image

     

    I use this in a semaphore type of application, changing the color of the first ellipse with triggers.

     

                    <Viewbox >
                            <Grid Height="50" Width="50" Margin="5" ToolTip="SOF" >  
                            <Grid Margin="0">
                                <Ellipse Fill="Red">
                                <Ellipse.Stroke>
                                        <LinearGradientBrush StartPoint="0.5,0"
                                                             EndPoint="0.5,1"
                                                             ColorInterpolationMode="ScRgbLinearInterpolation">
                                            <GradientStop Color="Black"
                                                          Offset="0" />
                                            <GradientStop Color="Silver"
                                                          Offset="1" />
                                        </LinearGradientBrush>
                                    </Ellipse.Stroke>
                                </Ellipse>
                                <Ellipse Margin="1">
                                    <Ellipse.Stroke>
                                        <RadialGradientBrush Opacity="0.8"
                                                             ColorInterpolationMode="ScRgbLinearInterpolation">
                                            <GradientStop Offset="0.85"
                                                          Color="Transparent" />
                                            <GradientStop Offset="1"
                                                          Color="Black" />
                                        </RadialGradientBrush>
                                    </Ellipse.Stroke>
                                    <Ellipse.Fill>
                                        <RadialGradientBrush  Opacity="0.6"
                                                              GradientOrigin="0.5,1.2"
                                                              ColorInterpolationMode="ScRgbLinearInterpolation">
                                            <GradientStop Offset="1"
                                                          Color="#00000000" />
                                            <GradientStop Offset="0.4"
                                                          Color="White" />
                                        </RadialGradientBrush>
                                    </Ellipse.Fill>
                                </Ellipse>
                                <Ellipse Margin="1.5"
                                         RenderTransformOrigin="0.5,0">
                                    <Ellipse.RenderTransform>
                                        <ScaleTransform ScaleY="0.4"
                                                        ScaleX="0.7" />
                                    </Ellipse.RenderTransform>
                                    <Ellipse.Fill>
                                        <LinearGradientBrush Opacity="0.85"
                                                             StartPoint="0.5,0"
                                                             EndPoint="0.5,1"
                                                             ColorInterpolationMode="ScRgbLinearInterpolation">
                                            <GradientStop Color="White"
                                                          Offset="0.3" />
                                            <GradientStop Color="Transparent"
                                                          Offset="1" />
                                        </LinearGradientBrush>
                                    </Ellipse.Fill>
                                </Ellipse>
                            </Grid>
                            <TextBlock TextWrapping="NoWrap"
                                       Opacity=".75"
                                       FontWeight="Bold"
                                       TextAlignment="Center"
                                       HorizontalAlignment="Center"
                                       VerticalAlignment="Center"
                                       Text="SOF"
                                       TextBlock.FontSize="15"
                                       Margin="2,0,0,0" />
                            </Grid>
                    </Viewbox>

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.