Friday, July 10, 2009

Few words to Google Chrome OS

Few days ago, Google announced effort to release its own operating system - Google Chrome OS. What is it? Google Chrome OS will be Linux-based operation system focused on people who use internet, mainly. It is mean, that all the activity will be provided at the internet.

Interesting, isn't it?

I do not know all details about that, but all the day I thought about the idea. All the people I told about, said me: it can not be useful. They were very negative about that. But I disagree.

I read some book about Apple these days. Apple is about: Less is more. And I thing It is same thing about Google OS. Everybody predicted failure for Mac. And now everybody predict failure for Google Chrome OS. They say, people wants to use desktop apps with a lot of settings, they don't wont use web apps. It is for idiots.

I am not sure. Sometime, if you want make good busisess, you can not ask people, what they want. Sometime you must know more.

And I thing Google knows.

Monday, March 30, 2009

Using Silverlight 3 WrapPanel to Build Cool Photo Gallery

After many and many questions, how was gallery in my post exactly made, I have decided to write an another post, in English, where I demonstrate how to made really nice photo gallery by using WrapPanel control. From my previous post, one thing has changed. Last time I had wrote about this gallery, the WrapPanel was in Silverlight Toolkit. Now it is in Silverlight 3 beta 1. So I will show you how to build nice photo gallery in Silverlight 3 using new control WrapPanel.

What we have to do:
  1. make a class for photos
  2. make a template for the gallery
  3. make a listbox, which will represent gallery
  4. make a list of pictures (use some dummy data)
  5. join this list to our listbox
  6. make a detail of picture
  7. activate our gallery
Note: If you have not Silverlight 3 beta 1 installed, you could use Silverlight Toolkit as wall. You have just add libraries of SL Toolkit to your project before you start.

1. make a class for photos



For this example we could need just two attributes - name and source (in source you could use a string).



2. make a template for the gallery
We have to make two templates. First one for item and second one for whole gallery. And in this case we use new Silverlight 3 control WrapPanel as PanelTemplate.



3. make a listbox representing gallery
The important thing is to set ItemsPanel and ItemTemplate, which we made before.



4. make a list of pictures
I have already used paintings of my friend (which is not dummy, of course:).



5. join list of picures to our listbox



6. make a detail of picture



I have used some black rectangle with 80% opacity to hide gallery at background.



And now you have to paste this UserControl to our MainPage.xaml, becaouse you want to show preview above gallery. You will do that by this two lines of code in bottom of MainPage.xaml.



Remember, if you want to paste some UserControl to an other, you have to set a namespace of project to header.



7. activate our gallery
This is the most interesting part.

The event in ListBox which will handle with detail is SelectionChanged. We have just set the DataContext and set Visibility of our Detail to visible.



Now, we have to make any exit from detail. The easiest way to do that is use main grid event MouseLeftButtonDown to set visibility of Detail to Collapsed.



That's it. Now you can run your gallery :-)

Download - source code [16511585kB].

I hope you will enjoy it.

Tuesday, March 17, 2009

Silverlight Contrib [3] - StarSelector

In this part of my small series about Silverlight Contrib I would like to show some trick how to work with or how to use Silverlight Contrib StarSelector in your project. Time to time you need some control for showing or setting ratings. Common solution is using line of stars (or other shape). More stars means better rating.

For this situaliton Silverlight Contrib using StarSelector control. Using this control is very simple. You just set the basic properties such as Whidth, Height, Name and than you work with event RatingChanged.

Before we start, in case you do not know how to add Silverlight Contrib libraries to your project, read my first post.

We could make small example. So I would like that TextBlock said me my rating.

XAML:



C#



Result:



Ok, that was quite easy. Let's go to do something much more funnier. I have an other example. I have a some data, for example database of cars. And one of my attributes is rating. And I wont to show my data in DataGrid and use for rating column StarSelector.

So, I have a class Car.cs:



Here is my DataGrid:



And this is some dunny data filler:



Result:

That's it. Have a fun with Silverlight Contrib StarSelector control.

In following post about Silverlight Contrib I would like to show you how to customize StarSelector.

Sunday, March 15, 2009

BMW Z4 - An Expression of Joy

As usual, I browsed some iPhone apps yesterday morning. Normally I download few apps, try it and delete it. But yesterday I caught very interesting app. I don't know a I could name it the game. I thing it is something like interesting audio visual project. The point of the app is drawing pictures on the ground by the wheel of BMW Z4.



The first thing which you could enjoy is nice motion video about whole project (how it was made).



Then you could customize your Z4 as you want.




My Z4 seems like this (marvelous, ist't it?):


And then you could enjoy of painting by the car. You just set the colors you want to use for wheels and then you drive your Z4 by rotating your iPhone.



And when you are finished, you could save your work. This is mine:



And this is my girlfriend's work.



I'm pretty sure, she has a batter artistic feeling. And my rating? This project is excellent.

Friday, March 13, 2009

10+ Photosynths you can't miss

I have selected some PhotoSynts I like.

San Francisco Palace of Fine Arts



Garden for the Sightless



Burj Dubai Lake



Paris, France (aerial)



Ganesh (almost 3D)



3D Amsterdam - synth made of screen shots from the 3D game. Nice idea. I am curious about the firs synth from Counter Strike :)



Truck - Kite Aerial (KAP)



Mayan Ruins of Palenque (take 3's the charm!?)



Vertical World - Redmond Gym



Tehran - Derbi



King Arthur VS Red-Dragon (press CTRL for 3D view - nice)



And one from my home town...

Prague Castle



And what is your favorite synth?

Wednesday, March 11, 2009

Silverlight Contrib [2] - CoolMenu

The last time I have wrote about this control was Silverlight Contrib in Alfa 2. From this time have many thing changed. The most important thing was refactoring the CoolMenu. Now it inherits from ItemControl. It allows you to use some advanced things such as binding the items.

Averything about refactoring the CoolMenu read here in thre-part series by Page Brooks:
In next few rows I would like to introduce basic using of this very useful control. For information how to use Silverlight Contrib in your project in Visual Studio visit my first post about Silverlight Contrib.

In fact it is not so difficult build simple CoolMenu. You have to just define images you want to use for the menu.



Then you can enjoy the result:



That is marvelous, isn't it?

Work with items
So, let go to get a life to our menu. Our issue for this moment is: when somebody click the icon, the name of the item will be shown in upper part of page.

First thing we have to do is change structure of our menu. In case we want to work with the items we have to define CoolMenuItems more complexly.



Then we use event MunuItemClicked to show which item was clicked.



Now we can check out the result:


DataBinding
The last thing I would like to show you is how to use DataBinding for items in menu. First thing we have to do is make a class for items.



Then we have to template out item.



And finally we have to make a list of items and set ItemsSource for our menu.



That is it. Have a fun with Silverlight Contrib CoolMenu.

Monday, March 9, 2009

Silverlight Contrib [1] - ColorPicker

In this part of my small series about Silverlight Contrib I will introduce very useful control - ColorPicker. ColorPicker allows you to select color by the very user friendly way. It was one of the things I miss.

Before start playing with ColorPicker, read a tutorial, how to get Silverlight Contrib to my project in Visual Studio (in case you do not know that).

Go on
First thing you must to do is put the ColorPicker control in XAML to the page. Don't forget set a SelectedColor, because there is a small bug. If you don't select a color in definition, your ColorPicker won't work till you move with vertical axis.



Now you have a wonderful ColorPicker in your page.



Now, we add a rectangle and TextBlock, which we use to demonstrate event SelectedColorChanging.



It could seems like this:



The only thing we have to do, when we want to change color of rectangle and text, is say: when the color in ColorPicker is changing, the Foreground in TextBlock and Fill in Rectangle will change too. For it we use an event SelectedColorChanging.



Now we should play with it.

Playing with color's components
This thing is different against Alfa versions. Now you have a direct access to RGB components. You can call it by SelectedColor.A/R/G/B.

Small example of using:

XAML



C#



Result:



Online demo
Online demo you can find here.

Source code
Code you can download here.