I hate presenting the last

29 03 2010

I was to give a five minute teaser presentation on an upcoming event tonight. The turnout to the main event wasn’t overwhelmingly great to begin with. Whenever a presentation is outside of normal work hours, only the truly interested and the truly hungry show up.

Tonight’s main presentation was on WPF and on my colleagues’ use of nHibernate in their project. It was a good presentation, but way too long. After two hours and forty minutes (the length of Avatar) I got the chance to give my presentation to a virtually empty room. This isn’t the first time I’ve been in this situation. Going last always means your audience is tired and sometimes less attentive than an hour ago.

I much appreciate my friends taking the time to create such an in depth presentation; but next time, I’ll go first.

1262156521418





Three ideas for Windows Phone 7 apps

1 03 2010

Since I’m expecting to get a WP7 SDK at MIX10, I’ll have to start thinking about what kind of applications to create with it. I like applications that make my life better, but not necessarily improves the life of everyone. Or to put it in another way, apps with narrow applications. Windows Phone 7 Applications 4chan SJ

After the break

Application ideas

Read the rest of this entry »





Silverlight Facebook Client

17 02 2010

Ever since the WPF Facebook app was shown at PDC09 back in October, I’ve been wanting to get my hands on a similar demo. This is a Silverlight application which takes the Facebook API and makes an entire client for it. This is comparable to what Tweetdeck is for twitter. If you’re interested in either Silverlight or Facebook, you should check this out!

Silverlight Facebook App

http://www.silverlight.net/content/samples/apps/facebookclient/

More screenshots after the break –>

Read the rest of this entry »





Side Projects

21 12 2009

I’ve been keeping busy lately. Here is a list of the side-projects I’m currently working on:

  • Creating an e-commerce site for the company Prinsessan Kawaii completely in Silverlight
  • The ChanBrowser. An imagebrowser that browses certain image forums and extracts images without any side text (WPF). See posts HERE AND HERE
  • Presentations about Silverlight4. Gave one two weeks ago. Am scheduled to give one in Stockholm and one in Finland next month.
  • Leveling a Warrior, a Shaman and a Rogue to lvl80 in World of Warcraft. This takes at least as much time as developing e-commerce sites.
  • Creating a mobile mobile device demo for a large Swedish retailer
  • Creating a Microsoft Surface concept for one of my favorite companies. Personal touch is always nice.

I hope to give insight in as many of these projects as I can. Hard work is hard but I always manage to slip some time in to my side-projects.

Merry Christmas





Creating Silverlight animations easily with Blend

15 12 2009

By far the best part with Expression Blend for me is how laughingly easy it is to create animations in a quick and easy way. I’m going to demonstrate how we create a simple two object animation which I can use in Silverlight.

Expression Blend

Read the rest of this entry »





My take on Silverlight 4 at PDC

20 11 2009

As of yesterday, the Silverlight 4 beta is available to everyone (with VS2010). Since I’m currently working on this darned mobile app, I haven’t had a chance to test it but some of the changes seem very nice. I’ve been working quite a bit on a webshop created solely in Silverlight and know that some of the new features could be useful.

microsoft-silverlight-logo

I think that I’ve personally most been wanting the Rich Text Editor for some time now. That’ll come plenty in handy when presenting and recording information. Data Grid is of course a huge item that many developers have been pining for which now will make “serious” apps more viable.

The fact that Silverlight is being enabled out of browser with elevated permissions is not only an interesting change of scope but also begs the question: now that Silverlight is OOB and WPF is enabled online, how big are the differences really and will we see a merger within a year or two of the two technologies? Of the two, Silverlight has by far the sexier name if nothing else.

I’ll be updating more as I try out the new beta sometime next week. Until then, all I can offer are a couple of nifty links.

Silverlight 4 SDK

Silverlight toolkit (updated)

Channel 9 course on SL4

Documentation





Opening a folder in Windows Explorer with WPF

17 11 2009

Today on my way to work I was working on a button for my Imageviewer. The button was supposed to open the download folder to which the user had chosen to save his/her images. 

image 
To open a folder in WPF we use the following code:

            //Go to the specified folder

            var runExplorer = new System.Diagnostics.ProcessStartInfo();

            runExplorer.FileName = "explorer.exe";

            runExplorer.Arguments = @"C:\Downloads\";

            System.Diagnostics.Process.Start(runExplorer);

“explorer.exe” here refers to the Windows Explorer and its arguments are equal to the path where we want to go. It’s a fairly simple script but very useful.

 

Today’s song (Click for Spotify link)

image





Imageboard viewer almost done – Needs tweaking

16 11 2009

As I mentioned before, I’ve been working on an image extractor for a specific image board as a way to hone my .net skills. It’s almost done in the sense that “it works on my computer”.

image

This is the look of it at the moment. The gradient background is kind of an inside joke and those of you who get it, good for you.

The idea is for users to be able to look at multiple pages of image content without having to click through pages or read lots of useless banter. Take for instance this wallpaper-board. The user can request any number of available pages to be presented and then click on an image to see it in full resolution. Very effective.

image

My problem at this point is that since I developed the app using Visual Studio 2010, all references are to .net framework 4.0 and unusable to most people. A friend of mine who tested the application also complained about it stopping when trying to save the pictures. I guess the apps main thread stalls while downloading. That’s something else I’ll have to look at.





“Boxmarking” in Visual Studio 2010

14 11 2009

I’ve been trying out the Visual Studio 2010 beta for a week now and I love it. One of my favorite features is the boxmarking which VS now allows. This is nothing new but is incredibly useful when editing code.

In my sideproject, the Imageboard-Viewer, I wanted to apply a Style template to a list of ComboBoxItems. In Visual Studio 2008, I’d been forced to copy paste the text and change rows a million times (there are more items than visible here, although maybe not a million) .

imageWhat I did instead was hold down Alt while dragging a thin vertical box and pasting my code once. This resulted in the same text being pasted to each row.

image

I also got a chance to use boxmarking when copying multiple values. I wanted to set the content of the ComboBoxItems according to names. As is visible in the above picture, I had several different values to copy.

image Boxmarking makes this an easy and quick task to complete. Imagine the time saving possibilities when handling hundreds of rows at the same time.

Now I just write the word Content and paste my names

image





Custom control in WPF / Silverlight with XAML

14 11 2009

I’m currently working on a little side-project in WPF. A sort of imageviewer for imageboards. Since I want as much windowspace as possible for the images, I decided to put some of my icons on top of the image thumbnails. This proved hard to do. I therefore made a Custom Class called “MainImage”. This class will display both the original image (named here BackgroundImage) and two icons which I later added eventhandlers to to capture clicks. This worked out wonderfully well. The result is something like this:

image

First two normal images are put into my WrapPanel, then the third is my custom MainImage. Notice how it looks similar to the first two images but with the added icons on it. These icons are linked to two different event handlers in my codebehind. And thanks to my custom class, I can generate these custom images dynamically in my codebehind.

Tip: If you name your elements in a custom class (as I named my BackgroundImage ), you can set them and their properties in the codebehind just like any other property.

HowTo: To create a customclass, just rightclick your project in the Solution Explorer, choose “Add User Control” and choose a name for your control. You will now have a new item called YourName.xaml which in turn has a .cs file associated with it.

Here is the code I used for my MainImage control.

<UserControl x:Class="MyProject.MainImage"

            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;

            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml&quot;

            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006&quot;

            xmlns:d="http://schemas.microsoft.com/expression/blend/2008&quot;

            mc:Ignorable="d" d:DesignHeight="200" d:DesignWidth="200">

 

    <Grid>

        <Grid.RowDefinitions>

            <RowDefinition Height="2*" />

            <RowDefinition Height="1*" />

        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>

            <ColumnDefinition Width="*"/>

            <ColumnDefinition Width="*"/>

            <ColumnDefinition Width="*"/>

        </Grid.ColumnDefinitions>

       <Image Name="BackgroundImage" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" Grid.ColumnSpan="3" />

       <Image Name="ThreadImage" Source="Images/icon.png" Grid.Column="0" Grid.Row="1" Height="15" Width="15" />

       <Image Name="BrowserImage" Source="Images/icon.png" Grid.Column="1" Grid.Row="1" Height="15" Width="15" />

    </Grid>

</UserControl>