Just code - Tamir Khason

יום חמישי, ינואר 1, 2009

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, you cannot host it here… Take a look...

יום ראשון, נובמבר 9, 2008

Well, Windows 7 is going to be released by the end of next year. This is great news, because it seemed, that Microsoft finally understand how to get the best of Windows Vista and make it to work not only on monster machines. It even works on new brandy my wife's pinky machine. And if it works there and my wife is happy with it, this OS going to be very impressive. But from the other...

יום שישי, אוגוסט 22, 2008

Because of the new job, I’m bit tight in time, however, I found a time to post slides from my sessions in Expert Days. Also, hand-on labs used for WPF beginners’ released as open source to CodePlex for your convenience. Windows Presentation Foundation for Fellow Developers Mastering Microsoft Silverlight 2.0 Have a nice day and be good people.

יום שני, מאי 12, 2008

Today we’ll speak about how to search and select text on WPF page. This is not about how to search data sources, or how to search for data. This is visual search. Like this one Let’s see how XAML looks like <Grid Name="root"> … <StackPanel Grid.ColumnSpan="2" Grid.Row="1" Name="panel"> <TextBlock Name="tb" Text="Lorem ipsum dolor ...

יום שלישי, אפריל 22, 2008

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 use Windows Vista Preview Handler to view original MS Office files inside WPF application. So why not to work with the originals? Why not to convert Microsoft Office document into FlowDocument and then...

יום שישי, אפריל 18, 2008

First of all what is Preview Handler? Preview Handler is COM object, that called when you want to display the preview of your item. Other words, Preview Handlers are lightweight, rich and read-only previews of file’s content in a reading pane. You can find preview handlers in Microsoft Outlook 2007, Windows Vista and, even sometimes in XP. Can we use preview handlers within your WPF application? Probably we can. Let’s see how we can do it. Let’s...

יום חמישי, אפריל 17, 2008

First of all, what’s the differences between FixedDocument and FlowDocument and why we can convert FlowDocument into FixedDocument easily but not vice verse? Let’s try to understand What is FixedDocument? FixedDocument is a host for portable, high fidelity, fixed-format document with read access for user text selection, keyboard navigation, and search (MSDN). Other words – it’s PDF :) Now seriously, when you write something really complicated and do not want it to mess, when you’ll send it to someone –...

יום שלישי, מרץ 11, 2008

I know only one person, who has following problem, however it makes sense to post all steps to perform in order to solve the problem. Let's start from the error: While trying to run XBAP application with user's account on my machine, I get following error: System.UnauthorizedAccessException was unhandled Message="Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" Source="System.Deployment while administrators on the same machine have no problem to run the same XBAPs. ...

יום שלישי, ינואר 29, 2008

Today, we'll answer number of questions, regarding DocumentViewer, XPSDocument, FlowDocument and more
First question: I'm trying to display FlowDocument, by using DocumentViewer and I'm getting "FlowDocument' object cannot be added to 'DocumentViewer'. DocumentViewer supports only FixedDocument or FixedDocumentSequence documents". What to do?
First answer: DocumentViewer supports only fixed document source (one, which implements IDocumentPaginatorSource - other words supports pagination). In order to do it, we have to convert FlowDocument into FixedDocument and we can do it, by using XpsDocument and it's GetFixedDocumentSequence() method...