Asynchronous Data templates, data providers and Data Binding

29 במרץ 2007

DataBinding, templates and providers and really cool things in WPF, but have you tried to load something really heavy? How time it's take to load 20 images? A couple of seconds? And what about if each image is 3000X3000 px? Huh, your HMI thread will be locked until all those images will be downloaded and displayed. In this post, I'll explain how to build asynchronous XMLDataProvider, that load RSS from Flickr, asynchronous DataTemplate, that loaded image by image without locking your application and asynchronous Binding, that...
אין תגובות

textbox for high-contrast very small text

 The most common question about text capabilities in WPF is about small fonts. By default all texts rendered with presentation layer are anti-aliased,  wich means, that we will get great text experience with large fonts, and blurry texts with small and extra small fonts.  As you, probably know, the common usage of big fonts is in entertainment-related application, however most of business-related applications using small fonts. There is impossible to solve "blurry" problem with WPF texts, so today, we'll solve it with WPF geometry....
אין תגובות

Creating datatemplates from code

It's really easy to create data templates from XAML, but today, one of my clients asks me to do it from code. The other request was to handle events of element form inside the template. So let's do it together First of all we have to create DataProvider as we usual do in xaml.   XmlDataProvider data = new XmlDataProvider();           data.Document = new System.Xml.XmlDocument();           data.Document.InnerXml = getXMLstring();           data.XPath = "/root/node"; Next step is to create binding expression for...
אין תגובות

Camtasia 4.01 for Vista is shipping

28 במרץ 2007

Finally, TechSmith released the final new version of their Camtasia Studio. Now, it's Microsoft Windows Vista compatible. I will now explain about this product, but just in case, this is the best tool for screen capturing ever. All those who had Camtasia used, know it. Currently, I'm using their beta version, downloaded a couple of months ago. It's running fine on Vista, but still there are some issues. For all those who have not purchased this tool, do it - it worth each penny of $299...
תגיות: , ,
3 תגובות

Grid animation

One of most common questions, I meet with my customers is how to animate grid size. Actually, there is no problem to animate doubles, ints, even sizes, but how to animate GridLength, which actually used to measuring the sizes in grid? In order to do it, we'll create our own animation, named GridLengthAnimation and use it within our grid. So, let's start. First of all we have to inherit base animation timeline in order to get the functionality we want.   public abstract class GridLengthAnimationBase...
2 תגובות

Adding Web References to your VS project by code

20 במרץ 2007

Today one of my clients asked me to find a way to add web references to existing VS project without using Visual Studio wizard, to do it by code. I built VS add-ins before, so I know what Studio can do, but the question is if I can replace existing system dialogs, without writing a lot of code (I'm really lazy, if I'll write a lot, I'll have no time to write here). So I start to check the material. Really,...
תגובה אחת

How to bind to Animation To and FROM properties

19 במרץ 2007

If you tried to bind to From and To values of Animation anything, you sure pay attention to the behavior, that the animation object just ignored you in the best case, in worth case, you couch very strange an annoying exception (if used from code-behind) "Cannot freeze the storyboard timeline tree for use across threads". What's the problem? First of all, just note in your notepad: "When you start an animation, Timeline object copying itself frozen into internal boundary. There it creates Clock...
אין תגובות

Multithread logger in WPF

18 במרץ 2007

So, we already know to write very nice WPF application, but one of most common modules in every application is logger. How to use WPF capabilities to build smart logger. What to do with multithreading environment, when methods InvokeRequired is absent? Today, we'll build logger, based on DataBinding of WPF, learn how to know what thread we are in and how to bind resources to ListView. Pretty enough? Let's start First of all we have to build our XAML page. It sill...
תגובה אחת

Global Events Hooking

16 במרץ 2007

WPF has really great engines for global hooking. Dependency Properties/Objects are only small part of those engines. Today, we'll look into Routed Events and EventManager Let's take a scenario, where I want to handle OnClosing event of all windows in my application. The propose is clear - popup an exclamation asking me to approve this action. The "legacy" way is to create kind of BaseWindow, derived from Window Class and override onClosing event to popup my message. This approach means,...
תגובה אחת

How to set your mobile modem to work without dialer

13 במרץ 2007

So, all those happy owners of Orange GSM modem Novatel Merlin U740 and Windows Vista already paid their attention to bugs of it's software dialer MobiLink. Someone called to Orange customer service to get answers, and understand, that their are not officially support Windows Vista. Someone get new drivers (via YouSendIt.com - please someone tell my why Orange can not just put those drivers to their website). But even the new version of Mobilink is really junk I believe, that  most of you...
3 תגובות