Lester's WPF\SL Blog


Simple, Easy & Beautiful


 

May, 2006

Blog - Post Feedback Form(CAPTCHA)
  • Lester's WPF\Silverlight Blog

    sample 3D Xaml code

    • 2 Comments
    I was tweaking some sample xaml code (by AdamSmith) and the result was pretty kewl. So I thought it would be interesting to share it with the readers. The xaml code is attached. A nice extension would be to have a movie list at the bottom such that the selected movie plays... to play the movies you would need Media player 10 installed... I had media player 9 and it took me some searching time to figure that out :) .. EnJoi
  • Lester's WPF\Silverlight Blog

    WinFX, Vista Beta2 released!!

    • 2 Comments
    A number of Beta2's have been released at the WINHEC2006 WinFX Runtime Components http://www.microsoft.com/downloads/details.aspx?FamilyId=4A96661C-05FD-430C-BB52-2BA86F02F595&displaylang=en Visual Studio Extensions http://www.microsoft.com/downloads/details.aspx?FamilyId=5C080096-F3A0-4CE4-8830-1489D0215877&displaylang=en Vista: http://msdn.microsoft.com/windowsvista/downloads/products/getthebeta/default.aspx#downloadWindowsVista You must have MSDN subscription or be part of the Beta program Office 2007: http://www.microsoft.com/office/preview/beta/getthebeta.mspx
  • Lester's WPF\Silverlight Blog

    Saving, loading, printing RichContent in WPF

    • 4 Comments
    Saving, loading and printing RichTextBox contents is a pretty common scenario and I just thought it would be a good idea to have some code out for general reading :). Most of the code below is self explanatory - so I wont go about explaining it. The code below saves the content in XamlPackage format which is the most rich content produced by RichTextBox. This is followed by Xaml and then rtf. void SaveXamlPackage( string _fileName) { TextRange range; FileStream fStream; range = new TextRange (RTB.Document.ContentStart, RTB.Document.ContentEnd); fStream = new FileStream (_fileName, FileMode .Create); range.Save(fStream, DataFormats .XamlPackage); fStream.Close(); } void LoadXamlPackage( string _fileName) { TextRange range; FileStream fStream;...
  • Lester's WPF\Silverlight Blog

    Code for getting screen relative Position in WPF

    • 1 Comments
    One of the common customer queries that we see on the forums is to get the screen relative position of a point. Currently we do not provide an API which allows this functionality. However, Nick Kramer came up with this code on the forum and it works great for LTR (left to right) systems. Following is the code for getting the screen relative position : static Point TransformToScreen( Point point, Visual relativeTo) { HwndSource hwndSource = PresentationSource .FromVisual(relativeTo) as HwndSource ; Visual root = hwndSource.RootVisual; // Translate the point from the visual to the root. GeneralTransform transformToRoot = relativeTo.TransformToAncestor(root); Point pointRoot = transformToRoot.Transform(point); // Transform the point from the root...
Page 1 of 1 (4 items)