Welcome to Windows Presentation Foundation (WPF)
Top Tasks :

WPF Team Bloggers

Browse by Tags

All Tags » Programming   (RSS)

  • ABCs of Threat modeling ...

    Larry Osterman has an interesting series of posts on Threat modeling.. It starts from the basics and is very comprehensive. A application needs to go through the threat modeling process to identify possible threats, the mitigations, and the risks involved. From a tester's perspective it opens up several testing scenarios. So if you are unfamiliar with this topic or its something which needs some brushing up, give the posts a look :) ... Happy reading Share this post Read More...
  • 3.5 features: Viewport2DVisual3D

    Viewport2DVisual3D .... this new feature makes things a lot easier in the 3D world.. What this enables is putting interactive 2D on 3D. This makes things like having a textbox in 3D a breeze... < Viewport2DVisual3D x:Name = " vp2d_multiple_children " Geometry = " {StaticResource mesh} " > < Viewport2DVisual3D.Material > < DiffuseMaterial Viewport2DVisual3D.IsVisualHostMaterial = " True " Brush = " White " /> </ Viewport2DVisual3D.Material > <TextBox /> </ Viewport2DVisual3D > One other thing is mapping 3D points to 2D is so much more easier... Earlier on I had a post on mapping a mouseclick on a 3d model to a 2d coordinate. This involved using some barycentric coordinates and such... Now all you need is call e.GetPosition(relativeTo) in the mouse event handler... tada!!... your coordinates are ready... so using this new stuff i created a simple app for keeping track of your travels. right clicking on the globe puts a tag on the globe. Clicking on the Read More...
  • 3.5 features: Addins

    In 3.0, we received a number of queries regarding creating plugins. So in 3.5 we got this in .. :) .. Creating an adding would bsically need the use of 3 dlls - System.Addin, System.Addin.Contract, System.Presentation The basic steps to create the addins involves creating a contract, then create the corresponding views and adapsters for both the host and the addin. So in total you will be creating 5 dlls in addition to the app and the actual addin. Even though this looks a bit overwhelming, its pretty simple. http://blogs.msdn.com/clraddins/ gives more information about creating addins. In order to try out this framework, I added the addin support to blogpad with the host being able to set text in the addins... So the app basically has an addin for a calculator (which can be removed) and an ad at the side... You can try out the code that is attached .. FYI, the ad plugin links to an xbap and this line is commented in code.. You might want to point it to a legit xbap to get this plugin working. Read More...
  • 3.5 features: Filtering text with IME languages

    So 3.5 beta2 is out and it has quite a lot of features. So one of them is the filtering mechanism for IME languages. This was not a problem in the english and other non-IME languages. The problems were the events associated with IME input - TextInputStart/Update/input... A major concern was that it was not possible to determine where the composition took place. Now all these issues have been fixed and filtering in these languages is a breeze. I came up with a sample calculator with the filtered IME textbox which shows how the filtering is done for IME languages. If you go through the code, you will notice that min max positions of the composition are tracked in the events to determine the correct caret position after the filter is applied. The textbox takes any ime input and filters the characters after the composition is complete. The sample project is included to demonstrate the usage of the events. The project also includes a filtered richtextbox even though its not used in the demo Read More...
  • 3.5 released with many features!!!

    You can now download Visual studio 2008 Beta2 and .Net 3.5 Beta 2. The link is here So whats new in 3.5 - Support for Addins - Xbaps now run in FoerFox - Cookies can be shared between XBAP's and Web Apps - Better support for binding to BindingList coll and LINQ - new UIElement3D, ContainerUIElement3D, ModelUIElement3D classes which make 3D stuff easy - Place 2D elements on 3D using Viewport2DVisual3D - RichTextBox has embedded elements enabled (IsDocumentEnabled property) - IME support has improved. Filtering text in IME is now a well suported scenario - and many other features... btw, i'll try posting a few samples with these bits in a few days :) Share this post Read More...
  • WPF Balloon comments :)

    Pavan has a nice post on creating baloon comments. The first thing that comes to mind on seeing the balloon comments is Comics. And guess what! thats exactly what I tried.. and presto You can get the original source code here . It overlooks positioning the arrows coming out of the comment boxes - this is a minor detail and I added a dependency property for this purpose. The update code is attached . As for the usage: < custom:BalloonDecorator Background = "Pink " PointerLength = " 30 " CornerRadius = " 5 " CornerPosition = " Right" .... /> Share this post Read More...
  • WPF Blog Writer

    Recently, I was trying my hand at creating a simple blog writer. The writer came out pretty nice. The app makes use of a base richEditor control (thanks to Praj ).. After a bit of tweaking it ended up like the above... So the app just makes a simple call in the xaml <custom:RichEditor/> ...tada ... you have it there!!! The next thing is to write to a blog... In this case, the writer is coded to post the entry on blogger, which makes use of the Google data API .. this could easily be changed for other blogs. It also makes use of a Xaml-HTML converter as the string passed needs to be in HTML. For now, its a blog writer - hence, it onluy writes. But it could easily be extended into a full blown Blog client. Do I hear anyone taking it up :) The code is attached .. so have fun with it .. Share this post Read More...
  • Xaml shield image in plain Xaml

    just came across a post which includes xaml to display the xaml shield. That looks sweet.. and all the more when its in Xaml... Xaml code attached Share this post Read More...
  • View Source - Giving It Back with Silverlight

    Much of my HTML, Javascript and CSS learning came by way of the View Source context menu option in Netscape Navigator and Internet Explorer with some tinkering on (the old) Geocities. My experience in that domain is hardly unique. And I had the opportunity to learn from the best; to sit on the shoulder of giants, as it were. I'd posit that the acceptance, popularity and ubiquity of the universal web is in large part due to that "openness" and the ethic of sharing. By keeping XAML in Silverlight a mere step away from your piqued curiosity, we're actively trying to make it easier to learn from the best. Ernie Booth takes away what little remnants of pain existed on the newbie programmer's path to Silverlight nirvana with his excellent plug-in for Lutz Roeder's Reflector. Check out Ernie's post entitled View Source Reflector tool for .NET Silverlight sites . A must-have tool for the Silverlight developer. Needless to say, should you care about protecting your IP, the tool doesn't circumvent Read More...
  • New To Programming?

    Microsoft's Beginner Developer learning center has great resources for beginner programmers intending to learn web and desktop programming basics. There's also a Kids Corner . Read More...
  • Vista style Open/Save FileDialogs

    If you have tried creating FileDialogs in WPF, they usually do not blend well into the Vista look. The solution is to use the wrappers provided in the VistaBridge library which is part of the SDK samples. You could include the library dll (around 100k) in your project and then make the simple call to CommonOpenFileDialog/CommonSaveFileDialog ... The other option being to just include the specific classes in the project. CommonSaveFileDialog saveDialog = new CommonSaveFileDialog (); Its that easy!! Share this post Read More...
  • Update: XamlPadX v2.5

    I was pleasantly surprised by the response I got for the last update of the tool. Along with the feedback I got a few bugs... ahh the bugs ... so went about fixing them ... Got a couple of new features too. :) If you have noticed above, theres a System Tray option to minimize to the systray. Now it wont occupy any additional space - its in the sys tray. By default, its not enabled. The other thing that I added is the send to command interpreter option in the Property tree view. One thing to note here is that sometimes the node higher up the tree is passed. For instance, if you send the Height property of a TextBox to the command interpreter it will send the textbox instance. The reasoning here is that the user wants to modify the Height and sending an instance of the Height doesnt accomplish this (as its disconnected from the parent). Simplicity is the goal here so that there are no crashes... Also, the command interpreter is simplified a lot - So if you perform illegal operations (such Read More...
  • Xaml FlowDoc to XPS

    Feng Yuan has a nice blog post on how to convert FlowDocuments to an XPS document with the header. The code is in the form of a wrapper class so its gonna be handy. I tried out the code on a RichTextBox and it worked like a charm J I reused one of my old samples and it looks great :) ... The sample code is attached . (PS: Do make a point a read the original post for code specific details) Share this post Read More...
  • Smalltalk sessions in a XBAP

    Xbaps are just multiplying by the day... Just came across this interesting xbap which runs VistaSmalltalk sessions. Its got a nice usage of popups. http://vistascript.net/vistascript/vsb/Vsb.xbap Share this post Read More...
  • Sample form using listview

    Recently I was clearing up my documents and I came across this sample I made. Thought it might be useful to someone out there and here it is. It’s basically something like a form but which dynamically grows as and when you fill up the rows. So the typical ‘Add New Row’ button is missing. J … Red (more like pink) rows indicate values being empty; green being obvious. :) .. Typically, you would be using a combobox instead of the textbox. It would result in a better perf experience. The code is simple using a listview which is bound to the data. This might look very familiar to Product Studio if you have used it ;) Code is attached Share this post Read More...
More Posts Next page »

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us