Browse by Tags
All Tags »
download »
Tips and Tricks »
tutorial (
RSS)
Please update your bookmarks, because the new url of this blog is http://khason.net/ (you have not update RSS feeds, it will be done automatically). Why I did it? Why I decided to go to “stand-alone”… Well. there are some reasons. Generally, I do not want to explain all those here, but trust me, there are some. The main reason is, that there is no responsible person in charge for this blog platform in Microsoft Israel. This why, if your blog is popular and you have a respect to your blog visitors...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/wordml-to-flowdocument-%e2%80%93-how-to-convert-docx-files-to-wpf-flowdocument/ ] Recently we spoke about converting XPS files and FixedDocuments to FlowDocuments . It works, but there are lot of problems, due to fact, that FixedDocument (or XPS/PDF document) has less information, then the original file. Those files are, actually, printout of the original document. Also we know how to...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/building-custom-user-control-in-silverlight-20-how-to-build-code-snippet-for-vs-as-bonus/ ] Do you remember, that we have "go-live" for Silverlight 2.0 and already have build machines configured ? Now it's time to build your very own custom control. Today, we'll build Range Slider. What is range slider? Range slider is a control, that lets you input two values, typically...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/building-virtual-keyboard-in-wpf-custom-editors-accessibility-and-attached-properties/ ] The challenge - build alternative on-screen keyboard to appear on each textbox, marked to use such keyboard. The reason - custom editor, ability to use touch screen input, etc Realization: WPF, two windows, a little hooking, attached properties, custom commands and gestures. Let's start working...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/how-to-disconnect-ui-and-data-in-wpf-cachedobservablecollection-and-some-updates-regarding-threadsafeobservablecollection/ ] Sometimes, we want to "freeze" current displayed collection, while the original collection keep being updates. How to do it? There are some ways to get such functionality. One is to use CollectionView DeferRefresh method and release (dispose) it after...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/how-to-use-windows-vista-search-api-from-wpf-application/ ] Another great service, provided by Windows Vista is it's integrated search. Can we use it from our WPF application? Sure we can. This how you'll do it. First of all you'll need to find Windows Search API library inside Windows SDK. Locate SearchAPI.tlb and process it with tlbimp tool to create managed assembly to...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/filtering-hierarchical-data-and-another-treeview-bug/ ] Well, well, well. Yet another TreeView bug discovered, while answering another WPF question. But, before it, let's answer it: "How to filter hierarchical data?" What we have? We have treeview with XML data binded to it. What we need? To filter it - for example filter out all odd nodes in any level. How to do? Regular...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/2d-controls-in-3d-world-how-to-create-a-wheel-of-fortune-with-wpf/ ] Before reading this post you should know what is geometry and trigonometry. As well as you should know, that in WPF you can "brush" 3D meshes with images or, even other XAML vector controls, inherit and create custom controls, use animations, dependency and attached properties and handle special events. Here...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/generic-grid-with-column-autodetection/ ] There are a lot of questions such as "how can I generate columns in my grid, based on my XML data?", how to implement generic sort algorithm?" etc. In this post I'll try to explain how to use ListView with GridView, how to sort your data presentation, without sorting data source and lost binding. How to parse generic Excel or...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/too-much-async-with-this-wpf/ ] What's this post about? This post begins with DIY. Try to do the following: Add simple ListView to your application Inside the ListView add two TextBlocks For each TextBlock subscribe to OnMouseDown (or any other mouse event) OnMouseEvent create new Window and open it with Show() method. Did it? Fine. Have you paid your attention, that each new window...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/asynchronous-data-templates-data-providers-and-data-binding/ ] 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 blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/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...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/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...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/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...
[This blog was migrated. You will not be able to comment here. The new URL of this post is http://khason.net/blog/how-to-bind-to-animation-to-and-from-properties/ ] 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...
More Posts
Next page »