|
using System;
using System.Windows;
using System.Windows.Browser;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using JustinAngelNet.SilverlightRTL.RTL;
namespace SilverlightRTL.QuickStart
{
[Scriptable]
public partial class RTLExtenderPage : Canvas
{
public RTLExtenderPage()
{
this.Loaded += new EventHandler(RTLExtender_Loaded);
}
public void btn1_MouseLeftButtonDown(object sender, MouseEventArgs e)
{
Timeline1.Stop();
Timeline1.Begin();
}
void RTLExtender_Loaded(object sender, EventArgs e)
{
InitializeComponent();
WebApplication.Current.RegisterScriptableObject("page", this);
}
[Scriptable]
public void SetTextBlockText(string text)
{
foreach (TextBlock key in RTLExtender.RTLTextBlockForNonRTLTextBlock.Keys)
{
if (key.Name == "tbx4")
{
foreach (TextBlock block in RTLExtender.RTLTextBlockForNonRTLTextBlock[key])
{
this.Children.Remove(block);
}
}
}
TextBlock originalTextBlock = (TextBlock)XamlReader.Load(@"<TextBlock xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" Width=""540.5"" Height=""475"" Canvas.Left=""31"" Canvas.Top=""68"" TextWrapping=""Wrap"" x:Name=""tbx4"" FontFamily=""Courier New"" FontSize=""13"" FontWeight=""Bold"" />");
originalTextBlock.Text = text.Replace("\r\n", "\r");
this.Children.Add(originalTextBlock);
RTLExtender rtlExtenderOnPage = (RTLExtender)FindName("rtlExtender");
rtlExtenderOnPage.RTLTextBlock(originalTextBlock);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Justin-Josef Angel is a C# Microsoft Most Valuable professional, a Senior .Net consultant in Israel with 4 years of .Net experience and has 8 years of Web experience.
Justin's been working this past year on two Enterprise sized Silverlight projects with his customers. During that time he's gained a real-insight into Silverlight's inner workings and how to integrate Silverlight into the real world of software development. Additionally, During that time he's developed a few well-known projects like the "Silverlight 1.0 Javascript Intellisense", "Silverlight 1.1 Hebrew & Arabic Languages support" and a few others you might know.
Justin is also a seasoned presenter with an impressive track-record of talking in front of thousands of people in Israel.
Justin owns the first .Net blog written in Hebrew -
http://www.JustinAngel.Net .
And he also owns an additional blog with mixed Hebrew & English content -
http://blogs.Microsoft.co.il/blogs/JustinAngel.
A full list of his articles (all 100+ of them) can be found at:
http://www.JustinAngel.Net/#index