This is related to my presentation tonight (July 25, 2011) at the Denver Visual Studio User’s Group on Effective Silverlight 5 Development.

Links

 

RitchTextBox OverflowContentTarget Example

<StackPanel Width="400"
            VerticalAlignment="Top"
            Orientation="Horizontal">

    <RichTextBox x:Name="rtbPrimary"
                 Width="80"
                 Height="100"
                 Margin="5,10,0,0"
                 HorizontalScrollBarVisibility="Disabled"
                 VerticalScrollBarVisibility="Disabled"
                 OverflowContentTarget="{Binding ElementName=rtbOverflow}">
        <Paragraph>
            The Denver Visual Studio User's group is overflowing at 100 people! Come early to get a seat.
        </Paragraph>
    </RichTextBox>

    <RichTextBoxOverflow Width="200"
                         Height="100"
                         Margin="5,10,0,0"
                         HorizontalScrollBarVisibility="Disabled"
                         VerticalScrollBarVisibility="Disabled"
                         x:Name="rtbOverflow" />

</StackPanel>

HTML 5 Canvas

<!DOCTYPE html>
<title>Canvas Shapes and Sizes</title>
    <script type="text/javascript">
        window.onload = function () {
            var canvas = document.getElementById('cvPrimary');
            var ctx = canvas.getContext("2d");

            //Draw a rectangle
            ctx.fillStyle = 'Red';
            ctx.fillRect(10, 20, 50, 50);

            //Draw a circle
            ctx.arc(50, 150, 50, 0, 2 * Math.PI, false);
            ctx.fillStyle = 'Green';
            ctx.fill();

            //Draw an arc
            ctx.beginPath();
            ctx.arc(80, 280, 50, 0, Math.PI, false);
            ctx.fillStyle = 'Navy';
            ctx.fill();

            //Draw lines
            ctx.beginPath();
            ctx.moveTo(50, 350);
            ctx.lineTo(0, 450);
            ctx.lineTo(100, 450);
            ctx.lineTo(50, 350);
            ctx.strokeStyle = 'Orange';
            ctx.lineWidth = 4;
            ctx.stroke();
            ctx.fillStyle = 'Yellow';
            ctx.fill();
        };
</script>

<canvas id="cvPrimary" width="800" height="600"/>

Siverlight Extension

<navigation:Page xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           x:Class="EffectiveSilverlight.Views.ExtensionOverview"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:dvsug="clr-namespace:EffectiveSilverlight.Views"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="ExtensionOverview Page">
    <StackPanel>
        <sdk:Label Margin="10,10,0,0"
                   FontSize="14"
                   FontFamily="Georgia"
                   FontWeight="Bold"
                   Content="{dvsug:DenverVSUG}"
                    />
    </StackPanel>
</navigation:Page>

 

using System.Xaml;

namespace EffectiveSilverlight.Views
{
    public class DenverVSUGExtension : IMarkupExtension<string>
    {

        public string ProvideValue(IServiceProvider serviceProvider)
        {

            return "88 people saw William Wegerson discuss Effective Silverlight";

        }

    }
}
Share