We have all used WPF DataTemplates, but I bet most of you never gave thought to the meaning of the x:Key attribute. We all know the meaning of the DataType attribute, which determines to what type of data the template will apply to. But what about the x:Key why is it there? Lets tale a look at the following code:

<Window.Resources>
        <DataTemplate DataType="{x:Type data:s}">
            <Button Width="50" Height="50">
                <TextBlock Text="{Binding text}"></TextBlock>
            </Button>
        </DataTemplate>
    </Window.Resources>
    <Canvas>
        <ItemsControl ItemsSource="{Binding}">
        </ItemsControl>
    </Canvas>

Continue Reading...

After publishing 10 Visual Studio shortcuts you must know and then 11 more Visual Studio shortcuts, a colleague of mine, Elan Kynsky, introduced me an MSDN page called Visual Studio 2005 IDE Tips and Tricks. This is a long article where you can learn cheatsheeta couple of useful things about Visual Studio, but what attracted me most, was the “Creating a keyboard shortcuts cheat sheet” section.

As we all know, there are a lot of keyboard shortcuts in Visual Studio. We mentioned only 21 of them here at Dev102.com but according to this article, there are about 450 shortcuts available. That fact, made me realize that I know less than 10% of them… Fortunately, we can write a macro that enumerate all of the available shortcuts. To achieve that goal, go to Tools->Macros->”Macros IDE”, a macros window will pop up, expand the MyMacros project (in the project explorer), expand MyMacros namespace and double click on Module1. Copy the following code to the Macros IDE and run it.


Continue Reading...

This is a simple hello world example with ASP.NET MVC, to help you build your first application step by step. I will not explain the ASP.NET MVC here, you can find plenty of excellent resources on the web for that, you can try one of these: Kigg - Building a Digg Clone with ASP.NET MVC, ASP.NET MVC Framework, An Architectural View of the ASP.NET MVC Framework . We’ll create a web application with two additional views - the first will ask for your name, and when you submit it you’ll get a greeting message in the 2nd view. Lets start:

1. Download and install ASP.NET MVC Preview 3.

2. Create a new ASP.NET MVC Web Application, Call it MVCHelloWorld

MVCNewProj


Continue Reading...

Here are two interesting tools I found while working on our Silveredo 2 theme.

Install Multiple Internet Explorer Versions

This one is quite helpful and a must if you are working and building themes. Usually you want your theme to be compatible with FF2/3 and IE7 which we all know has its issues…

I bet there are many people who want their site to be compatible with Internet Explorer 6 too, having IE6 and IE7 working together on your windows is a problem, as it turns out, you CAN have all the Internet Explorer versions working along side each other, all you have to do is to download the multiple IE version installer and install any version you need.


Continue Reading...

That’s it, Times up on the sixth in the series of job interview questions. There were 39 people who answered and the first one to give a correct answer was leppie from the IronScheme project.

The correct answer is that both will return false.

You could sum up the answer by saying Boxing.

An ArrayList hold objects, so when you insert a ValueType into it, it will be boxed and become an object. When you compare List[0] to List[1] you are comparing references, and they will never be the same because they are pointing to different objects. This is the reason for getting the false in both comparison. It is true that in the second comparison you are comparing a double and an int ( 2.0 and 2), but that is not why you get false, it is due to the Boxing.


Continue Reading...

In this post I do not intend to make a list of the best programmers web sites, but to share with you some you might not know:

CodeFetch - Search for source code in programming books. Their mission is to connect programmers with authors and is uses and support open source. If we are talking about code search I am sure you are familiar with Koders - top search engine for code.

FreeTechBooks - Free Online Computer Science and Programming Books, Textbooks, and Lecture Notes.

QuickRef - interactive programming documentation, allows you to keep many docs and remember them.


Continue Reading...

Last week I was in the need to use a WPF TextBox that had multi line capabilities. I started Typing Multi and hit CTRL + Space to get the intelisense and I was shocked! No MultiLine TextBox, I did get the following:

But no MultiLine TextBox

   1: <MultiBinding></MultiBinding>
   2: <MultiBindingExpression></MultiBindingExpression>
   3: <MultiDataTrigger></MultiDataTrigger>
   4: <MultiTrigger></MultiTrigger>

Continue Reading...

Last evening we have experienced our first ever crash due to traffic, it was quite annoying, but I guess it is a good sign :). Our current hosting program supports 150 concurrent users (shared hosting). The article that caused the trouble was When a Company Logo Doesn’t Come Out So Good. We are using a WordPress plugin to track online activity in the site called Wassup, which we recommend and here is the traffic graph of just before the crash:

Traffic


Continue Reading...

Today we are taking a comic break from code and from programming. I received some pictures of unsuccessful logos, you will be the judges…

Computer Doctors


Continue Reading...

charts May is gone and now is the time to check out the stats. I am so happy to see that we have managed to make all parameters grow substantially, although i must say it is getting harder and harder.

We have tweaked our theme several times this month due too some test we were running, the conclusion of those test will be published in the following week.

Just before the stats we would like to announce that from now on we will be accepting guest posts.


Continue Reading...