Friday, March 14, 2008

Why InvalidateZOrder is not public???

The worst case of what you can implement on WPF is custom control. In this case you have to use most of the extensebility of the framework, and it turns out that it is just, well, non-extensible...

Today it turned out that there is no way to change the z-order of the element if it's parent is not a Panel, and there is no way I can use Panel as a parent because it tries to steal my logical children :(

It also turned out that there is no way to change z-order without making this:

foreach( Visual child in children )
{
RemoveVisualChild( child );
AddVisualChild( child );
}

And that could be avoided if a method of a Visual, called InvalidateZOrder, would not be internal :(

Tuesday, March 11, 2008

Canceling keyboard focus change in WPF

Hah! Today I found out that the keyboard focus transition in WPF  is cancellable :)
It turned out that you should "handle" PreviewLostKeyboardFocus routed event (just set it's Handled to True) and magic happens - focus does not go anywhere.
Still, there are some cases when this event is not raised, for example, when user just Alt-Tabs to another application, but that does not matter in most cases :)

Sunday, March 9, 2008

MuVo and its Firmware

As I already said in a preious post, I want to say some words about how I updated firmware on my MuVo v200 (it's not really my - I bought it for my girlfriend 2 years ago, but now it is replaced with her new mobile phone, so she does not use the player anymore).

First of all, what made me to update the firmware: sometimes the device could decide that it does not want to play anything...and it really did not play anything :) It even could not find any tracks on a flashdrive, and after that even I could not find those tracks on a flashdrive :)

So that is why I decided to make an update... I went to the Creative site, found the downloads page, selected my player and than I was asked of the OS I am using. I use Vista, so I selected in in a list and there was no firmware updates found. Than I clicked "Back" and selected Windows XP for the downloads filter...and there it was - I could clearly see the list to the latest firmware for my player.

I downloaded the update and tried to install it on my PC, but installer said that my OS is not supported (BTW, the same as with my Creative SoundBlaster Live 5.1). So I decided to attach the player to my server (that is running Windows 2003 server). In this way I solved the Vista-problem.

Using the terminal connection, I was able to run the update. It started to search for the player(I have already plugged it into the USB), and in a second or two I have been warned that the player will be reset. I clicked the confirmation button, hoping that it would start updating the firmware, but the only chage, I got, was the following message: "Fail to locate recovery driver needed for firmware upgrading".

So now I had to solve one more problem - I did not know anything about the "recovery driver" and there was no instruction for the firmware update. After some investigations with Goolge and Far (I use it for all kind of operations with files :) ) I found out two things:
1) Firmware update software package already contained the required driver, but it did not install it
2) My player supports the Recovery Mode, and I can put it into this mode manually - after that it will start searching for the driver, mentioned in 1).

So, I unplugged player, pressed Play button and, while holding it pressed, attached the player to PC again. After 10 seconds of holding the play button (I found out about that here), new device was found - some unknown recovery mode device. I tried to install the driver for it, abandoned the automatic install and selected the driver, that was stored in a temporary folder where it was extracted by the firmware updater (in my case that was C:\Documents and Settings\Administrator\WINDOWS\temp\CRF000\, but the updater should be running while you are installing the driver :) a bit tricky :) ). After I installed the driver for that stranger recovery device, I was pretty sure that now the firmware update should work correctly...and I was right - after I unlpugged and than plugged in the played again, I started the firmware update, it found my player, notified of it's reset, put it into recovery mode, updated the firmware and switched the player into the normal mode again :)

I think, next time, I will just go and replace the player with a new one, that is made by someone unrelated with the Creative company, instead of updating the firmware :):) If someone has the same problem with "Fail to locate recovery driver needed for firmware upgrading" and my post is too long and confusing - feel free to write a comment and I will give some step-by-step walkthough :)

Intro

"Hi" to everyone, who reads this :)

Today I decided to create my own blog (I do not count my LiveJournal account as a blog, the same with my account at Lviv .NET community - first is for russian-speaking crowd only, and the second one is intended to be used only for .NET related stuff, or at least development-related)

So at this blog I will write some of my thoughts about my life, and about my beloved work :)
BTW, as for the work - I'm some kind of mix of a developer, project manager, multiple projects manager and just the guy who does all researches :) I use C#, .NET 3.5, WinForms and WPF in my work, so I will post some of my findings here sometime...

Next, I will write about how I have updated firmware on my Creative MuVo v200 :)