Silverlight team's blog Silverlight team's blog http://blogs.telerik.com/SilverlightTeam/Posts.aspx http://backend.userland.com/rss Telerik Commanding mechanism for Silverlight Overview <p>Q2 and Q3 releases brought up support for commands usable in a similar way as the commanding mechanism from WPF.</p> <p>In a few points the Commanding mechanism provides several classes:</p> <ul> <li>RoutedCommand and RoutedUICommand – ICommand implementations, the second has a Text property </li> <li>ICommandSource – once an object implement it, it knows how to invoke a command, i.e. it receives <strong>Command</strong>, <strong>CommandParameter</strong> and <strong>CommandTarget</strong> properties. </li> <li>CommandBinding – maps the command logic to the command </li> <li>CommandManager – provides methods that register <strong>CommandBinding</strong> and <strong>InputBinding</strong> objects, add and remove command event handlers, and provides services for querying the status of a command. </li> </ul> <p>Creating a command</p> <p>Basically, we can implement the <strong>ICommand</strong> interface in order to create our command class. However, we can also use the provided <strong>RoutedUICommand</strong>(or RoutedCommand) just as we do in WPF:</p> <blockquote> <div class="code"><span style="color: #0000ff;">public</span><span style="color: #808080;"> </span><span style="color: #0000ff;">static</span><span style="color: #808080;"> </span><span style="color: #0000ff;">class</span><span style="color: #808080;"> </span><span style="color: #000000;">DateTimeCommands</span><span style="color: #808080;"> <br /> </span><span style="color: #000000;">{</span><span style="color: #808080;"> <br /> </span><span style="color: #0000ff;">private</span><span style="color: #808080;"> </span><span style="color: #0000ff;">static</span><span style="color: #808080;"> </span><span style="color: #000000;">RoutedUICommand</span><span style="color: #808080;"> </span><span style="color: #000000;">myCommand</span><span style="color: #808080;"> </span><span style="color: #0000ff;">=</span><span style="color: #808080;"> </span><span style="color: #0000ff;">new</span><span style="color: #808080;"> </span><span style="color: #000000;">RoutedUICommand(</span><span style="color: #808080;">"ShowLocalTime"</span><span style="color: #000000;">,</span><span style="color: #808080;"> "ShowLocalTimeCommand"</span><span style="color: #000000;">,</span><span style="color: #808080;"> </span><span style="color: #0000ff;">typeof</span><span style="color: #000000;">(DateTimeCommands))</span><span style="color: #0000ff;">;</span><span style="color: #808080;"> <br /> <br /> </span><span style="color: #0000ff;">public</span><span style="color: #808080;"> </span><span style="color: #0000ff;">static</span><span style="color: #808080;"> </span><span style="color: #000000;">RoutedUICommand</span><span style="color: #808080;"> </span><span style="color: #000000;">ShowLocalTimeCommand</span><span style="color: #808080;"> <br /> </span><span style="color: #000000;">{</span><span style="color: #808080;"> <br /> </span><span style="color: #0000ff;">get</span><span style="color: #808080;"> </span><span style="color: #000000;">{</span><span style="color: #808080;"> </span><span style="color: #0000ff;">return</span><span style="color: #808080;"> </span><span style="color: #000000;">myCommand</span><span style="color: #0000ff;">;</span><span style="color: #808080;"> </span><span style="color: #000000;">}</span><span style="color: #808080;"> <br /> </span><span style="color: #000000;">}</span><span style="color: #808080;">     <br /> </span><span style="color: #000000;">} </span></div> </blockquote> <div class="code"><span style="color: #808080;"></span></div> <p>In order to use our new command, we need to register a CommandBinding in the class’ static constructor where we would like to use it:</p> <div class="code"><span style="color: #0000ff;"></span></div> <div class="code"><span style="color: #0000ff;">static</span><span style="color: #808080;"> </span><span style="color: #000000;">MainPage()</span><span style="color: #808080;"> <br /> </span><span style="color: #000000;">{</span><span style="color: #808080;">  <br /> </span><span style="color: #000000;">CommandManager.RegisterClassCommandBinding(</span><span style="color: #0000ff;">typeof</span><span style="color: #000000;">(MainPage),</span><span style="color: #808080;"> </span><span style="color: #0000ff;">new</span><span style="color: #808080;"> </span><span style="color: #000000;">CommandBinding(DateTimeCommands.ShowLocalTimeCommand,</span><span style="color: #808080;"> </span><span style="color: #000000;">OnShowLocalTimeCommand,</span><span style="color: #808080;"> </span><span style="color: #000000;">OnQueryShowLocalTimeCommand))</span><span style="color: #0000ff;">;</span><span style="color: #808080;"> <br /> </span><span style="color: #000000;">}</span> </div> <div class="code"> </div> <div class="code">As seen this involves specifying handlers where we implement our logic which is executed upon invocation of the command. If we want to disable execution, all we need to do is set the <strong>CanExecute</strong> property of <strong>CanExecuteRoutedEventArgs</strong> to false: </div> <div class="code"><span style="color: #0000ff;">private</span><span style="color: #808080;"> </span><span style="color: #0000ff;">static</span><span style="color: #808080;"> </span><span style="color: #0000ff;">void</span><span style="color: #808080;"> </span><span style="color: #000000;">OnQueryShowLocalTimeCommand(</span><span style="color: #0000ff;">object</span><span style="color: #808080;"> </span><span style="color: #000000;">sender,</span><span style="color: #808080;"> </span><span style="color: #000000;">CanExecuteRoutedEventArgs</span><span style="color: #808080;"> </span><span style="color: #000000;">e)</span><span style="color: #808080;"> <br /> </span><span style="color: #000000;">{</span><span style="color: #808080;"> <br /> </span><span style="color: #000000;">e.CanExecute</span><span style="color: #808080;"> </span><span style="color: #0000ff;">=</span><span style="color: #808080;"> </span><span style="color: #0000ff;">false;</span><span style="color: #808080;"> <br /> </span><span style="color: #000000;">}</span> </div> <div class="code"><span style="color: #808080;"></span></div> <div class="code">Apart from <strong>CanExecute</strong>, we have access to the <strong>Parameter</strong> property which holds the <strong>CommandParameter</strong> passed when this property is set to the command source. This is also accessible in the ExecutedRoutedEventHandler’s event args and can be used to implement different logic according to the parameter input like:</div> <div class="code">.</div> <div class="code"><span style="color: #0000ff;">private</span><span style="color: #808080;"> </span><span style="color: #0000ff;">static</span><span style="color: #808080;"> </span><span style="color: #0000ff;">void</span><span style="color: #808080;"> </span><span style="color: #000000;">OnShowLocalTimeCommand(</span><span style="color: #0000ff;">object</span><span style="color: #808080;"> </span><span style="color: #000000;">sender,</span><span style="color: #808080;"> </span><span style="color: #000000;">ExecutedRoutedEventArgs</span><span style="color: #808080;"> </span><span style="color: #000000;">e)</span><span style="color: #808080;"> <br /> </span><span style="color: #000000;">{</span><span style="color: #808080;"> <br /> </span><span style="color: #0000ff;">var</span><span style="color: #808080;"> </span><span style="color: #000000;">universalTime</span><span style="color: #808080;"> </span><span style="color: #0000ff;">=</span><span style="color: #808080;"> </span><span style="color: #2b91af;">DateTime</span><span style="color: #000000;">.Now.ToUniversalTime()</span><span style="color: #0000ff;">;</span><span style="color: #808080;"> <br /> </span><span style="color: #0000ff;">string</span><span style="color: #808080;"> </span><span style="color: #000000;">alertContent</span><span style="color: #808080;"> </span><span style="color: #0000ff;">=</span><span style="color: #808080;"> </span><span style="color: #2b91af;">String</span><span style="color: #000000;">.Concat(</span><span style="color: #808080;">"Time in "</span><span style="color: #000000;">,</span><span style="color: #808080;"> </span><span style="color: #000000;">e.Parameter,</span><span style="color: #808080;"> ": "</span><span style="color: #000000;">)</span><span style="color: #0000ff;">;</span><span style="color: #808080;"> <br /> <br /> </span><span style="color: #0000ff;">switch</span><span style="color: #808080;"> </span><span style="color: #000000;">((</span><span style="color: #0000ff;">string</span><span style="color: #000000;">)e.Parameter)</span><span style="color: #808080;"> <br /> </span><span style="color: #000000;">{</span><span style="color: #808080;"> <br /> </span><span style="color: #0000ff;">case</span><span style="color: #808080;"> "Sofia"</span><span style="color: #000000;">:</span><span style="color: #808080;"> </span><span style="color: #000000;">{</span><span style="color: #808080;"> </span><span style="color: #000000;">alertContent</span><span style="color: #808080;"> </span><span style="color: #000000;">+</span><span style="color: #0000ff;">=</span><span style="color: #808080;"> </span><span style="color: #000000;">universalTime.AddHours(</span><span style="color: #800000;">2</span><span style="color: #000000;">).ToShortTimeString()</span><span style="color: #0000ff;">;</span><span style="color: #808080;"> </span><span style="color: #0000ff;">break;</span><span style="color: #808080;"> </span><span style="color: #000000;">}</span><span style="color: #808080;"> <br /> </span><span style="color: #0000ff;">case</span><span style="color: #808080;"> "Munich"</span><span style="color: #000000;">:</span><span style="color: #808080;"> </span><span style="color: #000000;">{</span><span style="color: #808080;"> </span><span style="color: #000000;">alertContent</span><span style="color: #808080;"> </span><span style="color: #000000;">+</span><span style="color: #0000ff;">=</span><span style="color: #808080;"> </span><span style="color: #000000;">universalTime.AddHours(</span><span style="color: #800000;">1</span><span style="color: #000000;">).ToShortTimeString()</span><span style="color: #0000ff;">;</span><span style="color: #808080;"> </span><span style="color: #0000ff;">break;</span><span style="color: #808080;"> </span><span style="color: #000000;">}</span><span style="color: #808080;"> <br /> </span><span style="color: #0000ff;">case</span><span style="color: #808080;"> "Boston"</span><span style="color: #000000;">:</span><span style="color: #808080;"> </span><span style="color: #000000;">{</span><span style="color: #808080;"> </span><span style="color: #000000;">alertContent</span><span style="color: #808080;"> </span><span style="color: #000000;">+</span><span style="color: #0000ff;">=</span><span style="color: #808080;"> </span><span style="color: #000000;">universalTime.AddHours(-</span><span style="color: #800000;">5</span><span style="color: #000000;">).ToShortTimeString()</span><span style="color: #0000ff;">;</span><span style="color: #808080;"> </span><span style="color: #0000ff;">break;</span><span style="color: #808080;"> </span><span style="color: #000000;">}</span><span style="color: #808080;"> <br /> </span><span style="color: #0000ff;">case</span><span style="color: #808080;"> "Dallas"</span><span style="color: #000000;">:</span><span style="color: #808080;"> </span><span style="color: #000000;">{</span><span style="color: #808080;"> </span><span style="color: #000000;">alertContent</span><span style="color: #808080;"> </span><span style="color: #000000;">+</span><span style="color: #0000ff;">=</span><span style="color: #808080;"> </span><span style="color: #000000;">universalTime.AddHours(-</span><span style="color: #800000;">6</span><span style="color: #000000;">).ToShortTimeString()</span><span style="color: #0000ff;">;</span><span style="color: #808080;"> </span><span style="color: #0000ff;">break;</span><span style="color: #808080;"> </span><span style="color: #000000;">}</span><span style="color: #808080;"> <br /> </span><span style="color: #0000ff;">default</span><span style="color: #000000;">:</span><span style="color: #808080;"> </span><span style="color: #000000;">alertContent</span><span style="color: #808080;"> </span><span style="color: #0000ff;">=</span><span style="color: #808080;"> "Unknown time zone"</span><span style="color: #0000ff;">;</span><span style="color: #808080;"> </span><span style="color: #0000ff;">break;</span><span style="color: #808080;"> <br /> </span><span style="color: #000000;">}</span><span style="color: #808080;"> <br /> <br /> </span><span style="color: #000000;">RadWindow.Alert(</span><span style="color: #0000ff;">new</span><span style="color: #808080;"> </span><span style="color: #000000;">DialogParameters()</span><span style="color: #808080;"> </span><span style="color: #000000;">{</span><span style="color: #808080;"> </span><span style="color: #000000;">Content</span><span style="color: #808080;"> </span><span style="color: #0000ff;">=</span><span style="color: #808080;"> </span><span style="color: #000000;">alertContent</span><span style="color: #808080;"> </span><span style="color: #000000;">})</span><span style="color: #0000ff;">;</span><span style="color: #808080;"> </span><span style="color: #808080;">            <br /> </span><span style="color: #000000;">}</span> </div> <div class="code"> </div> <div class="code">See attached example demonstrating usage of RoutedUICommand.</div> <div class="code"><a href="/Files/Commanding.zip">CommandingExample.zip</a><br /> </div> <div class="code"></div> <div class="code"></div> http://blogs.telerik.com/SilverlightTeam/Posts/10-01-08/telerik_commanding_mechanism_for_silverlight_overview.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/10-01-08/telerik_commanding_mechanism_for_silverlight_overview.aspx d3acd095-a12e-4087-a428-3d35bb453a36 Fri, 08 Jan 2010 05:29:00 GMT Using Compass indicators properties for Telerik's Docking Control for Silverlight and WPF <p>Sometimes when using a Docking control and implementing complex UI with it we need to add some custom rules about allowing some panes to be docked in some parts of the application and to disallow them to dock to other parts. As this behavior is quite complex itself, we’ve decided to enable some scenarios to be available in XAML in a declarative way (the more static scenarios) and some scenarios to be available only through the code-behind.<br /> &nbsp;<br /> In this post I will guide you through some simple steps that will show you how you could use both approaches. First of all I will explain you some of the properties of the Compass class that will allow to control its options. After that I will show how to statically set the enabled compass directions. At the end I will show you how to implement some complex logic for enabling and disabling compass directions.</p> <p><strong> Compass directions</strong></p> <p> Both the Compass and RootCompass controls have some dependency properties that allow you to customize their docking directions. The RootCompass inherits from the Compass class, so it contains all the properties defined for the Compass class. Both classes have the following properties:</p> <ul> <li><strong>IsLeftIndicatorVisible</strong>&nbsp; </li> <li><strong>IsTopIndicatorVisible</strong> </li> <li><strong>IsRightIndicatorVisible</strong> </li> <li><strong>IsBottomIndicatorVisible</strong> </li> <li><strong>IsCenterIndicatorVisible</strong> </li> </ul> <p>These properties by default are controlling the visibility of the Compass and RootCompass parts. On Figure 1.1 and 1.2 you can see the parts of the Compass and the RootCompass controls.</p> <p><img alt="" height="273" width="300" src="http://blogs.telerik.com/Libraries/Marketing_team/CompassParts.sflb" /></p> <p><em>Figure 1.1 Parts of the Compass Control</em></p> <p><em></em>&nbsp;</p> <p><img alt="" height="254" width="300" src="http://blogs.telerik.com/Libraries/Marketing_team/RootCompassParts.sflb" /></p> <p>&nbsp;</p> <p><em>Figure 1.2 Parts of the RootCompass Control</em></p> <p><em></em>&nbsp;</p> <p>In the RootCompass class the <strong>IsCenterIndicatorVisible </strong>property is not in use, because the RootCompass doesn’t have a center indicator. Figure 2.1 and 2.2 shows how each property affects both of the compasses:</p> <p><img alt="" height="300" width="229" src="http://blogs.telerik.com/Libraries/Marketing_team/CompassProperties.sflb" style="width: 350px; height: 383px;" /></p> <p><em>Figure 2.1 Compass indicator visibility properties</em></p> <p><img alt="" height="222" width="300" src="http://blogs.telerik.com/Libraries/Marketing_team/RootCompasProperties.sflb" style="width: 389px; height: 314px;" /></p> <p><em>Figure 2.2 RootCompass indicator visibility properties</em></p> <p><em></em>&nbsp;</p> <h2 align="center">Using compass indicators properties globally with Styles</h2> <p>One common scenario is to say that the user is not allowed to dock at one side of the Docking control (for example at the right one). Another common scenario is that our application doesn’t allow the user to have more than one pane in a group. Both of these scenarios are pretty static and we could achieve them using the previously mentioned configuration properties of the Compass and RootCompass controls without writing any code-behind. To achieve the first scenario we need to say to the RootCompass that its right indicator is always invisible. You could do that using the RootCompassStyle property of the Docking control. Listing 1.1 shows how we could use this property.</p> <p>&nbsp;</p> <div class="reCodeBlock" style="border: 1px solid #7f9db9; overflow-y: auto;"> <div style="background-color: #ffffff;"><span><span style="margin-left: 0px ! important;"><code style="color: #000000;">&lt;</code><code style="color: #006699; font-weight: bold;">telerikDocking:RadDocking.CompassStyle</code><code style="color: #000000;">&gt; </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #000000;">&lt;</code><code style="color: #006699; font-weight: bold;">Style</code> <code style="color: #808080;">TargetType</code><code style="color: #000000;">=</code><code style="color: blue;">"dock:Compass"</code><code style="color: #000000;">&gt; </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 36px ! important;"><code style="color: #000000;">&lt;</code><code style="color: #006699; font-weight: bold;">Setter</code> <code style="color: #808080;">Property</code><code style="color: #000000;">=</code><code style="color: blue;">"IsCenterIndicatorVisible"</code> <code style="color: #808080;">Value</code><code style="color: #000000;">=</code><code style="color: blue;">"false"</code> <code style="color: #000000;">/&gt; </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #000000;">&lt;/</code><code style="color: #006699; font-weight: bold;">Style</code><code style="color: #000000;">&gt; </code></span></span></div> <div style="background-color: #ffffff;"><span><span style="margin-left: 0px ! important;"><code style="color: #000000;">&lt;/</code><code style="color: #006699; font-weight: bold;">telerikDocking:RadDocking.CompassStyle</code><code style="color: #000000;">&gt; </code></span></span></div> <div style="background-color: #f8f8f8;"><span><span style="margin-left: 0px ! important;"><code style="color: #000000;">&lt;</code><code style="color: #006699; font-weight: bold;">telerikDocking:RadDocking.RootCompassStyle</code><code style="color: #000000;">&gt; </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #000000;">&lt;</code><code style="color: #006699; font-weight: bold;">Style</code> <code style="color: #808080;">TargetType</code><code style="color: #000000;">=</code><code style="color: blue;">"dock:RootCompass"</code><code style="color: #000000;">&gt; </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 48px ! important;"><code style="color: #000000;">&lt;</code><code style="color: #006699; font-weight: bold;">Setter</code> <code style="color: #808080;">Property</code><code style="color: #000000;">=</code><code style="color: blue;">"IsTopIndicatorVisible"</code> <code style="color: #808080;">Value</code><code style="color: #000000;">=</code><code style="color: blue;">"false"</code> <code style="color: #000000;">/&gt; </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #000000;">&lt;/</code><code style="color: #006699; font-weight: bold;">Style</code><code style="color: #000000;">&gt; </code></span></span></div> <div style="background-color: #f8f8f8;"><span><span style="margin-left: 0px ! important;"><code style="color: #000000;">&lt;/</code><code style="color: #006699; font-weight: bold;">telerikDocking:RadDocking.RootCompassStyle</code><code style="color: #000000;">&gt; </code></span></span></div> </div> <p><em>Listing 1.1: Configure RootCompass using the RootCompassStyle property of the Docking control</em></p> <p><em></em>&nbsp;</p> <h2 align="center">Using compass indicators properties in code behind</h2> <p>When is needed for a group of the same type panes, or even for each pane, to be granted different permissions for docking, the code-behind is used for achieving this more complex scenario. <br /> First, you must hook on the <strong>PreviewShowCompass</strong> event of the Docking control in the XAML and implement your logic in the event-handler in the code-behind. To divide the logic for the RootCompass and the other Compass you should use the <strong>TargetGroup</strong> property of the <strong><em>e</em></strong> argument. If its <strong>TargetGroup</strong> property is null, this means that the event is fired for the RootCompass, if not – for the other Compass. It is good to keep in mind that the programming overrides the styles in XAML, so if you are using both approaches the explicit settings of the properties are “stronger”.</p> <p>So let’s create an example that will utilize the features we already mentioned.<br /> First, we need to create a method called <strong>GetPaneType</strong>, which returns the type of the panes. This is achieved by comparing the resources of the panes, more specificly the color of the brush of the pane’s background, using simple <em>if</em> statements. We will need the type of the panes, so that we can decide which Compass indicators to show and which to hide depending on these types. Here is the code:</p> <div class="reCodeBlock" style="border: 1px solid #7f9db9; overflow-y: auto;"> <div style="background-color: #ffffff;"><span><span style="margin-left: 0px ! important;"><code style="color: #006699; font-weight: bold;">private</code> <code style="color: #000000;">PaneType GetPaneType(RadPane pane) </code></span></span></div> <div style="background-color: #f8f8f8;"><span><span style="margin-left: 0px ! important;"><code style="color: #000000;">{ </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 12px ! important;"><code style="color: #000000;">Panel c = pane.Content </code><code style="color: #006699; font-weight: bold;">as</code> <code style="color: #000000;">Panel; </code></span></span></div> <div style="background-color: #f8f8f8;"><span><span style="margin-left: 0px ! important;"><code style="color: #006699; font-weight: bold;">if</code> <code style="color: #000000;">(c != </code><code style="color: #006699; font-weight: bold;">null</code><code style="color: #000000;">) </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 12px ! important;"><code style="color: #000000;">{ </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #006699; font-weight: bold;">if</code> <code style="color: #000000;">(c.Background.Equals(</code><code style="color: #006699; font-weight: bold;">this</code><code style="color: #000000;">.Resources[</code><code style="color: blue;">"OliveBrush"</code><code style="color: #000000;">])) </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #000000;">{ </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 36px ! important;"><code style="color: #006699; font-weight: bold;">return</code> <code style="color: #000000;">PaneType.Olive; </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #000000;">} </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #006699; font-weight: bold;">else</code> <code style="color: #006699; font-weight: bold;">if</code> <code style="color: #000000;">(c.Background.Equals(</code><code style="color: #006699; font-weight: bold;">this</code><code style="color: #000000;">.Resources[</code><code style="color: blue;">"BlueBrush"</code><code style="color: #000000;">])) </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #000000;">{ </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 36px ! important;"><code style="color: #006699; font-weight: bold;">return</code> <code style="color: #000000;">PaneType.Blue; </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #000000;">} </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #006699; font-weight: bold;">else</code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #000000;">{ </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #006699; font-weight: bold;">return</code> <code style="color: #000000;">PaneType.Purple; </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #000000;">} </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 12px ! important;"><code style="color: #000000;">} </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 36px ! important;"><code style="color: #006699; font-weight: bold;">return</code> <code style="color: #000000;">PaneType.Purple; </code></span></span></div> <div style="background-color: #f8f8f8;"><span><span style="margin-left: 0px ! important;"><code style="color: #000000;">} </code></span></span></div> </div> <p>&nbsp;</p> <p>Then, we will define a method called <strong>CanDockIn</strong>. The return type of this method is Boolean and its parameters are:</p> <ul> <li><strong>paneToDock </strong>of type RadPane - the pane that will be docked in; </li> <li><strong>paneInTargetGroup</strong> also of type RadPane - the pane that is targeted at the moment; </li> <li><strong>position </strong>of type DockPosition, which is the direction the indicators point. </li> </ul> <p>The return value will indicate whether the first pane (paneToDock) can be docked next to the second one(paneInTargetGroup). The third parameter indicates where we want to dock the first pane relatively to second one&nbsp;- to its left, right, top or bottom side or in the same group. We will use this value to set the visibility of the indicators of the Compass for each pane in the event <strong>PreviewShowCompass</strong>. For that we make 2 variables <strong>paneInTargetGroupType</strong>, of type PaneType, which is the pane that is the targeted one (the one that we are holding and moving at the moment), and <strong>paneToDockType</strong>, also of type PaneType, which is the one in which we are eventually going to dock. To the variable paneToDockType is assigned the value of <strong>GetPaneType(paneToDock)</strong>&nbsp;- this is the method that we have initially created with the first argument of the method <strong>CanDockIn</strong>. To the <strong>paneInTargetGroupType </strong>is assigned the <strong>GetPaneType(paneInTargetGroup)</strong>. </p> <p>After getting the type of the panes via the method <strong>GetPaneType</strong>, using switch statements we set the value (true or false) for each type of pane (in the example olive, purple and blue). The value of the outer switch expression, which is shown below, is the paneToDockType. If we take for example this code snippet:</p> <div class="reCodeBlock" style="border: 1px solid #7f9db9; overflow-y: auto;"> <div style="background-color: #ffffff;"><span><span style="margin-left: 0px ! important;"><code style="color: #006699; font-weight: bold;">case</code> <code style="color: #000000;">PaneType.Olive: </code></span></span></div> <div style="background-color: #f8f8f8;"><span><span style="margin-left: 0px ! important;"><code style="color: #006699; font-weight: bold;">switch</code> <code style="color: #000000;">(paneInTargetGroupType) </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 12px ! important;"><code style="color: #000000;">{ </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 12px ! important;"><code style="color: #006699; font-weight: bold;">case</code> <code style="color: #000000;">PaneType.Olive: </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #006699; font-weight: bold;">return</code> <code style="color: #006699; font-weight: bold;">true</code><code style="color: #000000;">; </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 12px ! important;"><code style="color: #006699; font-weight: bold;">case</code> <code style="color: #000000;">PaneType.Blue: </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #006699; font-weight: bold;">return</code> <code style="color: #000000;">position != DockPosition.Left &amp;&amp; position != DockPosition.Right; </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 12px ! important;"><code style="color: #006699; font-weight: bold;">case</code> <code style="color: #000000;">PaneType.Purple: </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #006699; font-weight: bold;">return</code> <code style="color: #006699; font-weight: bold;">false</code><code style="color: #000000;">; </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 12px ! important;"><code style="color: #000000;">} </code></span></span></div> <div style="background-color: #ffffff;"><span><span style="margin-left: 0px ! important;"><code style="color: #006699; font-weight: bold;">break</code><code style="color: #000000;">; </code></span></span></div> </div> <p>This code shows that one <strong>olive</strong> pane:</p> <ul> <li>can be docked in another olive pane </li> <li>in the blue pane, the left and right indicators are&nbsp;disabled </li> <li>in the purple the olive pane can’t be docked at all </li> </ul> <p>In a similar way is defined the visibility of the indicators for the other remaining pane groups.<br /> Similar logic is used for defining the visibility of the indicators of the RootCompass in the method <strong>CanDock</strong>. Again switch statements are used to define for each pane which indicators of the RootCompass are enabled.</p> <div class="reCodeBlock" style="border: 1px solid #7f9db9; overflow-y: auto;"> <div style="background-color: #ffffff;"><span><span style="margin-left: 0px ! important;"><code style="color: #006699; font-weight: bold;">switch</code> <code style="color: #000000;">(paneToDockType) </code></span></span></div> <div style="background-color: #f8f8f8;"><span><span style="margin-left: 0px ! important;"><code style="color: #000000;">{ </code></span></span></div> <div style="background-color: #ffffff;"><span><span style="margin-left: 0px ! important;"><code style="color: #006699; font-weight: bold;">case</code> <code style="color: #000000;">PaneType.Olive: </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #006699; font-weight: bold;">return</code> <code style="color: #000000;">position != DockPosition.Left; </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 12px ! important;"><code style="color: #006699; font-weight: bold;">case</code> <code style="color: #000000;">PaneType.Blue: </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #006699; font-weight: bold;">return</code> <code style="color: #006699; font-weight: bold;">false</code><code style="color: #000000;">; </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 12px ! important;"><code style="color: #006699; font-weight: bold;">case</code> <code style="color: #000000;">PaneType.Purple: </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #006699; font-weight: bold;">return</code> <code style="color: #006699; font-weight: bold;">true</code><code style="color: #000000;">; </code></span></span></div> <div style="background-color: #ffffff;"><span><span style="margin-left: 0px ! important;"><code style="color: #000000;">} </code></span></span></div> <div style="background-color: #f8f8f8;"><span><span style="margin-left: 0px ! important;"><code style="color: #006699; font-weight: bold;">return</code> <code style="color: #006699; font-weight: bold;">false</code><code style="color: #000000;">; </code></span></span></div> </div> <p>&nbsp;</p> <p>Here we can see that for the olive pane the docking to the left is disabled, for the blue pane all 4 indicators in the RootCompass are disabled and for the purple pane all indicators are visible.<br /> We are now able to set the visibility of all indicators of the two Compasses for every pane in the <strong>PreviewShowCompass</strong> event.<br /> The values for the previously mentioned properties <strong>IsLeftIndicatorVisible</strong>, <strong>IsTopIndicatorVisible</strong>, <strong>IsRightIndicatorVisible</strong>, <strong>IsBottomIndicatorVisible</strong>, <strong>IsCenterIndicatorVisible </strong>are determined with the help of the methods <strong>CanDockIn</strong> and <strong>CanDock</strong>, which we have created.</p> <div class="reCodeBlock" style="border: 1px solid #7f9db9; overflow-y: auto;"> <div style="background-color: #ffffff;"><span><span style="margin-left: 0px ! important;"><code style="color: #006699; font-weight: bold;">private</code> <code style="color: #006699; font-weight: bold;">void</code> <code style="color: #000000;">RadDocking_PreviewShowCompass(</code><code style="color: #006699; font-weight: bold;">object</code> <code style="color: #000000;">sender, Telerik.Windows.Controls.Docking.PreviewShowCompassEventArgs e) </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #000000;">{ </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 36px ! important;"><code style="color: #006699; font-weight: bold;">if</code> <code style="color: #000000;">(e.TargetGroup != </code><code style="color: #006699; font-weight: bold;">null</code><code style="color: #000000;">) </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 36px ! important;"><code style="color: #000000;">{ </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 48px ! important;"><code style="color: #000000;">e.Compass.IsCenterIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Center); </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 48px ! important;"><code style="color: #000000;">e.Compass.IsLeftIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Left); </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 48px ! important;"><code style="color: #000000;">e.Compass.IsTopIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Top); </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 48px ! important;"><code style="color: #000000;">e.Compass.IsRightIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Right); </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 48px ! important;"><code style="color: #000000;">e.Compass.IsBottomIndicatorVisible = CanDockIn(e.DraggedSplitContainer, e.TargetGroup, DockPosition.Bottom); </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 36px ! important;"><code style="color: #000000;">} </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 36px ! important;"><code style="color: #006699; font-weight: bold;">else</code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 36px ! important;"><code style="color: #000000;">{ </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 48px ! important;"><code style="color: #000000;">e.Compass.IsLeftIndicatorVisible = CanDock(e.DraggedSplitContainer, DockPosition.Left); </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 48px ! important;"><code style="color: #000000;">e.Compass.IsTopIndicatorVisible = CanDock(e.DraggedSplitContainer, DockPosition.Top); </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 48px ! important;"><code style="color: #000000;">e.Compass.IsRightIndicatorVisible = CanDock(e.DraggedSplitContainer, DockPosition.Right); </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 48px ! important;"><code style="color: #000000;">e.Compass.IsBottomIndicatorVisible = CanDock(e.DraggedSplitContainer, DockPosition.Bottom); </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 36px ! important;"><code style="color: #000000;">} </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 36px ! important;"><code style="color: #000000;">e.Canceled = !(CompassNeedsToShow(e.Compass)); </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #000000;">} </code></span></span></div> </div> <p>&nbsp;</p> <p>As we can see in the Boolean value, which is returned by the methods <strong>CanDock</strong> and <strong>CanDockIn</strong>, is set to the corresponding properties <strong>IsCenterIndicatorVisible</strong>, <strong>IsLeftIndicatorVisible</strong>, <strong>IsTopIndicatorVisible</strong>, <strong>IsRightIndicatorVisible</strong>, <strong>IsBottomIndicatorVisible</strong>, which make the indicator visible or invisible.<br /> The property <strong>Canceled </strong>of the <strong><em>e</em></strong> argument, if set to true, disables the whole Compass. The line </p> <div class="reCodeBlock" style="border: 1px solid #7f9db9; overflow-y: auto;"> <div style="background-color: #ffffff;"><span><span style="margin-left: 0px ! important;"><code style="color: #000000;">e.Canceled = !(CompassNeedsToShow(e.Compass));</code></span></span></div> </div> <p>refers to another method, called <strong>CompassNeedsToShow</strong>, which checks if all indicators are disabled, if so, disables the whole Compass, like so:</p> <div class="reCodeBlock" style="border: 1px solid #7f9db9; overflow-y: auto;"> <div style="background-color: #ffffff;"><span><span style="margin-left: 0px ! important;"><code style="color: #006699; font-weight: bold;">private</code> <code style="color: #006699; font-weight: bold;">static</code> <code style="color: #006699; font-weight: bold;">bool</code> <code style="color: #000000;">CompassNeedsToShow(Telerik.Windows.Controls.Docking.Compass compass) </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 12px ! important;"><code style="color: #000000;">{ </code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 24px ! important;"><code style="color: #006699; font-weight: bold;">return</code> <code style="color: #000000;">compass.IsLeftIndicatorVisible || compass.IsTopIndicatorVisible || compass.IsRightIndicatorVisible || compass.IsBottomIndicatorVisible || compass.IsCenterIndicatorVisible; </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;&nbsp;&nbsp;&nbsp;</code><span style="margin-left: 12px ! important;"><code style="color: #000000;">} </code></span></span></div> </div> <p>&nbsp;</p> <p><a href="/Files/RadDockingCompass.zip">Here</a>&nbsp;you can find an example which illustrates the described implementation of the RadDocking Control. For more information please refer to Telerik’s&nbsp;<a href="http://demos.telerik.com/silverlight/#Docking/Compass/Programming">online demos for Silverlight</a>, the&nbsp;<a href="http://demos.telerik.com/wpf/">demos for WPF</a>&nbsp;and <a href="http://www.telerik.com/help/wpf/raddocking-overview2.html">help documentation for WPF</a>&nbsp;and <a href="http://www.telerik.com/help/silverlight/raddocking-overview2.html">help documentation for Silverlight</a>.</p> http://blogs.telerik.com/SilverlightTeam/Posts/09-12-29/using_compass_indicators_properties_for_telerik_s_docking_control_for_silverlight_and_wpf.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/09-12-29/using_compass_indicators_properties_for_telerik_s_docking_control_for_silverlight_and_wpf.aspx 9580d2ed-b1a2-45bd-8bae-fe26279cea15 Tue, 29 Dec 2009 02:24:00 GMT How to add a scrollbar to Telerik RadMenu for Silverlight As we received a lot of questions on how to add a ScrollViewer to the RadMenu control for Silverlight, in this blog post I am going to explain how you can achieve this.<br /> <br /> Adding a ScrollViewer to RadMenu for Silverlight can be easily accomplished using Expression Blend.<br /> <br /> <strong>Step 1</strong>. Create a new Silverlight 3 Application.<br /> <br /> <strong>Step 2</strong>. Add references to <strong>Telerik.Windows.Controls.dll</strong> and <strong>Telerik.Windows.Controls.Navigation.dll</strong> in your project.<br /> <br /> <strong>Step 3</strong>. Drag RadMenu and RadMenuItem controls from the Toolbox and drop them on the design surface.<br /> <br /> <img width="373" height="252" alt="" width="373" height="252" src="http://blogs.telerik.com/Libraries/Marketing_team/toolbox.sflb" /><br /> <p style="line-height: 14.25pt;"> </p> <p style="line-height: 14.25pt;"><strong>Step 4</strong>. Right-click on one of the RadMenuItems and select <strong>EditStyle</strong> or select it and from the menu by choosing <em>Object -&gt; Edit Style -&gt; Edit a Copy</em>.</p> <p style="line-height: 14.25pt;"><img alt="" src="http://blogs.telerik.com/Libraries/Marketing_team/EditStyle.sflb" /></p> <p style="line-height: 14.25pt;"> </p> <p style="line-height: 14.25pt;">You will be prompted for the name of the style and where it should be placed within your application:</p> <p style="line-height: 14.25pt;"><img alt="" src="http://blogs.telerik.com/Libraries/Marketing_team/EditMenuItem.sflb" /></p> <p>After that, Blend will create all the needed styles and templates for you. </p> <p><strong>Step 5</strong>. Open the XAML code and find the <strong>ItemsPresenter </strong>element. It is located in the <strong>TopLevelHeaderTemplate </strong>and <strong>SubMenuHeaderTemplate </strong>templates. This element is used to specify the place in the control’s visual tree where the ItemsPanel (defined by the ItemsControl) will be added. </p> <p><strong>Step 6</strong>.  After locating the <strong>ItemsPresenter</strong>(s),<strong> </strong>wrap each one of them into a ScrollViewer:</p> <p><img width="587" height="198" alt="" width="587" height="198" src="http://blogs.telerik.com/Libraries/Marketing_team/itemsPresenter.sflb" /></p> <p style="margin-bottom: 0pt;">&nbsp;</p> <p style="margin-bottom: 0pt;">Set <strong>MaxHeight </strong>on each ScrollViewer:</p> <p style="margin-bottom: 0pt;">&nbsp;</p> <p style="margin-bottom: 0pt;">&nbsp;</p> <div class="reCodeBlock" style="border: #7f9db9 1px solid; overflow-y: auto;"> <div style="background-color: #ffffff;"><span><span style="margin-left: 0px !important;"><code style="color: #000000;">&lt;</code><code style="color: #006699; font-weight: bold;">ScrollViewer</code> <code style="color: #000000;">MaxHeight=”140”&gt;</code></span></span></div> </div> <p style="margin-bottom: 0pt;">&nbsp;</p> <p style="margin-bottom: 0pt;">To enable scrolling in the menu you should set the <strong>ScrollViewerExtensions.EnableMouseWheel</strong> attached property to true</p> <p style="margin-bottom: 0pt;">&nbsp;</p> <p style="margin-bottom: 0pt;">If you want to set a theme, you should use:</p> <p style="margin-bottom: 0pt;">&nbsp;</p> <p style="margin-bottom: 0pt;">&nbsp;</p> <div class="reCodeBlock" style="border: #7f9db9 1px solid; overflow-y: auto;"> <div style="background-color: #ffffff;"><span><span style="margin-left: 0px !important;"><code style="color: #000000;">StyleManager.Theme="Office_Black"<br /> </code></span></span></div> </div> <p>&nbsp;</p> <p>The final result will be looking like this:</p> <p><img alt="" src="http://blogs.telerik.com/Libraries/Marketing_team/Untitled.sflb" /></p> <p><a href="/Files/SilverlightApplicationTest.zip">Here</a> is an example project which includes the above implementation of the RadMenu and ScrollViewer. For more information about the RadMenu and the ScrollViewer control please see Telerik’s <a href="http://demos.telerik.com/Silverlight/" title="http://demos.telerik.com/Silverlight/">online demos</a> and <a href="http://www.telerik.com/help/silverlight/introduction.html" title="http://www.telerik.com/help/silverlight/introduction.html" shape="rect">help documentation</a>.</p> http://blogs.telerik.com/SilverlightTeam/Posts/09-12-10/how_to_add_a_scrollbar_to_telerik_radmenu_for_silverlight.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/09-12-10/how_to_add_a_scrollbar_to_telerik_radmenu_for_silverlight.aspx db7a2304-6bc2-43ed-8854-6a8c6f0d52a2 Thu, 10 Dec 2009 11:10:00 GMT WPF RadDocking Overview <link href="file:///C:\Users\manev\AppData\Local\Temp\1\msohtmlclip1\01\clip_filelist.xml" rel="File-List" /> <link href="file:///C:\Users\manev\AppData\Local\Temp\1\msohtmlclip1\01\clip_themedata.thmx" rel="themeData" /> <link href="file:///C:\Users\manev\AppData\Local\Temp\1\msohtmlclip1\01\clip_colorschememapping.xml" rel="colorSchemeMapping" /><radeditorformatted_1><radeditorformatted_2> <radeditorformatted_23> <radeditorformatted_4> <p class="MsoNormal"><span class="apple-style-span"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">It’s been a while since the Q3 2009 release. Lots of controls have been added in our toolbox for WPF. One of them is considered as a final official release of RadDocking control for WPF. We have made a lot of improvements since the last release of the controls. For example each of the six themes included in the bundle now has different type of appearance when applied to a control. RadDocking is a fully customizable and skinnable control that enhances the power of a layout system. It is providing you with a docking system like the one in Microsoft Visual Studio. You are getting the dockable ToolWindows, a hidden DockingManager control, and a designer to easily create attractive layouts. It is good to mention that the WPF RadDocking code is absolutely compatible with its </span></span><span class="hs-buildflag-markup"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">Silverlight</span></span><span class="apple-converted-space"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><span class="apple-style-span"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">counterpart. </span></span></p> <p class="MsoNormal"><span class="apple-style-span"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><img alt="" src="http://blogs.telerik.com/Libraries/Silverlight_team/RadDocking_1.sflb" /><br /> </span></span></p> <p class="MsoNormal"><span class="apple-style-span"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"> <span> <span> <link href="file:///C:\Users\manev\AppData\Local\Temp\1\msohtmlclip1\01\clip_filelist.xml" rel="File-List" /> </span></span><span> <span> <link href="file:///C:\Users\manev\AppData\Local\Temp\1\msohtmlclip1\01\clip_themedata.thmx" rel="themeData" /> </span></span><span> <span> <link href="file:///C:\Users\manev\AppData\Local\Temp\1\msohtmlclip1\01\clip_colorschememapping.xml" rel="colorSchemeMapping" /><radeditorformatted_5><radeditorformatted_6> </radeditorformatted_6></radeditorformatted_5></span></span><radeditorformatted_24> <radeditorformatted_8> </radeditorformatted_8></radeditorformatted_24></span> <p style="margin-bottom: 0.0001pt; line-height: 14.25pt;" class="MsoNormal"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span><span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">RadDocking</span></strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;key features list:<o:p></o:p></span></span></span></span></p> <span> </span> <p style="margin-bottom: 0.0001pt; text-indent: -0.25in; line-height: 14.25pt;" class="MsoListParagraphCxSpFirst"><radeditorformatted_9><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span style="font-size: 10pt; font-family: symbol;"><span><span><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: &quot;times new roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span></span><radeditorformatted_10><span><span><span>&nbsp;</span></span></span><span><span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;;">Save/Load Layout</span></strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;;">&nbsp;- When building complex layouts with&nbsp;RadDocking&nbsp;the users will often expect to persist the layout from one session to another. It can be easily achieved with the advanced Save\Load layout mechanism of the&nbsp;RadDocking&nbsp;control.&nbsp;It&nbsp;provides&nbsp;a method that stores the entire layout in a stream containing XML. After the storing you can simply restore the layout from its previous state. In addition, you can choose to save the stream elsewhere, in a text box, or directly in the isolated storage</span><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;;"><o:p></o:p></span></span></span></radeditorformatted_10></span></radeditorformatted_9></p> <span> </span> <p style="margin-bottom: 0.0001pt; line-height: 14.25pt;" class="MsoListParagraphCxSpLast"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;;"><o:p><span><span>&nbsp;</span></span></o:p></span></span></p> <span> </span> <p style="margin: 0in 0in 0.0001pt 22.5pt; text-indent: -0.25in; line-height: 14.25pt;" class="MsoNormal"><radeditorformatted_11><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span class="apple-style-span"><span style="font-size: 10pt; font-family: symbol; color: black;"><span><span><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: &quot;times new roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span></span></span><radeditorformatted_12><span><span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">Split Containers – </span></strong><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">The</span></span><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">RadSplitContainer</span></strong><span class="apple-converted-space"><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></strong></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">allows you to use movable bars to divide the displayed area into resizable parts. With</span></span><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;the </span></span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">RadDocking</span></strong><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">'s</span></span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">RadSplitContainers</span></strong><span class="apple-converted-space"><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></strong></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">you can build complex layouts that can even include nested split areas. Some immediate examples of such layouts are Explorer-like and outlook-like interfaces. The</span></span><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">RadDocking</span></strong><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">'s</span></span><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">RadSplitContainers</span></strong><span class="apple-converted-space"><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></strong></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">allows you to define the&nbsp;</span></span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">Orientation</span></strong><span class="apple-converted-space"><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></strong></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">and the</span></span><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">InitialPosition</span></strong><span class="apple-converted-space"><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></strong></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">of the container.</span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><o:p></o:p></span></span></span></span></radeditorformatted_12></span></radeditorformatted_11></p> <span> </span> <p style="margin-bottom: 0.0001pt; line-height: 14.25pt;" class="MsoNormal"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><o:p><span><span>&nbsp;</span></span></o:p></span></span></span></p> <span> </span> <p style="margin: 0in 0in 0.0001pt 22.5pt; text-indent: -0.25in; line-height: 14.25pt;" class="MsoNormal"><radeditorformatted_13><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span class="apple-style-span"><span style="font-size: 10pt; font-family: symbol; color: black;"><span><span><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: &quot;times new roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span></span></span><radeditorformatted_14><span><span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">Tabbed Documents - </span></strong><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">RadDocking</span></strong><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">supports tabbed documents for document -oriented applications. It allows you to see documents by splitting them into multiple panes</span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><o:p></o:p></span></span></span></span></radeditorformatted_14></span></radeditorformatted_13></p> <span> </span> <p style="margin-bottom: 0.0001pt; line-height: 14.25pt;" class="MsoNormal"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><o:p><span><span>&nbsp;</span></span></o:p></span></span></p> <span> </span> <p style="margin: 0in 0in 0.0001pt 22.5pt; text-indent: -0.25in; line-height: 14.25pt;" class="MsoNormal"><radeditorformatted_15><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span class="apple-style-span"><span style="font-size: 10pt; font-family: symbol; color: black;"><span><span><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: &quot;times new roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span></span></span><radeditorformatted_16><span><span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">Pin/Unpin and Hide&nbsp;Panes - </span></strong><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">To display content on demand, a docked window can be pinned, unpinned or hidden. The pane is in an unpinned state by default. When unpinned the pane collapses down to a tab.&nbsp; </span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><o:p></o:p></span></span></span></span></radeditorformatted_16></span></radeditorformatted_15></p> <span> </span> <p style="margin-bottom: 0.0001pt; line-height: 14.25pt;" class="MsoNormal"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><o:p><span><span>&nbsp;</span></span></o:p></span></span></span></p> <span> </span> <p style="margin: 0in 0in 0.0001pt 22.5pt; text-indent: -0.25in; line-height: 14.25pt;" class="MsoNormal"><radeditorformatted_17><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span class="apple-style-span"><span style="font-size: 10pt; font-family: symbol; color: black;"><span><span><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: &quot;times new roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span></span></span><radeditorformatted_18><span><span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">Dockable Windows -</span></strong><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">RadDocking</span></strong><span class="apple-converted-space"><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></strong></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">has a full drag-and-drop support including the docking compass and the docking hints for visual feedback. You are free to drag the dockable windows anywhere in the container to create customized layouts. </span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><o:p></o:p></span></span></span></span></radeditorformatted_18></span></radeditorformatted_17></p> <span> </span> <p style="margin-bottom: 0.0001pt; line-height: 14.25pt;" class="MsoNormal"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><o:p><span><span>&nbsp;</span></span></o:p></span></span></p> <span> </span> <p style="margin: 0in 0in 0.0001pt 22.5pt; text-indent: -0.25in; line-height: 14.25pt;" class="MsoNormal"><radeditorformatted_19><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span class="apple-style-span"><span style="font-size: 10pt; font-family: symbol; color: black;"><span><span><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: &quot;times new roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span></span></span><radeditorformatted_20><span><span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">Floating Windows - </span></strong><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">Once you start dragging</span></span><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">Pane</span></strong><span class="apple-converted-space"><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></strong></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">or</span></span><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">Group</span></strong><span class="apple-converted-space"><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></strong></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">it moves to</span></span><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">Floating Window</span></strong><span class="apple-converted-space"><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></strong></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">almost immediately. The hints of the</span></span><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">RadDocking</span></strong><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">for visual feedback are showing the user where the object will be placed.</span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><o:p></o:p></span></span></span></span></radeditorformatted_20></span></radeditorformatted_19></p> <span> </span> <p style="margin-bottom: 0.0001pt; line-height: 14.25pt;" class="MsoNormal"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><o:p><span><span>&nbsp;</span></span></o:p></span></span></p> <span> </span> <p style="margin: 0in 0in 0.0001pt 22.5pt; text-indent: -0.25in; line-height: 14.25pt;" class="MsoNormal"><radeditorformatted_21><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span class="apple-style-span"><span style="font-size: 10pt; font-family: symbol; color: black;"><span><span><span>·<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: &quot;times new roman&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span></span></span><radeditorformatted_22><span><span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">WPF/Silverlight Code Compatibility -</span></strong><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"> The</span></span><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><span class="hs-buildflag-markup"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">WPF</span></span><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">RadDocking</span></strong><span class="apple-converted-space"><strong><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></strong></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">shares a common code-base and API with its</span></span><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><span class="hs-buildflag-markup"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">Silverlight</span></span><span class="apple-converted-space"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">&nbsp;</span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;">counterpart. That means that you can achieve close to 100% code reuse for your grid logic if you have parallel Silverlight/WPF development.</span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><o:p></o:p></span></span></span></span></radeditorformatted_22></span></radeditorformatted_21></p> <span> </span> <p style="margin: 0in 0in 0.0001pt 22.5pt; line-height: 14.25pt;" class="MsoNormal"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><span class="apple-style-span"><span style="font-size: 10pt; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><o:p><span><span>&nbsp;</span></span></o:p></span></span></span></p> <span> <span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"></span></span></span></p> <p class="MsoNormal"><span class="apple-style-span"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;verdana&quot;,&quot;sans-serif&quot;; color: black;"><o:p></o:p></span></span></p> </radeditorformatted_4></radeditorformatted_23></radeditorformatted_2></radeditorformatted_1> http://blogs.telerik.com/SilverlightTeam/Posts/09-12-07/wpf_raddocking_overview.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/09-12-07/wpf_raddocking_overview.aspx 579628c1-4f17-41d2-8ac7-4bc1af4d5cc3 Mon, 07 Dec 2009 11:04:39 GMT A brand new Timeline view for Teleriks Scheduler control for Silverlight/WPF <p>Along with other main features like standard resources and resource grouping, the Q3 2009 release brought an additional view to the present ones (Day, Week and Month) – <strong>Timeline</strong>. Briefly said, it displays a certain number of consecutive time slots and like all other views, the Timeline view is configurable in almost the same way. Here is how it looks like by default:</p> <p>&nbsp;</p> <p><a href="http://blogs.telerik.com/Libraries/MetaBlogLib/image_4BC7732E.sflb"><img height="201" width="550" src="http://blogs.telerik.com/Libraries/MetaBlogLib/image_thumb_0B09FC87.sflb" alt="image" title="image" style="border-style: solid; border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" /></a></p> <p>&nbsp;</p> <p>… where each time slot is 1 day long (i.e. <strong>TimeSlotLength</strong> of the <strong>TimelineViewDefinition</strong> is equal to one day) and the date in each header is displayed in a “d-M-yyyy” format. </p> <p>Let’s tweak a bit some of the settings related to the Timeline view and add some resources: </p> <p>&nbsp;</p> <p><span style="color: #000000;"></span></p> <div class="code"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">telerik:RadScheduler</span><span style="color: #ff0000;"> Grid.Row</span><span style="color: #0000ff;">="0"</span><span style="color: #ff0000;"> x:Name</span><span style="color: #0000ff;">="scheduler"</span><span style="color: #ff0000;">&nbsp;<strong>TimelineHeaderFormat</strong></span><span style="color: #0000ff;"><strong>="{}{0:H:mm tt}"</strong></span><span style="color: #ff0000;"> GroupBy</span><span style="color: #0000ff;">="Person"</span><span style="color: #ff0000;">&nbsp;</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><strong><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">telerik:RadScheduler.TimelineViewDefinition</span><span style="color: #0000ff;">&gt;</span></strong><span style="color: #000000;"> <br /> <strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong></span><strong><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">telerik:TimelineViewDefinition</span><span style="color: #ff0000;"> DayStartTime</span><span style="color: #0000ff;">="08:00:00"</span><span style="color: #ff0000;"> DayEndTime</span><span style="color: #0000ff;">="19:00:00"</span><span style="color: #ff0000;"> TimeSlotLength</span><span style="color: #0000ff;">="1:0:0"</span><span style="color: #ff0000;"> VisibleDays</span><span style="color: #0000ff;">="1"</span><span style="color: #ff0000;">&nbsp;</span></strong><strong><span style="color: #0000ff;">/&gt; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="color: #800000;">telerik:RadScheduler.TimelineViewDefinition</span><span style="color: #0000ff;">&gt;</span></strong><span style="color: #000000;"> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">telerik:RadScheduler.ResourceTypes</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">telerik:ResourceType</span><span style="color: #ff0000;"> Name</span><span style="color: #0000ff;">="Person"</span><span style="color: #ff0000;"> AllowMultipleSelection</span><span style="color: #0000ff;">="True"</span><span style="color: #ff0000;">&nbsp;</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">telerik:ResourceType.Resources</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">telerik:Resource</span><span style="color: #ff0000;"> ResourceName</span><span style="color: #0000ff;">="Rosi"</span><span style="color: #ff0000;">&nbsp;</span><span style="color: #0000ff;">/&gt; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="color: #800000;">telerik:Resource</span><span style="color: #ff0000;"> ResourceName</span><span style="color: #0000ff;">="Toti"</span><span style="color: #ff0000;">&nbsp;</span><span style="color: #0000ff;">/&gt; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="color: #800000;">telerik:ResourceType.Resources</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">telerik:ResourceType</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">telerik:RadScheduler.ResourceTypes</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">telerik:RadScheduler.ResourceStyleMappings</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">telerik:ResourceStyleMapping</span><span style="color: #ff0000;"> ResourceType</span><span style="color: #0000ff;">="Person"</span><span style="color: #ff0000;"> ResourceName</span><span style="color: #0000ff;">="Rosi"</span><span style="color: #ff0000;"> ResourceBrush</span><span style="color: #0000ff;">="LightPink"</span><span style="color: #ff0000;">&nbsp;</span><span style="color: #0000ff;">/&gt;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span><span style="color: #800000;">telerik:ResourceStyleMapping</span><span style="color: #ff0000;"> ResourceType</span><span style="color: #0000ff;">="Person"</span><span style="color: #ff0000;"> ResourceName</span><span style="color: #0000ff;">="Toti"</span><span style="color: #ff0000;"> ResourceBrush</span><span style="color: #0000ff;">="LightBlue"</span><span style="color: #ff0000;">&nbsp;</span><span style="color: #0000ff;">/&gt;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span><span style="color: #800000;">telerik:RadScheduler.ResourceStyleMappings</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">telerik:RadScheduler</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"></span> </div> <div class="code">&nbsp;</div> <p><span style="color: #000000;"></span></p> <p><a href="http://blogs.telerik.com/Libraries/MetaBlogLib/image_0846169E.sflb"><img height="242" width="554" src="http://blogs.telerik.com/Libraries/MetaBlogLib/image_thumb_54EC224B.sflb" alt="image" title="image" style="border-style: solid; border-width: 0px; display: block; float: none; margin-left: auto; margin-right: auto;" /></a></p> <p></p> <p>&nbsp;</p> <p>As you see setting the <strong>DayStartTime</strong> and <strong>DayEndTime</strong> properties allow us to show only working hours and thus concentrating on what is important. </p> <p>&nbsp;</p> <p>Hope this will be of use!</p> http://blogs.telerik.com/SilverlightTeam/Posts/09-11-17/a_brand_new_timeline_view_for_teleriks_scheduler_control_for_silverlight_wpf.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/09-11-17/a_brand_new_timeline_view_for_teleriks_scheduler_control_for_silverlight_wpf.aspx 81f4b925-2e1d-4b4c-a274-f43abe7dc3ba Tue, 17 Nov 2009 06:20:00 GMT Drag and drop items onto RadScheduler for Silverlight We all are aware that users tend to look for the easiest and most rational way to do something. That is why developers always strive to create their products' interface as intuitive as possible. Speaking in this context, dragging and dropping helps us improve user experience significantly and make end users happier. <br /> <br /> <p>In this blog post I will explain how we can use <strong>RadDragAndDrop </strong>to enable users drag items from a certain control and drop them over <strong>RadScheduler</strong>, while notifying about that. Of course, the described scenario could be extended to act in many different scenarios.</p> <ol> <li>Let us say we will drag items from a listbox to a scheduler control. The xaml should look like:<br /> <span style="font-family: 'arial', 'sans-serif'; font-size: 9pt;"> <div style="border: #7f9db9 1px solid; line-height: 100% !important; background-color: white; font-family: courier new; font-size: 11px; overflow: auto; "> <table style="border-bottom: #eee 0px solid; border-right-width: 0px; background-color: #fff; margin: 2px 0px; width: 99%; border-collapse: collapse; border-top-width: 0px; border-left-width: 0px;" cellspacing="0" cellpadding="0"> <colgroup><col style="border-bottom: #f7f7f7 1px solid; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">Grid x:</span><span style="color: #ff0000;">Name</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"LayoutRoot"</span><span style="font-size: 11px;">&gt;  </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">        <span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">Grid.ColumnDefinitions</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td>            <span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">ColumnDefinition </span><span style="color: #ff0000;">Width</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"100"</span><span style="font-size: 11px;"> </span><span style="color: #0000ff;">/&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">            <span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">ColumnDefinition </span><span style="color: #0000ff;">/&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td>        <span style="color: #0000ff;">&lt;/</span><span style="font-size: 11px;">Grid.ColumnDefinitions</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">        <span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">ListBox x:</span><span style="color: #ff0000;">Name</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"listBox"</span><span style="font-size: 11px;"> </span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td>            <span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">ListBox.ItemContainerStyle</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">                <span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">Style </span><span style="color: #ff0000;">TargetType</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"ListBoxItem"</span><span style="font-size: 11px;">&gt;  </span></td> </tr> <tr> <td>                    <span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">Setter </span><span style="color: #ff0000;">Property</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"dragDrop:RadDragAndDropManager.AllowDrag"</span><span style="font-size: 11px;"> </span><span style="color: #ff0000;">Value</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"True"</span><span style="font-size: 11px;"> </span><span style="color: #0000ff;">/&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">                <span style="color: #0000ff;">&lt;/</span><span style="font-size: 11px;">Style</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td>            <span style="color: #0000ff;">&lt;/</span><span style="font-size: 11px;">ListBox.ItemContainerStyle</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">            <span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">ListBox.ItemTemplate</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td>                <span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">DataTemplate</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">                    <span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">TextBlock </span><span style="color: #ff0000;">Text</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"{Binding}"</span><span style="font-size: 11px;"> </span><span style="color: #0000ff;">/&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td>                <span style="color: #0000ff;">&lt;/</span><span style="font-size: 11px;">DataTemplate</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">            <span style="color: #0000ff;">&lt;/</span><span style="font-size: 11px;">ListBox.ItemTemplate</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td>        <span style="color: #0000ff;">&lt;/</span><span style="font-size: 11px;">ListBox</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">            <span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">Controls:RadScheduler </span><span style="color: #ff0000;">Grid.Column</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"1"</span><span style="font-size: 11px;"> </span><span style="color: #ff0000;">Name</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"Scheduler"</span><span style="font-size: 11px;"> </span><span style="color: #0000ff;">/&gt;</span><span style="font-size: 11px;"> </span></td> </tr> <tr> <td>  <span style="color: #0000ff;">&lt;/</span><span style="font-size: 11px;">Grid</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;"> </span></td> </tr> </tbody> </table> </div> </span>Please note that we must set the <strong>RadDragAndDropManager.AllowDrag</strong> attached property to <strong>True</strong> for each <strong>ListBoxItem</strong> to "activate" the drag functionality. </li> <li>To enable drop onto the <strong>TimeSlotItem</strong> elements in our <strong>RadScheduler</strong> control, we find them in the code behind and set the <strong>RadDragAndDropManager.AllowDropProperty</strong> to true:<br /> <strong><span style="font-family: arial;"> <div style="border: #7f9db9 1px solid; line-height: 100% !important; background-color: white; font-family: courier new; font-size: 11px; overflow: auto; "> <table style="border-bottom: #eee 0px solid; border-right-width: 0px; background-color: #fff; margin: 2px 0px; width: 99%; border-collapse: collapse; border-top-width: 0px; border-left-width: 0px;" cellspacing="0" cellpadding="0"> <colgroup><col style="border-bottom: #f7f7f7 1px solid; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: #0000ff;">private</span><span style="font-size: 11px;"> </span><span style="color: #0000ff;">void</span><span style="font-size: 11px;"> InitializeTimeSlotItems()  </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">{  </td> </tr> <tr> <td>   <span style="color: #0000ff;">this</span><span style="font-size: 11px;">.timeSlotItems = </span><span style="color: #0000ff;">this</span><span style="font-size: 11px;">.Scheduler.ChildrenOfType&lt;TimeSlotItem&gt;();  </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">   <span style="color: #0000ff;">foreach</span><span style="font-size: 11px;"> (TimeSlotItem item </span><span style="color: #0000ff;">in</span><span style="font-size: 11px;"> </span><span style="color: #0000ff;">this</span><span style="font-size: 11px;">.timeSlotItems)  </span></td> </tr> <tr> <td>   {  </td> </tr> <tr> <td style="background-color: #f7f7f7;">      item.SetValue(RadDragAndDropManager.AllowDropProperty, <span style="color: #0000ff;">true</span><span style="font-size: 11px;">);  </span></td> </tr> <tr> <td>   }  </td> </tr> <tr> <td style="background-color: #f7f7f7;">} </td> </tr> </tbody> </table> </div> </span></strong></li> <li>Additionally, to enable users to drag and drop, in the constructor of the Page just add handlers needed by <strong>RadDragAndDropManager</strong>:  <strong><span style="font-family: arial;"> <div style="border: #7f9db9 1px solid; line-height: 100% !important; background-color: white; font-family: courier new; font-size: 11px; overflow: auto; "> <table style="border-bottom: #eee 0px solid; border-right-width: 0px; background-color: #fff; margin: 2px 0px; width: 99%; border-collapse: collapse; border-top-width: 0px; border-left-width: 0px;" cellspacing="0" cellpadding="0"> <colgroup><col style="border-bottom: #f7f7f7 1px solid; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;">RadDragAndDropManager.AddDragQueryHandler(</span><span style="color: #0000ff;">this</span><span style="font-size: 11px;">, OnDragQuery);  </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">RadDragAndDropManager.AddDropQueryHandler(<span style="color: #0000ff;">this</span><span style="font-size: 11px;">, OnDropQuery);  </span></td> </tr> <tr> <td>RadDragAndDropManager.AddDropInfoHandler(<span style="color: #0000ff;">this</span><span style="font-size: 11px;">, OnDropInfo); </span></td> </tr> </tbody> </table> </div> </span></strong></li> <li>And On Drop Info we add a new appointment over the corresponding <strong>TimeSlotItem</strong>, and delete the dragged <strong>ListBoxItem</strong> in this way:<br /> <span style="font-family: arial;"> <div style="border: #7f9db9 1px solid; line-height: 100% !important; background-color: white; font-family: courier new; font-size: 11px; overflow: auto; "> <table style="border-bottom: #eee 0px solid; border-right-width: 0px; background-color: #fff; margin: 2px 0px; width: 99%; border-collapse: collapse; border-top-width: 0px; border-left-width: 0px;" cellspacing="0" cellpadding="0"> <colgroup><col style="border-bottom: #f7f7f7 1px solid; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: #0000ff;">private</span><span style="font-size: 11px;"> </span><span style="color: #0000ff;">void</span><span style="font-size: 11px;"> OnDropInfo(</span><span style="color: #0000ff;">object</span><span style="font-size: 11px;"> sender, DragDropEventArgs e)  </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">{  </td> </tr> <tr> <td>    var sourceListBoxItem = e.Options.Source <span style="color: #0000ff;">as</span><span style="font-size: 11px;"> System.Windows.Controls.ListBoxItem;  </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">    var timeSlotItem = e.Options.Destination <span style="color: #0000ff;">as</span><span style="font-size: 11px;"> TimeSlotItem;  </span></td> </tr> <tr> <td>    <span style="color: #0000ff;">if</span><span style="font-size: 11px;"> (e.Options.Status == DragStatus.DropComplete &amp;&amp; timeSlotItem != </span><span style="color: #0000ff;">null</span><span style="font-size: 11px;">)  </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">    {  </td> </tr> <tr> <td>        <span style="color: #0000ff;">this</span><span style="font-size: 11px;">.Scheduler.Appointments.Add(  </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">            <span style="color: #0000ff;">new</span><span style="font-size: 11px;"> Appointment()  </span></td> </tr> <tr> <td>            {  </td> </tr> <tr> <td style="background-color: #f7f7f7;">                Start = timeSlotItem.TimeSlot.Start,  </td> </tr> <tr> <td>                End = timeSlotItem.TimeSlot.End,  </td> </tr> <tr> <td style="background-color: #f7f7f7;">                Subject = sourceListBoxItem.FindChildByType&lt;TextBlock&gt;().Text  </td> </tr> <tr> <td>            }  </td> </tr> <tr> <td style="background-color: #f7f7f7;">        );  </td> </tr> <tr> <td>        <span style="color: #0000ff;">this</span><span style="font-size: 11px;">.source.Remove(sourceListBoxItem.Content.ToString());  </span></td> </tr> <tr> <td style="background-color: #f7f7f7;">    }  </td> </tr> <tr> <td>} </td> </tr> </tbody> </table> </div> </span></li> </ol> <p><a href="http://blogs.telerik.com/Libraries/Teodor_Bozhikov/HookToTimeSlotItemEvent_SL.sflb" title="http://blogs.telerik.com/Libraries/Teodor_Bozhikov/HookToTimeSlotItemEvent_SL.sflb" shape="rect">Here</a> is the example project including the above described implementation of RadScheduler, Listbox and RadDragAndDrop for Silverlight. For more info on how you can use and customize RadDragAndDrop and RadScheduler for Silverlight, refer to Telerik's <a href="http://demos.telerik.com/Silverlight/" title="http://demos.telerik.com/Silverlight/" shape="rect">online demos</a> and <a href="http://www.telerik.com/help/silverlight/introduction.html" title="http://www.telerik.com/help/silverlight/introduction.html" shape="rect">help</a>. <br /> <br /> Hope this will be of use! </p> http://blogs.telerik.com/SilverlightTeam/Posts/09-08-19/drag_and_drop_items_onto_radscheduler_for_silverlight.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/09-08-19/drag_and_drop_items_onto_radscheduler_for_silverlight.aspx b4a17644-47af-4f9d-a30a-bc4259a7de61 Wed, 19 Aug 2009 03:36:58 GMT Enhancing the Localization Support of RadControls for Silverlight and WPF <p>With the <a shape="rect" href="http://www.telerik.com/products/silverlight/whats-new/release-history/q1-2009-sp1-version-2009-1-413-1008212312.aspx" shape="rect"><span style="font-size: 13px; color: #2b393c;">Q1 2009 SP2</span></a> release of <a shape="rect" href="http://www.telerik.com/products/silverlight.aspx" title="The UI suite that brings LOB applications to the RIA world" shape="rect"><span style="font-size: 13px; color: #2b393c;">RadControls for Silverlight</span></a> we introduced an enhancement of the <span style="font-size: 13px;"><strong>LocalizationManager </strong>class</span>. Two new properties were added to enrich the localization support in the suite - <strong>DefaultCulture</strong> and <strong>DefaultResourceManager</strong>. With the new properties you no longer have to always create an instance of the LocalizationManager. Here is a brief description of the two properties:</p> <ul> <li><strong>DefaultCulture<br /> </strong>A static property of type <em>System.Globalization.CultureInfo</em>.<br /> Use this one to change localized values without changing the UI culture of the current thread. </li> <li><strong>DefaultResourceManager</strong><br /> A static property of type <em>System.Resources.ResourceManager</em>.<br /> Use this one to change localized values using a new resource manager, i.e. a new resource file. </li> </ul> <p><span style="text-decoration: underline;"><strong>Example:</strong></span></p> <p>The attached example demonstrates how <strong>LocalizationManager</strong>'s <strong>DefaultCulture</strong> and <strong>DefaultResourceManager</strong> properties work in conjunction with the thread's UI culture.</p> <p><a shape="rect" href="http://blogs.telerik.com/Libraries/Silverlight_team/Localization_for_WPF_RadGridView_example_20090530.sflb" shape="rect">Localization_for_WPF.RadGridView_example.20090530</a></p> <p><img width="826" height="605" alt="" src="http://blogs.telerik.com/Libraries/Silverlight_team/Localization_for_SL_and_WPF.sflb" complete="complete" /> </p> http://blogs.telerik.com/SilverlightTeam/Posts/09-05-30/enhancing_the_localization_support_of_radcontrols_for_silverlight_and_wpf.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/09-05-30/enhancing_the_localization_support_of_radcontrols_for_silverlight_and_wpf.aspx cf76ae98-043f-43ab-94a1-8029e1f9029f Sat, 30 May 2009 01:00:00 GMT Localization for RadControls for Silverlight and WPF <p>As we are continuously working on&nbsp;the localization of all our controls, we'd like to share how the localization is actually&nbsp;progressing at our side.</p> With the <a shape="rect" title="The UI suite that brings LOB applications to the RIA world" href="http://www.telerik.com/products/silverlight.aspx">RadControls for Silverlight</a> <a href="http://www.telerik.com/products/silverlight/whats-new/release-history/q1-2009-sp1-version-2009-1-413-1008212312.aspx">Q1 2009 SP1</a> we introduced the <strong>LocalizationManager</strong>. Actually we have used it to localize the <a shape="rect" title="Telerik RadUpload is a dedicated file-upload control. It allocates a minimum amount of server memory, while enabling optimized and fully configurable single and multi-file uploads." href="http://www.telerik.com/products/silverlight/upload.aspx">RadUpload </a>control for Silverlight. Now we have four more controls localized right from the box: <a shape="rect" title="RadTreeView for Silverlight" href="http://www.telerik.com/products/silverlight/treeview.aspx">RadTreeView</a>, <a shape="rect" title="RadMediaPlayer for Silverlight" href="http://www.telerik.com/products/silverlight/mediaplayer.aspx">RadMediaPlayer</a>, <a shape="rect" title="RadColorSelector for Silverlight" href="http://www.telerik.com/help/silverlight/colorselector-getting-started.html">RadColorSelector</a><strong> </strong>and <a shape="rect" title="RadColorPicker for Silverlight" href="http://www.telerik.com/products/silverlight/colorpicker.aspx">RadColorPicker</a>. In the attached example you can see them localized. Another control to be localized soon is the <a href="http://www.telerik.com/products/silverlight/gridview.aspx" title="RadGridView for Silverlight">RadGridView</a> control. The <strong>LocalizationManager</strong> allows you to easily localize any of our controls. In addition, we followed the practice to share the same code across Silverlight and WPF. Hence, once a control has been localized for Silverlight, the control's declaration can be reused in WPF. <p>&nbsp;</p> <p>To localize your own code you can either use resources or you can override the string loading process with your custom logic. Below is a snippet of the <strong>LocalizationManager </strong>declaration: </p> <div style="border: 1px solid #7f9db9; overflow: auto; line-height: 100% ! important; background-color: white; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; background-color: #ffffff; width: 99%; border-collapse: collapse;"> <colgroup><col style="border-bottom: 1px solid #f7f7f7; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: #0000ff;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #0000ff;">class</span><span style="font-size: 11px;">&nbsp;LocalizationManager&nbsp;</span><span style="color: #008000;">//&nbsp;Assembly:&nbsp;Telerik.Windows.Controls&nbsp;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">{&nbsp;&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #0000ff;">static</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #0000ff;">readonly</span><span style="font-size: 11px;">&nbsp;DependencyProperty&nbsp;ResourceKeyProperty;&nbsp;</span><span style="color: #008000;">//&nbsp;Attached&nbsp;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #0000ff;">static</span><span style="font-size: 11px;">&nbsp;LocalizationManager&nbsp;Manager;&nbsp;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">public</span><span style="font-size: 11px;">&nbsp;ResourceManager&nbsp;ResourceManager;&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">public</span><span style="font-size: 11px;">&nbsp;CultureInfo&nbsp;Culture;&nbsp;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #0000ff;">static</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #0000ff;">string</span><span style="font-size: 11px;">&nbsp;GetString(</span><span style="color: #0000ff;">string</span><span style="font-size: 11px;">&nbsp;key);&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #0000ff;">virtual</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #0000ff;">string</span><span style="font-size: 11px;">&nbsp;GetStringOverride(</span><span style="color: #0000ff;">string</span><span style="font-size: 11px;">&nbsp;key);&nbsp;&nbsp;</span></td> </tr> <tr> <td>}&nbsp;&nbsp;</td> </tr> </tbody> </table> </div> <p>&nbsp;</p> <p>To start the localization you should instantiate your manager and assign it to the <strong>LocalizationManager.Manager</strong> static property. This should happen before the creation of the <strong>UI</strong>, otherwise&nbsp;some parts&nbsp;might remain not-localized: <br /> &nbsp;</p> <div style="border: 1px solid #7f9db9; overflow: auto; line-height: 100% ! important; background-color: white; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; background-color: #ffffff; width: 99%; border-collapse: collapse;"> <colgroup><col style="border-bottom: 1px solid #f7f7f7; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: #0000ff;">public</span><span style="font-size: 11px;">&nbsp;partial&nbsp;</span><span style="color: #0000ff;">class</span><span style="font-size: 11px;">&nbsp;Page&nbsp;:&nbsp;UserControl&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">{&nbsp;&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">public</span><span style="font-size: 11px;">&nbsp;Page()&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LocalizationManager.Manager&nbsp;=&nbsp;<span style="color: #0000ff;">new</span><span style="font-size: 11px;">&nbsp;MyLocalizationManager();&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InitializeComponent();&nbsp;&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">}&nbsp;&nbsp;</td> </tr> </tbody> </table> </div> <p>&nbsp;</p> <p>Usually, you can store the strings in Resource files or in Your custom holder. </p> <ol> </ol> <span style="text-decoration: underline;"><strong>Using Resource files as string storage:</strong></span> <p>If you prefer this approach you should store the string in a resource file and enable <strong><em>ResXFileCodeGenerator </em></strong>(internal or public) for it. Then, you should instantiate the <strong><em>LocalizationManager </em></strong>object and set its <strong><em>ResourceManager </em></strong>property to your strings' resource manager - for example: </p> <div style="border: 1px solid #7f9db9; overflow: auto; line-height: 100% ! important; background-color: white; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; background-color: #ffffff; width: 99%; border-collapse: collapse;"> <colgroup><col style="border-bottom: 1px solid #f7f7f7; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;">LocalizationManager.Manager&nbsp;=&nbsp;</span><span style="color: #0000ff;">new</span><span style="font-size: 11px;">&nbsp;LocalizationManager()&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;ResourceManager&nbsp;=&nbsp;YourApplication.Strings.ResourceManager&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">};&nbsp;</td> </tr> </tbody> </table> </div> &nbsp; <p>Initialize the <strong><em>LocalizationManager.Manager</em></strong> property with this new object (as shown in the code above). Now you can create the application's <strong>UI</strong>.<br /> <br /> <em><span style="text-decoration: underline;">Note:</span></em><br /> If you rely on culture settings to load the right resource value, you have to write some code inside your application's project file. For example, if you have to support <strong>English</strong>, <strong>German </strong>and <strong>Japanese </strong>strings, you can store the localized strings in <strong><em>strings.resx</em></strong>, <strong><em>strings.de.resx</em></strong> and <strong><em>strings.ja.resx</em></strong> files. For the&nbsp;<strong><em>strings.resx</em></strong> file you can set <strong><em>ResXFileCodeGenerator </em></strong>(<em><strong>internal </strong></em>or <em><strong>public</strong></em>) and for others set <strong><em>No code generation</em></strong>. Then, you can open the project file in a <em><strong>text-mode</strong></em> and append the code below to notify the framework about the supported cultures:</p> <p>&nbsp; &nbsp;&nbsp;&lt;SupportedCultures&gt;en;de;ja&lt;/SupportedCultures&gt; </p> <p>Now you can rely on the <strong>UI </strong>culture or you can set the localization manager's <strong>Culture </strong>property: </p> <p>&nbsp; &nbsp;&nbsp;myLocalizationManager.Culture = new CultureInfo("de"); </p> <p>&nbsp;</p> <p><span style="text-decoration: underline;"><strong>Using custom string storage:</strong></span><br /> <br /> Another approach is to implement your own storage for the localized strings (i.e. a database). In this case you should inherit the <strong><em>LocalizationManager </em></strong>class and override its <strong><em>GetStringOverride</em> </strong>method. Here is the starting frame of the code:</p> <div style="border: 1px solid #7f9db9; overflow: auto; line-height: 100% ! important; background-color: white; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; background-color: #ffffff; width: 99%; border-collapse: collapse;"> <colgroup><col style="border-bottom: 1px solid #f7f7f7; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: #0000ff;">using</span><span style="font-size: 11px;">&nbsp;Telerik.Windows.Controls;&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;</td> </tr> <tr> <td><span style="color: #0000ff;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #0000ff;">class</span><span style="font-size: 11px;">&nbsp;MyLocalizationManager&nbsp;:&nbsp;LocalizationManager&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">{&nbsp;&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #0000ff;">override</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #0000ff;">string</span><span style="font-size: 11px;">&nbsp;GetStringOverride(</span><span style="color: #0000ff;">string</span><span style="font-size: 11px;">&nbsp;key)&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000;">//&nbsp;...&nbsp;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000;">//&nbsp;Your&nbsp;code&nbsp;here&nbsp;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000;">//&nbsp;...&nbsp;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">return</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #0000ff;">base</span><span style="font-size: 11px;">.GetStringOverride(key);&nbsp;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">}&nbsp;&nbsp;</td> </tr> </tbody> </table> </div> &nbsp; <p>Finally, you should instantiate your manager and assign it to the <strong>LocalizationManager.Manager</strong> static property:</p> <div style="border: 1px solid #7f9db9; overflow: auto; line-height: 100% ! important; background-color: white; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; background-color: #ffffff; width: 99%; border-collapse: collapse;"> <colgroup><col style="border-bottom: 1px solid #f7f7f7; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: #0000ff;">public</span><span style="font-size: 11px;">&nbsp;partial&nbsp;</span><span style="color: #0000ff;">class</span><span style="font-size: 11px;">&nbsp;Page&nbsp;:&nbsp;UserControl&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">{&nbsp;&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">public</span><span style="font-size: 11px;">&nbsp;Page()&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LocalizationManager.Manager&nbsp;=&nbsp;<span style="color: #0000ff;">new</span><span style="font-size: 11px;">&nbsp;MyLocalizationManager();&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InitializeComponent();&nbsp;&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">}&nbsp;</td> </tr> </tbody> </table> </div> <p> </p> <p> </p> <p>&nbsp;</p> <p>Below are some code-snippets demonstrating the localization with the <strong>LocalizationManager</strong>.</p> <br /> <p><strong><span style="text-decoration: underline;">Inside XAML code:</span></strong></p> <p>Separately from the instantiated <strong>LocalizationManager</strong>,<strong> </strong>in your <strong>XAML </strong>code you can use the <strong>LocalizationManager.ResourceKey</strong> attached property to initialize your controls. For example, if you want to localize a button on your page, you can use the following code:</p> <div style="border: 1px solid #7f9db9; overflow: auto; line-height: 100% ! important; background-color: white; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; background-color: #ffffff; width: 99%; border-collapse: collapse;"> <colgroup><col style="border-bottom: 1px solid #f7f7f7; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;">xmlns:</span><span style="color: #ff0000;">telerik</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">...&nbsp;</td> </tr> <tr> <td><span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">Button&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">Content</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"Default&nbsp;value"</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;telerik:<span style="color: #ff0000;">LocalizationManager.ResourceKey</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"MyButtonContentKey"</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: #0000ff;">/&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> </tbody> </table> </div> <p>&nbsp;</p> <span style="text-decoration: underline;"><strong>In the Code-Behind:</strong></span><br /> <p> <br /> In the code-behind, you can use the <strong>LocalizationManager</strong>'s<strong> GetString </strong>static method, or, if you have instantiated a <strong>LocalizationManager </strong>object, you can use its <strong>GetStringOverride </strong>method, like: </p> <div style="border: 1px solid #7f9db9; overflow: auto; line-height: 100% ! important; background-color: white; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; background-color: #ffffff; width: 99%; border-collapse: collapse;"> <colgroup><col style="border-bottom: 1px solid #f7f7f7; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: #008000;">//&nbsp;Loading&nbsp;localized&nbsp;data:</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: #0000ff;">string</span><span style="font-size: 11px;">&nbsp;localizedData&nbsp;=&nbsp;LocalizationManager.GetString(key);&nbsp;</span></td> </tr> <tr> <td>&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: #008000;">//&nbsp;Constructing&nbsp;a&nbsp;custom&nbsp;localizer&nbsp;and&nbsp;load&nbsp;from&nbsp;it:</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>MyLocalizationManager&nbsp;locMan&nbsp;=&nbsp;<span style="color: #0000ff;">new</span><span style="font-size: 11px;">&nbsp;MyLocalizationManager();&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: #0000ff;">string</span><span style="font-size: 11px;">&nbsp;localizedData&nbsp;=&nbsp;locMan.GetStringOverride(key);&nbsp;</span></td> </tr> <tr> <td>&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: #008000;">//&nbsp;Same&nbsp;as the localization&nbsp;in&nbsp;XAML shown&nbsp;above:</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>TextBlock&nbsp;textBlock&nbsp;=&nbsp;<span style="color: #0000ff;">new</span><span style="font-size: 11px;">&nbsp;TextBlock()&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">LocalizationManager.SetResourceKey(textBlock,&nbsp;key);&nbsp;</td> </tr> </tbody> </table> </div> <p>&nbsp;</p> <p>The <strong>SetResourceKey</strong> method triggers the <strong>OnResourceKeyChanged </strong>method where a type-oriented initialization occurs. For the time being, we have implemented initialization for the following types:</p> <ul> <li><strong>TextBlock </strong>- the <strong>Text </strong>property is initialized; </li> <li><strong>Button </strong>- the <strong>Content </strong>property is initialized; </li> <li><strong>ContentControl </strong>- the <strong>Content </strong>property is initialized; </li> <li><strong>ContentPresenter </strong>- the <strong>Content </strong>property is initialized; </li> <li><strong>ILocalizable </strong>- <strong>ILocalizable.SetString</strong> is used; </li> </ul> Note: the <strong>ILocalizable </strong>interface exposes the <strong>SetString</strong> method. If you need some specific initialization in your custom control you should implement this interface and the <strong>LocalizationManager</strong> will take care to invoke the <strong>SetString</strong> method.<strong> <p>&nbsp;</p> </strong> <span style="text-decoration: underline;"><strong>Example:</strong></span><br /> <br /> Attached, you can find two examples where <strong>LocalizationManager </strong>and localized RadControls are demonstrated.<br /> <p>&nbsp;<a href="http://blogs.telerik.com/Libraries/Silverlight_team/Localization_SL_example_20090512.sflb">Localization_SL_example.20090512.zip</a>,<br /> &nbsp;<a shape="rect" href="http://blogs.telerik.com/Libraries/Silverlight_team/Localization_WPF_example_20090512.sflb">Localization_WPF_example.20090512</a>,<br /> &nbsp;<a href="http://blogs.telerik.com/Libraries/Silverlight_team/Localization_for_SL_RadGridView_20090513.sflb">Localization_for_SL.RadGridView.20090513.zip</a>,<br /> &nbsp;<a href="http://blogs.telerik.com/Libraries/Silverlight_team/Localization_for_WPF_RadGridView_20090513.sflb">Localization_for_WPF.RadGridView.20090513.zip</a>. </p> <p> </p> http://blogs.telerik.com/SilverlightTeam/Posts/09-05-13/localization_for_radcontrols_for_silverlight_and_wpf.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/09-05-13/localization_for_radcontrols_for_silverlight_and_wpf.aspx 95fe2174-5bb5-4fbf-b9fa-04a866fc7337 Wed, 13 May 2009 01:00:00 GMT Telerik announces the RadToolBar for Silverlight. <p>With the upcoming Q1 release Telerik will include an official version of the <strong>RadToolBar</strong> control in the <a href="http://www.telerik.com/silverlight" title="Silverlight UI Controls"><strong>RadControls for Silverlight</strong></a> bundle. RadToolBar will mimic the functionalities and behavior of the VS toolbar with its Strip and Overflow areas.  All the items in the toolbar will jump between the strip and the overflow depending on the toolbar’s size. In addition, the developer will be able to stick items into one of these areas using a single property  - <strong>OverflowMode</strong>.</p> <p>RadToolBar will also support Style Selector for item containers. We pre-defined styles for many of the regular controls – button, textbox , combobox and expander.</p> <p>Along with the <strong>RadToolBar</strong> control a <strong>RadToolBarTray</strong> is also coming with Q1 to let you handle multiple toolbars in the same tray. RadToolBarTray will be a container control that will handle the position, the sizing and the order of toolbars inside it. Virtually, the tray will be divided by Bands, where each Band will contain multiple toolbars. The developer will be able to arrange the toolbars by simply initializing the <strong>Band</strong> and <strong>BandIndex</strong> properties.</p> <p> <img width="632" height="121" alt="" src="/Libraries/Silverlight_team/sample_editor_1.sflb" /></p> <p> </p> <p><img width="417" height="99" alt="" src="/Libraries/Silverlight_team/sample_editor_2.sflb" /></p> <p> </p> <p>We are currently working on two new major features like: “Drag and Drop” and “Vertical Orientation”.<br /> We will greatly appreciate your feedback on what features you would like to see in the the RadToolBar control. This is always the best way to ensure our products keep getting better.</p> http://blogs.telerik.com/SilverlightTeam/Posts/09-02-13/telerik_announces_the_radtoolbar_for_silverlight.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/09-02-13/telerik_announces_the_radtoolbar_for_silverlight.aspx 32bd325e-1148-4a74-ac0b-4d43a5b0708d Fri, 13 Feb 2009 08:56:46 GMT Announcing RadEditor for Silverlight CTP <p><img width="789" height="226" alt="" src="/Libraries/Nikolay_Atanasov/editor_screenshot.sflb" /></p> <p>We are very excited  to announce that our Q1 release will feature a CTP edition of <strong>Telerik RadEditor for </strong><a href="http://www.telerik.com/silverlight">Silverlight</a>. This initial version will support the most basic set of features but you can rest assured that there is a lot more cooking. RadEditor integrates three of our new controls for Silverlight – <a href="http://blogs.telerik.com/blogs/09-02-13/Telerik_announces_the_RadToolBar_for_Silverlight.aspx">RadToolbar, RadToobarTray</a> and <a href="http://blogs.telerik.com/boryanamiloshevska/posts/09-02-10/RadColorPicker_for_Silverlight.aspx">RadColorPicker</a>. The first two will give you fine-grained control over the positioning of the elements you choose to insert in your editor. The customizable <a href="http://blogs.telerik.com/boryanamiloshevska/posts/09-02-10/RadColorPicker_for_Silverlight.aspx">RadColorPicker</a> is used for choosing font and highlight colors and offers a well-known tool to end-users. Below you can find a non-exhaustive list of the initially supported text-formatting features:</p> <ul> <li>Undo </li> <li>Redo </li> <li>Insert Hyperlink </li> <li>Insert Image </li> <li>Insert Horizontal Rule </li> <li>Indent </li> <li>Outdent </li> <li>Bold </li> <li>Italic </li> <li>Underline </li> <li>Justify Left </li> <li>Justify Center </li> <li>Justify Right </li> <li>Justify Full </li> <li>Ordered List </li> <li>Unordered List </li> <li>Superscript </li> <li>Subscript </li> <li>Strikethrough </li> <li>Font Size </li> <li>Font Family </li> <li>Font Color </li> <li>Highlight Color </li> </ul> <br /> <p>API-wise you will be able to manipulate the text in the editor via the exposed methods used internally by the toolbar elements. Getting and setting the selected text, events for changes in the text, etc. will all be available for you to use, of course, enabling you to make the best out of the control. In case we missed something you consider important, please let us know and we’ll do our best to include it in the future versions of RadEditor. We highly value your feedback, so please let us know what you think about RadEditor and the scenarios in which you might want to use it.</p> http://blogs.telerik.com/SilverlightTeam/Posts/09-02-10/announcing_radeditor_for_silverlight_ctp.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/09-02-10/announcing_radeditor_for_silverlight_ctp.aspx 7d10ef26-8a22-4543-8e9b-588779fdd318 Tue, 10 Feb 2009 06:39:27 GMT RadControls for Silverlight 2.0 World Premier Webcast <font><font>Join </font><a class="" href="http://telerik.com/"><font>Telerik</font></a><font> Chief Technical Evangelist Todd Anglin as he introduces you to Telerik's brand new suite of components for Microsoft's Silverlight 2.0. This is the first time the RadControls for Silverlight 2.0 have ever been shown in public, so don't miss your opportunity to be among the first to see what Telerik is doing in the Silverlight space.&nbsp;&nbsp;Anyone considering Silverlight development in 2008 should attend this event to learn how leading .NET UI component vendor Telerik is going to make it easy to develop professional applications on this brand new framework with very little code.<br><br>The webcast will be on </font><font><strong><font>Friday, December 14, 2007 3:00 PM - 3:30 PM EST<br></font></strong><br>Registration is free, space is limited&nbsp;- follow this web address:<br></font><a href="https://www1.gotomeeting.com/register/490004761"><font>https://www1.gotomeeting.com/register/490004761</font></a><br><br><font>PS: For those of you who can not participate in the live online webcast - a video will be available later on our website (</font><a href="http://www.telerik.com/"><font>www.telerik.com</font></a><font>)&nbsp;- so stay tuned.</font></font> http://blogs.telerik.com/SilverlightTeam/Posts/07-12-11/radcontrols_for_silverlight_2_0_world_premier_webcast.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/07-12-11/radcontrols_for_silverlight_2_0_world_premier_webcast.aspx abf5e2ac-9aa7-4ace-a33e-633921bb808b Tue, 11 Dec 2007 23:51:00 GMT The Minesweeper Game Done in Silverlight 1.1 <p><b><b></b><b></b>Silverlight is a Blast!</b></p> <p>And instead of trying to convince you, we present you a well-known game in its <i>silverlit</i> clothes. The minesweeper! It adds to other games that in the past several weeks have shown the ease with which you can use Silverlight to create online interaction and games. It uses no fancy frameworks but underlines the simplicity and straightforwardness of Silverlight development. <br></p> <p></p> <p></p> <p>The number of mines and the rows/columns are configurable. To mark a mine - instead&nbsp;to click with the right mouse button,&nbsp;click with the left&nbsp;mouse button while holding the CTRL or SHIFT key.<a href="http://blogs.telerik.com/demos/minesweeper/"><br><br><strong><img src="http://blogs.telerik.com/photos/storage/minesweeper.jpg"></strong></a><br><strong>Try the game:</strong></p> <div><a href="http://blogs.telerik.com/demos/minesweeper/"> <div>http://blogs.telerik.com/demos/minesweeper/ <br></a><b><br>Get the code here:</b></div></div> <p><a href="http://blogs.telerik.com/files/MinefieldSource.zip">The Minefield Project</a></p> <p><b>Concepts presented:</b></p> <p>- Controls in ver. 1.1: Control creation and reusing.</p> <p>- Storyboards: Animations and reversing storyboards.</p> <p>- Auto-Finding: Harness the power of reflection and forget about XAML to fields binding.</p> <p>- Event Handling: Mouse and custom events galore!</p> <p>- Function call delay: A simple call delay that fits in nicely wherever it is needed.<br><br>Enjoy!</p> http://blogs.telerik.com/SilverlightTeam/Posts/07-11-08/the_minesweeper_game_done_in_silverlight_1_1.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/07-11-08/the_minesweeper_game_done_in_silverlight_1_1.aspx b3b3559a-6c29-46d5-ab74-2a6e00e52900 Thu, 08 Nov 2007 16:44:00 GMT Shortcut on Silverlight 1.1 <p>Here at Telerik we are constantly working with the new cutting edge technologies. As <a href="http://silverlight.net/">Silverlight</a> 1.1 alpha hit the road we were keen to research all the new things we can do with this new technology ... <br></p> <p><a href="http://www.oreilly.com/catalog/9780596515836/"><img src="http://www.oreilly.com/catalog/covers/9780596515836_cat.gif"></a></p> <p>But there was one little problem - the lack of help and documentation. Our experience with WPF help us a lot to get into the new technology, but Silverlight is a new platform and it has its differences from WPF.</p> <p>So when we were contacted by the O'Reilly to write a book for Silverlight 1.1 we decided that this will be a very good opportunity for us, and we will be able to help a lot of people which want to get faster into this new&nbsp;Silverlight platform.</p> <p>The result - this more than 70 pages shortcut, will help you to get started with Silvelight. It explains the main concepts behind Silverlight - working with XAML, animations, web services and ofcourse, there is a step by step example about how to create your own custom control. Here is the short table of contents:</p> <ol> <li>Understanding Silverlight 1.1</li> <li>What is Silverlight 1.1?</li> <li>An overview of RIA</li> <li>Working with Silverlight 1.1</li> <li>Building applications and custom controls with Silverlight 1.1</li> <li>Online resources</li></ol> <p>you can purchase and download the book from the <a href="http://www.oreilly.com/catalog/9780596515836/#details">O'Reilly online catalog</a>.</p> <p>Thanks to <a href="http://adamkinney.com/">Adam Kinney</a> and <a href="http://silverlight.net/blogs/jesseliberty/">Jessy Liberty</a> from Microsoft - they helped us a lot with polishing everything out.<br><br>I hope you will enjoy reading the book - let us know what do you think about it.</p> http://blogs.telerik.com/SilverlightTeam/Posts/07-10-16/shortcut_on_silverlight_1_1.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/07-10-16/shortcut_on_silverlight_1_1.aspx 1e4df114-8301-450d-9641-35ef72b864e3 Tue, 16 Oct 2007 19:30:00 GMT Silverlight Game for Q2 Release While working on the second release for 2007, <a href="http://www.telerik.com">Telerik </a>decided to surprise its clients by creating a <a href="http://www.telerik.com/game">Silverlight game</a>.<br>The idea was simple. A registered user enters his or her weight and logs in. This weight contributes to the common goal which is to lift what is on the other side of the rope.<br><a href="http://blogs.telerik.com/photos/storage/SiverlightBlogPostImages/gameFront_large.jpg"><img src="http://blogs.telerik.com/photos/storage/SiverlightBlogPostImages/gameFront_small.jpg"></a>&nbsp;<a href="http://blogs.telerik.com/photos/storage/SiverlightBlogPostImages/ramp_large.jpg"><img src="http://blogs.telerik.com/photos/storage/SiverlightBlogPostImages/ramp_small.jpg"></a>&nbsp;<a href="http://blogs.telerik.com/photos/storage/SiverlightBlogPostImages/labs_large.jpg"><img src="http://blogs.telerik.com/photos/storage/SiverlightBlogPostImages/labs_small.jpg"></a><br>The game&nbsp;was developed using <a href="http://www.microsoft.com/silverlight/license-win-dev.aspx">Silverlight 1.1 Alpha Refresh</a>. <br>We had couple of concerns while developing it, though. First of all we did not know how many people have already installed the 1.1 plug-in. Also we were not sure if the current game was going to reach the popularity of the last. At the end, however, it proved that Silverlight has been adopted by quite few people. <br><br>One very important decision we needed to make was how to represent a single user from the database - using a XAML object or a .png image. After some tests and research we decided to stick with the .png image. The reason is because 3000+ XAML elements were taking over 260MB of RAM, while using .png images made the memory consumation to drop to the acceptable 37MB.<br><br>After finding solution to the above problem, the rest was quite easy. We developed few user controls(button, person, tooltip) which accelerated the development extremely. The main disadvantage which we found afterwards was a problem with the caching mechanism(same as flash/flex). When the user loads the game for the first time he or she downloads the .dll file locally and on the second visit, the caching mechanism of the browser reuses the local .dll. In order to get the new .dll you need to clear the cache of the browser(alternatively you can hold SHIFT key and press the Refresh button of the browser). http://blogs.telerik.com/SilverlightTeam/Posts/07-09-17/silverlight_game_for_q2_release.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/07-09-17/silverlight_game_for_q2_release.aspx 12571f1d-8288-471a-90a1-09f4cb201993 Mon, 17 Sep 2007 19:38:00 GMT How to Change the Silverlight Installation Message <strong>NOTE: From the very beginning I would like to state that this custom solution is temporary and will most probably change with the next release of Silverlight Plug-In. </strong><br>There is no straightforward approach to changing the Silverlight Download logo. <br><img src="http://blogs.telerik.com/photos/storage/SiverlightBlogPostImages/silverlightLogo.png"><br>However, a workaround exists. <br><br>1) Download the modified <a href="http://blogs.telerik.com/files/SilverlightTeam/TelerikSilverlight.zip">TelerikSilverlight.js </a>and add it to your project <br><br><img src="http://blogs.telerik.com/photos/storage/SiverlightBlogPostImages/solWindow.png"><br><br>2) Within the Default.aspx of your project, reference TelerikSilverlight.js&nbsp;<br><br><font face="Courier New">&lt;script type="text/javascript" src="TelerikSilverlight.js"&gt;&lt;/script&gt;</font> <br><br>3) Create a javascript function right bellow the previous line of code <br><br><font face="Courier New">&lt;script type="text/javascript"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;function GetInstallHtml ()<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var imgUrl = "</font><a href="http://www.telerik.com/images/editor/OverviewImages/SilverlightLogo.gif"><font face="Courier New">http://www.telerik.com/images/editor/OverviewImages/SilverlightLogo.gif</font></a><font face="Courier New">";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var myInstallHtml = 'This is my custom text&lt;br/&gt;' +&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'&lt;div style="width: 205px; height: 67px; background-color: #FFFFFF"&gt;' +&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'&lt;img onclick="javascript:Silverlight.followFWLink({0});"' +&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'style="border:0; cursor:pointer" src="' + imgUrl + '"' +&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'alt="Get Microsoft Silverlight"/&gt;&lt;br/&gt;' +<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'This is my custom &lt;a href="javascript:Silverlight.followFWLink({0});"&gt;link&lt;/a&gt;.' +<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'&lt;/div&gt;'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return myInstallHtml;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&lt;/script&gt;<br></font><br><img src="http://blogs.telerik.com/photos/storage/SiverlightBlogPostImages/finalResult.png"><br><br><br>Resources: <br><a href="http://blogs.telerik.com/files/SilverlightTeam/DefaultPage.zip">Sample Default.aspx</a><br><a href="http://blogs.telerik.com/files/SilverlightTeam/TelerikSilverlight.zip">TelerikSilverlight.zip </a><br><br> http://blogs.telerik.com/SilverlightTeam/Posts/07-09-09/how_to_change_the_silverlight_installation_message.aspx Silverlight Team http://blogs.telerik.com/SilverlightTeam/Posts/07-09-09/how_to_change_the_silverlight_installation_message.aspx b5546dbc-b0ab-4e81-bc76-0efa3d1ec68d Sun, 09 Sep 2007 16:40:00 GMT