The RichTextArea Control
This new Silverlight 4 only control allows you to input RichText into your Silverlight application. Here is a simple example of its use, complete with some simple formatting commands.
We have created an enhanced version of the RichTextArea control which enables you to Load and Save the content as basic HTML. This control is available to download with all the source code here.
You need to login to Download the example, If you do not have a login you can register for free!
Here we show how to format text using the basic formatting commands such as Bold, Italic and Underline as well as Font Family and Size.
tmdavis83 wrote:
I have a string of text that is actually a RTF document. I can't seem to get it to display as one. It only displays as the raw text of the RTF document. How do i change that?
dharmbhav wrote:
Woopie, sorry for my delayed response.
I did the following:
public BaseFloatingWindow(IRegionManager regionManager, IEventAggregator eventAggregator)
{
this.regionManager = regionManager;
InitializeComponent();
RegionManager.SetRegionManager(this, regionManager);
this.eventAggregator = eventAggregator;
closeWindowEvent = eventAggregator.GetEvent<CloseWindowEvent>();
closeWindowEvent.Subscribe(SubscribeToCloseEvent, true);
this.Closed+=new EventHandler(BaseFloatingWindow_Closed);
}
public void BaseFloatingWindow_Closed(object sender, EventArgs e)
{
foreach (object view in this.regionManager.Regions[regionName].Views)
{
if (((UserControl)view).DataContext is ViewModelBase)
{
((ViewModelBase)((UserControl)view).DataContext).KeepAlive = false;
}
regionManager.Regions[regionName].Remove(view);
}
Dispose();
}
private void SubscribeToCloseEvent(object obj)
{
if (regionName == obj.ToString())
{
closeWindowEvent.Unsubscribe(SubscribeToCloseEvent);
this.Close();
BaseFloatingWindow_Closed(new object(), new EventArgs());
}
}
Hope this helps.
Woopie wrote:
I found the bug in the latest version too.
@dharmbhav hopefully you get this but can you advise on the binding for MVVM please...
Thanks for the good library
dharmbhav wrote:
There seems to be an issue with v 5.3.3 of RichTextEditor. I wanted to use it in my Prism based MVVM application (with a little bit tweaking for Databinding) and it threw an object reference null exception. With v 5.2.7 it works fine now.
Sadly you havn't uploaded source code for v5.2.7 controls.
A good library though,
Thanks
hussam wrote:
How to Databind RichTextEditor?
paweb wrote:
How to implement superscript in RichTextBox but in web application ?
Guide the car to its parking space in this fun Car Parking game.
Aim for the Trash Can and get the various items of Trash in the bin.
Fly your plane in this colorful vertical scrolling shoot-em-up. Blast the bad guys and collect any bonus's they leave behind.
Pop as many bubbles as possible in this fun and colorful bubble popping game. The levels start off easy enough but gradually get harder!
Here we have a bunch of monsters that need to be matched up. Look out for the bomb and spinning monsters that will cause special damage!
Guide your friendly Bird through the maze of pipes and other obstacles collecting the Stars in this cool arcade game inspired by the legendary Flappy Bird.
You are stranded on an Alien planet. Your goal is to build a space rocket and escape. Start by building units to create power and mine the metal patches. Build defenses to defend your base from the advancing Aliens and Zombies!
Play Pool against the computer or battle against your friends in the online mode!
Slice the fruit that is thrown up onto the screen. Slice the fruit into multiple pieces for maximum points!
tmdavis83 wrote:
I have a string of text that is actually a RTF document. I can't seem to get it to display as one. It only displays as the raw text of the RTF document. How do i change that?
dharmbhav wrote:
Woopie, sorry for my delayed response.
I did the following:
public BaseFloatingWindow(IRegionManager regionManager, IEventAggregator eventAggregator)
{
this.regionManager = regionManager;
InitializeComponent();
RegionManager.SetRegionManager(this, regionManager);
this.eventAggregator = eventAggregator;
closeWindowEvent = eventAggregator.GetEvent<CloseWindowEvent>();
closeWindowEvent.Subscribe(SubscribeToCloseEvent, true);
this.Closed+=new EventHandler(BaseFloatingWindow_Closed);
}
public void BaseFloatingWindow_Closed(object sender, EventArgs e)
{
foreach (object view in this.regionManager.Regions[regionName].Views)
{
if (((UserControl)view).DataContext is ViewModelBase)
{
((ViewModelBase)((UserControl)view).DataContext).KeepAlive = false;
}
regionManager.Regions[regionName].Remove(view);
}
Dispose();
}
private void SubscribeToCloseEvent(object obj)
{
if (regionName == obj.ToString())
{
closeWindowEvent.Unsubscribe(SubscribeToCloseEvent);
this.Close();
BaseFloatingWindow_Closed(new object(), new EventArgs());
}
}
Hope this helps.
Woopie wrote:
I found the bug in the latest version too.
@dharmbhav hopefully you get this but can you advise on the binding for MVVM please...
Thanks for the good library
dharmbhav wrote:
There seems to be an issue with v 5.3.3 of RichTextEditor. I wanted to use it in my Prism based MVVM application (with a little bit tweaking for Databinding) and it threw an object reference null exception. With v 5.2.7 it works fine now.
Sadly you havn't uploaded source code for v5.2.7 controls.
A good library though,
Thanks
hussam wrote:
How to Databind RichTextEditor?
paweb wrote:
How to implement superscript in RichTextBox but in web application ?