0

I want to fill the remaining portion of the texbox with hatch patterns (diagonal line) using XAML for silverlight. I know the Silverlight is out of date and not in support. But i have a code which i need to fix. I am not sure how to implement the hatch patterns without VisualBrush as we do for WPF.

I tried with Linearbrush, but unable to implement it

<LinearGradientBrush x:Key="DiagonalLine" EndPoint="0,0" StartPoint="8,8" 
                     MappingMode="Absolute" SpreadMethod="Repeat">
    <GradientStop Color="Black" Offset="0" />
    <GradientStop Color="Black" Offset="0.1" />
    <GradientStop Color="White" Offset="0.1" />
    <GradientStop Color="White" Offset="1" />
</LinearGradientBrush>

1 Answer 1

0

I tried the below code and it works

 <Rectangle Grid.Column="1" Margin="10,0,0,0" Stroke="{Binding Appointment.BorderAppointmentBackground}"
                           StrokeThickness="2">
                    <Rectangle.Fill>
                        <LinearGradientBrush MappingMode="Absolute" SpreadMethod="Repeat"
                                             StartPoint="0,0" EndPoint="5.0, 5.0">
                            <GradientStop Color="{Binding Appointment.BorderAppointmentBackground}"/>
                            <GradientStop Color="{Binding Appointment.BorderAppointmentBackground}" Offset="0.1"/>
                            <GradientStop Color="#FFFFFFFF" Offset="0.3"/>
                            <GradientStop Color="#FFFFFFFF" Offset="0.3"/>
                        </LinearGradientBrush>
                    </Rectangle.Fill>
                </Rectangle>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.