Click here to Skip to main content
15,894,646 members
Articles / Desktop Programming / WPF

C.B.R.

Rate me:
Please Sign up or sign in to vote.
4.96/5 (52 votes)
22 Oct 2012GPL329 min read 125.4K   1.8K   132  
Comic and electronic publication reader with library management, extended file conversion, and devices support.
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:s="clr-namespace:CBR.Components.Designer">

    <Style TargetType="{x:Type Shape}"
           x:Key="ThumbCorner">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Stroke"
                Value="LightSlateGray" />
        <Setter Property="StrokeThickness"
                Value=".5" />
        <Setter Property="Width"
                Value="7" />
        <Setter Property="Height"
                Value="7" />
        <Setter Property="Margin"
                Value="-2" />
        <Setter Property="Fill">
            <Setter.Value>
                <RadialGradientBrush Center="0.3, 0.3"
                                     GradientOrigin="0.3, 0.3"
                                     RadiusX="0.7"
                                     RadiusY="0.7">
                    <GradientStop Color="White"
                                  Offset="0" />
                    <GradientStop Color="DarkSlateGray"
                                  Offset="0.9" />
                </RadialGradientBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type s:ResizeChrome}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type s:ResizeChrome}">
                    <Grid>
                        <Grid Opacity="0"
                              Margin="-3">
                            <s:ResizeThumb Height="3"
                                           Cursor="SizeNS"
                                           VerticalAlignment="Top"
                                           HorizontalAlignment="Stretch" />
                            <s:ResizeThumb Width="3"
                                           Cursor="SizeWE"
                                           VerticalAlignment="Stretch"
                                           HorizontalAlignment="Left" />
                            <s:ResizeThumb Width="3"
                                           Cursor="SizeWE"
                                           VerticalAlignment="Stretch"
                                           HorizontalAlignment="Right" />
                            <s:ResizeThumb Height="3"
                                           Cursor="SizeNS"
                                           VerticalAlignment="Bottom"
                                           HorizontalAlignment="Stretch" />
                            <s:ResizeThumb Width="7"
                                           Height="7"
                                           Margin="-2"
                                           Cursor="SizeNWSE"
                                           VerticalAlignment="Top"
                                           HorizontalAlignment="Left" />
                            <s:ResizeThumb Width="7"
                                           Height="7"
                                           Margin="-2"
                                           Cursor="SizeNESW"
                                           VerticalAlignment="Top"
                                           HorizontalAlignment="Right" />
                            <s:ResizeThumb Width="7"
                                           Height="7"
                                           Margin="-2"
                                           Cursor="SizeNESW"
                                           VerticalAlignment="Bottom"
                                           HorizontalAlignment="Left" />
                            <s:ResizeThumb Width="7"
                                           Height="7"
                                           Margin="-2"
                                           Cursor="SizeNWSE"
                                           VerticalAlignment="Bottom"
                                           HorizontalAlignment="Right" />
                        </Grid>
                        <Grid IsHitTestVisible="False"
                              Opacity="1"
                              Margin="-3">
                            <Rectangle SnapsToDevicePixels="True"
                                       StrokeThickness="1"
                                       Margin="1">
                                <Rectangle.Stroke>
                                    <LinearGradientBrush StartPoint="0, 0"
                                                         EndPoint="1, .3"
                                                         Opacity=".7">
                                        <GradientStop Color="SlateGray"
                                                      Offset="0" />
                                        <GradientStop Color="LightGray"
                                                      Offset=".5" />
                                        <GradientStop Color="SlateGray"
                                                      Offset="1" />
                                    </LinearGradientBrush>
                                </Rectangle.Stroke>
                            </Rectangle>
                            <Ellipse Style="{StaticResource ThumbCorner}"
                                     HorizontalAlignment="Left"
                                     VerticalAlignment="Top" />
                            <Ellipse Style="{StaticResource ThumbCorner}"
                                     HorizontalAlignment="Right"
                                     VerticalAlignment="Top" />
                            <Ellipse Style="{StaticResource ThumbCorner}"
                                     HorizontalAlignment="Left"
                                     VerticalAlignment="Bottom" />
                            <Ellipse Style="{StaticResource ThumbCorner}"
                                     HorizontalAlignment="Right"
                                     VerticalAlignment="Bottom" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Architect
France France
WPF and MVVM fan, I practice C # in all its forms from the beginning of the NET Framework without mentioning C ++ / MFC and other software packages such as databases, ASP, WCF, Web & Windows services, Application, and now Core and UWP.
In my wasted hours, I am guilty of having fathered C.B.R. and its cousins C.B.R. for WinRT and UWP on the Windows store.
But apart from that, I am a great handyman ... the house, a rocket stove to heat the jacuzzi and the last one: a wood oven for pizza, bread, and everything that goes inside

https://guillaumewaser.wordpress.com/
https://fouretcompagnie.wordpress.com/

Comments and Discussions