Click here to Skip to main content
15,889,200 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: WPF event manager Pin
Pete O'Hanlon9-Aug-11 22:40
mvePete O'Hanlon9-Aug-11 22:40 
QuestionDirectory.GetAccessControl Fails in XBAP web client Pin
pal2ashish9-Aug-11 20:21
pal2ashish9-Aug-11 20:21 
QuestionSo, is binding to private / internal properties allowed or not? Pin
SledgeHammer019-Aug-11 6:31
SledgeHammer019-Aug-11 6:31 
AnswerRe: So, is binding to private / internal properties allowed or not? Pin
Mycroft Holmes9-Aug-11 13:09
professionalMycroft Holmes9-Aug-11 13:09 
GeneralRe: So, is binding to private / internal properties allowed or not? Pin
SledgeHammer019-Aug-11 14:03
SledgeHammer019-Aug-11 14:03 
JokeRe: So, is binding to private / internal properties allowed or not? Pin
Mycroft Holmes9-Aug-11 14:19
professionalMycroft Holmes9-Aug-11 14:19 
QuestionRich text Box Content into Outlook mail Pin
Narender Singh Thakur8-Aug-11 4:27
Narender Singh Thakur8-Aug-11 4:27 
AnswerRe: Rich text Box Content into Outlook mail Pin
Pete O'Hanlon8-Aug-11 4:45
mvePete O'Hanlon8-Aug-11 4:45 
The issue you see here is that the WPF RichTextBox is unlike any MS RichTextBox released before it. It doesn't actually support RTF directly, so you need to perform a little trick which is to use the TextRange and save to a MemoryStream. Here's a couple of handly little extension methods you can use:
C#
public static string FormattedSave(this RichTextBox rtb)
{
  return FormattedSave(rtb, System.Windows.DataFormats.Rtf);
}
public static string FormattedSave(this RichTextBox rtb, System.Windows.DataFormat dataFormat)
{
  TextRange range = new TextRange(rtb.Document.ContentStart, rtb.Document.ContentEnd);
  using (MemoryStream ms = new MemoryStream())
  {
    range.Save(ms, dataFormat);
    string retVal = ASCIIEncoding.Default.GetString(ms.ToArray());
    ms.Close();
    return retVal;
  }
}

Forgive your enemies - it messes with their heads


My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


GeneralRe: Rich text Box Content into Outlook mail Pin
Narender Singh Thakur8-Aug-11 5:13
Narender Singh Thakur8-Aug-11 5:13 
GeneralRe: Rich text Box Content into Outlook mail Pin
Pete O'Hanlon8-Aug-11 5:22
mvePete O'Hanlon8-Aug-11 5:22 
GeneralRe: Rich text Box Content into Outlook mail Pin
Narender Singh Thakur8-Aug-11 5:24
Narender Singh Thakur8-Aug-11 5:24 
QuestionUpdate TreeView's ItemsSource during runtime Pin
Mc_Topaz8-Aug-11 4:05
Mc_Topaz8-Aug-11 4:05 
AnswerRe: Update TreeView's ItemsSource during runtime Pin
Pete O'Hanlon8-Aug-11 4:26
mvePete O'Hanlon8-Aug-11 4:26 
GeneralRe: Update TreeView's ItemsSource during runtime Pin
Mc_Topaz8-Aug-11 5:02
Mc_Topaz8-Aug-11 5:02 
GeneralRe: Update TreeView's ItemsSource during runtime [modified] Pin
SledgeHammer018-Aug-11 6:17
SledgeHammer018-Aug-11 6:17 
GeneralRe: Update TreeView's ItemsSource during runtime Pin
Mc_Topaz8-Aug-11 21:54
Mc_Topaz8-Aug-11 21:54 
Questioncolumns are empty Pin
picasso26-Aug-11 11:18
picasso26-Aug-11 11:18 
QuestionService Model Pin
mehrdadc486-Aug-11 2:17
mehrdadc486-Aug-11 2:17 
AnswerRe: Service Model Pin
Mycroft Holmes6-Aug-11 2:50
professionalMycroft Holmes6-Aug-11 2:50 
AnswerRe: Service Model Pin
Simon Bang Terkildsen8-Aug-11 1:05
Simon Bang Terkildsen8-Aug-11 1:05 
GeneralRe: Service Model Pin
Mycroft Holmes8-Aug-11 1:31
professionalMycroft Holmes8-Aug-11 1:31 
GeneralRe: Service Model Pin
Simon Bang Terkildsen8-Aug-11 1:46
Simon Bang Terkildsen8-Aug-11 1:46 
QuestionSilverlight and SmartCards Pin
#realJSOP6-Aug-11 1:59
mve#realJSOP6-Aug-11 1:59 
AnswerRe: Silverlight and SmartCards Pin
Mycroft Holmes6-Aug-11 2:47
professionalMycroft Holmes6-Aug-11 2:47 
QuestionBuild TreeViewItem dynamically [modified] Pin
McCombi5-Aug-11 1:19
McCombi5-Aug-11 1:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.