Visual Studio 2008 is Out!

Nice. I’m so happy. Our product is RTM now!!! Yes!!!!!! :))


Optimizing WPF 3D scenes for Tier-2 Hardware (roughly Pixel Shader 2.0+)

I just found this very nice blog entry with hints for WPF 3D Summary of the hints that I found more interesting/not common: 1. Set Viewport3D.IsHitTestVisible to false. It’s true by default, which means that hit testing for 3D content is performed on mouse over. 2. GeometryModel3D – prefer using a single large model rather…


Converting RTF on the Clipboard To XAML

Here is a simple function that will convert RTF data on the clipboard to XAML:           /// <summary>         /// Returns the text contents of the clipboard as XAML         /// </summary>         /// <returns></returns>         public static string GetFormattedXamlFromClipboard() {             System.Windows.Controls.RichTextBox box = new System.Windows.Controls.RichTextBox();             box.SelectAll();             box.Paste();             box.SelectAll();            …


Retrieving Information From Excel 2007 Files

Ever needed a sample code to programmatically extract data from Excel 2007 table?   Given an excel table like this (in book1.xlsx):   Name ID Color Ball 1 White Phone 2 Green Cup 3 Yellow     Here’s a function to retrieve the contents of the table:   /// <summary> /// Retrieves an excel table…


RichTextBox Tips

Although this blog is about XAML only I decided to take on the next step and write some code behind. 1. How to get selection range excluding the UIElements and such from RichTextBox:             StartIndex = new TextRange(richTextBox.Document.ContentStart, richTextBox.Selection.Start).Text.Length;            Count = new TextRange(richTextBox.Document.ContentStart, richTextBox.Selection.End).Text.Length – StartIndex; 2. How to change font weight, change to italic, etc…