Lester's WPF\SL Blog


Simple, Easy & Beautiful


 

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

    Capturing Frame content

    • 3 Comments
    Some time back I got a question about capturing the contents of a frame and it seemed easy, but every time I tried capturing the frame i was getting a blank image. The trick here is that the frame loads the content asynchronously - the simplest thing to do is wait for some time :) ... The frame is an HwndHost that hosts an ActiveX control to load the web content. So the first thing to do is get hold of the HwndHost and then wait for a few seconds and you have it.. for ( Visual v = TheFrame; v != null ; v = VisualTreeHelper .GetChild(v, 0) as Visual ) { hwndHost = v as HwndHost ; if (hwndHost != null ) { break ; } } Now create a DispatcherTimer and wait till it triggers DispatcherTimer timer = new DispatcherTimer...
  • Lester's WPF\Silverlight Blog

    WPF/E 3D(like) photo app

    • 9 Comments
    Often times when I go through the WPF forums, I see people getting confused with WPF and WPF/E..... (don’t miss the ‘E’).. One of things that is on many of our minds is ‘why not xbap’. Chad summarizes the difference in his blog pretty well. “ WPF/E Applications · Are cross-platform ready (Mac OS X and Windows) · Do not require the client to have the .NET 3.0 runtime. Instead, WPF/E applications run within a browser plugin. · Do not support code-behind · Rely on JavaScript XBAPs · Require the client to have the .NET 3.0 runtime components installed. · Are not cross-platform enabled. They will only run on Windows machines. · Support code-behind · Must run within IE (or use the IETab plugin for Firefox)” I decided...
  • Lester's WPF\Silverlight Blog

    Nice Movie viewer xbap

    • 0 Comments
    Tim has been posting some kewl WPF apps that are being released to the public. To add to that collection, I came across this nice little xbap. http://sp.warnermycal.com/vista/contents/preview.xbap Share this post
  • Lester's WPF\Silverlight Blog

    Changing caret color in (Rich)TextBox

    • 0 Comments
    This sounds simple but its not so since we do not make it public. So what are the options we have here. hmmm... How about an hack J . The caret color is the inverse of the background color. So a very simple way is to set the background which then doesn’t get rendered. <Style TargetType="{x:Type TextBox}"> <Setter Property="KeyboardNavigation.TabNavigation" Value="None" /> <Setter Property="FocusVisualStyle" Value="{x:Null}" /> <Setter Property="AllowDrop" Value="true" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TextBox}"> <Grid> <Border x:Name="Border” BorderThickness="2" SnapsToDevicePixels="True" Padding="2" CornerRadius="2"> <ScrollViewer Margin...
  • Lester's WPF\Silverlight Blog

    Localizing WPF apps

    • 1 Comments
    Localization does pose some difficulties even though I would like to believe the exact opposite :) ... So it was nice to read a post that is pretty comprehensive and makes it look easy. hmm... my belief is strengthened ;) brunzefb has posted this localization article on Codeproject and it is a must read for all who plan to/are creating a WPF app with the international audience in mind. Share this post
  • Lester's WPF\Silverlight Blog

    Cool WPF app - Turning the Page 2.0

    • 6 Comments
    Just came across this super cool WPF web app… Its called “turning the pages” and is developed in partnership between the British Library and Armadillo Systems . This is one helluva app. Play the video below. If that got you interested check out the app here . For more information go to their site . Share this post
  • Lester's WPF\Silverlight Blog

    Free Xceed datagrid control for WPF

    • 0 Comments
    One of the topmost customer requests has been for the datagrid. Unfortunately, we couldnt provide it for the V1 release. However, if this is a show stopper for you then you could use the xceed datagrid for WPF. It comes free and looks good from the demo. "Xceed DataGrid for WPF is licensed for free , with an unlimited number of licenses per company, as long as each developer registers with their real name and valid email address at work. The free license is a perpetual license and includes royalty-free distribution, bugfixes, and new features, so your company can use it with full confidence. " - Xceed website The xbap demo can be seen here Share this post
  • Lester's WPF\Silverlight Blog

    Printing RichTextBox content: (Find the idle printer)

    • 1 Comments
    Recently, Praj blogged about printing content of a RichTextBox. Normally, if you use the documentPaginator or the visual, you might end up with some text clipped. Not a nice thing to happen J . One thing that bugs me while printing is the print dialog. Often times, I just want to use a printer that’s not busy. Just don’t make me wait. It’s pretty simple to code and its worth it. No more waiting at the printer. ;) foreach ( PrintQueue pq in GetPrintQueues( "\\\\servername" )) { if (!pq.IsBusy) { Print(pq); return ; } } private IEnumerable < PrintQueue > GetPrintQueues( string servername) { PrintServer ps; if ( string .IsNullOrEmpty(servername)) { // local printer name ps = new LocalPrintServer (); } else { //...
  • Lester's WPF\Silverlight Blog

    Determining the Visibility of Elements inside Scrollviewer

    • 6 Comments
    A ScrollViewer is a very handy control. One of the problems, however, is bringing a control to Focus or scrolling to the item. If this is done manually, that’s not an issue. But programmatically hmm.. You can hit some issues. The simplest way is to call the scrollviewer’s ScrollToVerticalOffset() with the offset being the Y co-ordinate. But what if the element is partially visible and you do not want it to scroll. This would require determining if the element is in the ScrollViewers viewport. The way to achieve this is simple. Suppose ContainedObject is the element inside the Scrollviewer (ScrollViewerObj) // position of your visual inside the scrollviewer GeneralTransform childTransform = ContainedObject .TransformToAncestor...
  • Lester's WPF\Silverlight Blog

    Xbaps - Learn the basics

    • 1 Comments
    Developing Xbaps (WPF web apps) can be a frustrating experience IF you are not sure about the supported features and the trust levels. A simple scenario would be copying text content from a xbap. Ouch! that wont work because of the heightened security. So its always a good thing to first read the basics before you start developing one. Karen Corby has written a couple of posts on xbaps and they provide comprehensive info on xbaps. The first one delves on features ( Link ). The second post talks about the security levels ( Link ). These two posts are must reads in addition to the info in the SDK. Happy reading :) Share this post
  • Lester's WPF\Silverlight Blog

    Complementary copy of Office Professional 2007

    • 1 Comments
    Starting from Jan 15 through March 1, Microsoft has organized launch events for Office 2007, Vista and Exchange Server 2007 in 74 different cities. You can have some learning sessions, talk to experts, have some hands on experience and enjoy the events. And to top it all you get a FREE copy of Office Professional 2007 and Office Groove 2007*. To find if there is an event near you check out this link and register: http://www.microsoft.com/business/launch2007/signup/default.mspx *FREE copy of Microsoft Office Professional 2007 and Microsoft Office Groove 2007. Offer good only to registered attendees of event on the date they attend, while supplies last. This offer is nontransferable. Limit one item each per attendee. Taxes, if any, are...
  • Lester's WPF\Silverlight Blog

    WPF Technical Chat transcript

    • 0 Comments
    Now a lot of you guys know that we had a technical chat a week before Christmas. For those who missed out, do not despair; we upload the transcript to MSDN. Also, looking at the response we do plan to have another chat session soon :). The transcript is not yet uploaded to MSDN, but you could however, get it from here . The document is pretty long but its well worth a read.
  • Lester's WPF\Silverlight Blog

    XamlPadX v2

    • 22 Comments
    Season's greetings guys :) Hope your Christmas was great. Ok so before we go into the next year I thought I'll take a look at XamlPadX since it will get a bit tough to spend some time on it in the next year. So XamlpadX v2 looks like: New features: 1> Line numbers in the Editing box 2> Written xaml can now be indented automatically(Ctrl I or right click and click on the menu item) 3> Closing tags are automatically generated (Note that it doesnt look forward while generating the closing tag. This is to keep it as simple as possible) So if you have something like <A </A> and then type in the '>' after the first A you will end up with <A></A></A>. 4> Theres an Open/Save File menu for opening/saving...
  • Lester's WPF\Silverlight Blog

    12 handy things/tips to know about Vista

    • 7 Comments
    By now I hope that most of you have atleast tried Vista. If not, join the bandwagon . INSTALL VISTA!!! :) I love every bit of Vista and would like to share some handy tips and also bring into focus some apps that I use a lot. 1> Launch group favorites in IE : This feature is really nice. You can open all items in your Favorites group by clicking on the arrow 2> Shortcuts to quick launch items : We can use Windows key and number keys to launch the quick launch items. So win+1 would result in minimizing all apps 3> Snipping tool : This is a nice tool to get an image clip and to edit it. 4> Windows movie maker : I use this a lot to make movies of photos. You can add your own transitions and audio effects. This...
  • Lester's WPF\Silverlight Blog

    Vista look on Non-Aero themes

    • 10 Comments
    Vista look on Non-Aero themes...
  • Lester's WPF\Silverlight Blog

    Drag drop library

    • 4 Comments
    Some time back Marcelo had written a series of posts covering drag and drop. This was interesting reading and I had uploaded the C# code in one of my previous posts. Recently, I came across Pavans blog where he shows the same using attached properties. The code is written with reusability and ease of use in mind. To use the code you would need to specify the source and the destination (putting it in layman terms) < local:CanvasDragDropAdvisor x:Key = " advisor " /> < Canvas Background = " White " local:DragDropManager.DragSourceAdvisor = " {StaticResource advisor} " local:DragDropManager.DropTargetAdvisor = " {StaticResource advisor} " > You would need to implement the SourceAdvisor and TargetAdvisor ( in the above...
  • Lester's WPF\Silverlight Blog

    3D RSS reader in WPF

    • 7 Comments
    One more interesting WPF app ... a 3D rss reader ... EnJoi " UniveRSS is a 3D RSS feed reader for Windows Vista. It leverages the Windows Presentation Foundation and provides a stunning way of visualizing RSS feeds and their content. It introduces a full-screen 3D universe where galaxies represent the folders of your RSS feed directory, and the stars are represented by the spinning cubes that hold the feed information. Size and position of the feed cubes indicate how many unread items they contain." Download the app from here clicking on the cube brings up the feed as below
  • Lester's WPF\Silverlight Blog

    WPF/E is out !!!

    • 3 Comments
    WPF/E just came out with the CTP release.... download link: http://www.microsoft.com/downloads/details.aspx?FamilyID=a3e29817-f841-46fc-a1d2-cedc1ed5c948&DisplayLang=en For the mac enthusiasts: http://www.microsoft.com/downloads/details.aspx?FamilyId=1665A00C-F7BB-459A-9DA2-F1DB6297277F&displaylang=en The sample pack http://www.microsoft.com/downloads/info.aspx?na=22&p=20&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=&u=%2fdownloads%2fdetails.aspx%3fFamilyID%3d8aeebe39-6699-4f4f-9732-ca732e57ae21%26DisplayLang%3den Since pictures speak better than words here are some snapshots of some WPF/E samples: if WPF/E doesnt ring a bell then read the following "WPF/E stands for Windows Presentation...
  • Lester's WPF\Silverlight Blog

    Mapping mouseclick on 3DModel to a 2D texture coordinate

    • 1 Comments
    Some time back I posted a gadget with the rotating earth. This looked nice but it lacked some interaction. One of the things to make it interactive was to map the point of clicking to the texture applied on the globe. To get the 2D coordinate we need to perform a hittest on the Viewport3D and this will give us access to RayMeshGeometry3DHitTestResult object. This provides info on the mesh, geometrymodel, vertex indices of the triangle hit, and the barycentric coordinates . To obtain the coordinate we multiply the vertex weights (barycentric coordinates) with the cordinates of the triangle hit. We then scale this point with the texture size to get the actual pixel within the texture ( The link to the barycentric coordinates is a nice read and...
  • Lester's WPF\Silverlight Blog

    Flickr Slideshow gadget

    • 3 Comments
    Flickr Slideshow gadget...
Page 9 of 13 (241 items) «7891011»