Archives for: March 2006

Pages: 1 2 3 4 5 >>

29/03/06

Permalink 05:52:58 pm
Categories: General

iVI in ESC ^yw$p LEFT rS

I didn’t know this: http://www.viemu.com/index.html

I believe some people think I’m a pervert because I sometimes use VIM on Windows and I actually know how to edit stuff with that thing. Even worse, I think it’s a great little editor. But… well, it looks as if there are a lot of people crazier than me – they are using VI embedded in Visual Studio, and they pay $49.95 (excl. VAT, and only as an introductory offer) for the privilege. Count me out there… I think a little evolution every now and then is not a bad thing.

And if you happen to work for NGEDIT Software: do you have a clue what a very important reason was for VI to become as popular as it did? Easy: it’s been either “just there” on all the Unix systems of the past, or it’s been free to get and install. Just something that comes to mind…

Update March 2008: Amazing - now it's $79!

25/03/06

Permalink 03:49:11 pm
Categories: General, .NET

Vista 5308: VS 2005 can't deal with composition?

VS 2005 has been the only application so far in which I have found a problem that’s clearly related to incompatibility with the new desktop composition done by DWM (Desktop Window Manager). It works for the most part, but apparently it has problems calculating the positions of certain on-screen elements. For example, with composition activated, the Intellisense popup always appears in front of the text I’m editing. Really just a small issue, but a pretty important one…

Switching desktop composition off for VS helps – Vista deactivates composition for the time where VS is running and re-activates it again afterwards. Not nice, because it also deactivates nice things like flip-3d task switching… does anyone know of a better solution?

Permalink 03:41:45 pm
Categories: General, Programming, .NET

WPF: Always remember rebuilding the solution

This is one funny thing I found while fiddling around with WPF, Cider and the other parts from the newest CTP release: every now and then it’s required to rebuild the complete solution. I suppose it’s not meant to be that  way, but I’ve had all kinds of interesting effects. One time there was a weird exception coming up at runtime, telling me that a Button can’t be cast to a ListBox. The other time it was just some initialization code for a control that was apparently being executed, but didn’t have any effect. Rebuilding the complete solution helped in both cases and my guess is that the problem came up when I made some changes to the XAML code of a window.

So if your WPF app seems to behave oddly, always remember rebuilding the solution – it might help.

Permalink 03:32:50 pm
Categories: General, Programming, .NET

WPF: Using controls as content

One of the fantastic new features in WPF is the way many controls can use other controls (and a lot of other things apart from what would usually be regarded as controls) as content. I wanted to try this out, and I created a little sample program.

I started with a small WPF application that has a window with a ListBox control in it. Then I created the following class:

   public class WowContent: StackPanel {
        public WowContent(params string[] entries) {
            Orientation = Orientation.Horizontal;

            Button button = new Button();
            button.Content = "Click!";
            Children.Add(button);
            listBox = new ListBox();
            data = new List<string>(entries);
            listBox.ItemsSource = data;
            Children.Add(listBox);
        }

        ListBox listBox;
        List<string> data;
    }

This class derives from a WPF StackPanel, which is one of the container classes. In this case, the controls inside the StackPanel are just “listed”, one behind the other. The extended StackPanel I created contains a button and a ListBox, which in turn is bound to a list of strings.

Now I wanted to initialize the main ListBox on the form with a list of WowContent instances. I created the following method for this:

        public void BindStuff() {
            List<WowContent> list = new List<WowContent>();
            list.Add(new WowContent("Hi", "there"));
            list.Add (new WowContent());
            list.Add (new WowContent("Another", "entry", "with", "more", "text"));
            listBox1.ItemsSource = list;
        }

My first try was to call this method in the window’s constructor, after the call to InitializeControl. But I found that this is not possible for some reason, it always results in an exception thrown from the Application.Run method: Error at element '' in markup file 'Window2.xaml' : Exception has been thrown by the target of an invocation. I guess this has something to do with the initialization process of XAML windows.

I created this method instead, which made things work:

        protected override void OnInitialized(EventArgs e) {
            base.OnInitialized(e);

            BindStuff();
        }

The result of all this, magically, looks like this:

Contentcontrols

21/03/06

Permalink 06:40:16 pm
Categories: General, Programming, .NET

DDD 3 session voting has started!

Session proposals for Developer Developer Developer day 3 are closed and voting has been opened today. Be sure to put your check marks in the right places if you want to see any of the sessions I submitted!

By the looks of it there are loads of interesting things to see on the day, so I recommend everybody should definitely take the time to cast his/her vote and of course to be there!

1 2 3 4 5 >>

Enter your email address:

Search

Oliver
MVP logo
March 2006
Sun Mon Tue Wed Thu Fri Sat
 << < Current> >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31