Archives

Archives / 2008 / November
  • WPF Learnings - Drawing on Multiple Monitors

    Writespace Some time ago I wrote a fullscreen editing environment add-in for Word to learn some WPF and some Office Ribbon stuff. The editor is called Writespace and is now available om Codeplex as open source.

    Scott Hanselman was kind enough to take a few minutes and review the first draft of the editor and told me I should support multiple monitors and that I could look at BabySmash code to see how he did it. Said and done, I downloaded the BabySmash code, dug into the multi-monitor stuff and found out it's not that strange.

    Writespace is a fullscreen editor, and when the user press CTRL+M I want to move the whole thing over to the next available monitor. First you may want to do some sanity check that you got more than one monitor available. This is easy enough with something like this:

    if (SystemInformation.MonitorCount < 2)

    {

        ...only one monitor available...

    }

     

    The different screens are available via the Screen.AllScreens[] array so once I've picked a screen to draw on I send it as a paramter to a CreateEditor() method:

    private static void CreateEditor(Screen screen)

    {

        var editor = new TextEditorWindow

                        {

                            WindowStartupLocation = WindowStartupLocation.Manual,

                            Left = screen.WorkingArea.Left,

                            Top = screen.WorkingArea.Top,

                            Width = screen.WorkingArea.Width,

                            Height = screen.WorkingArea.Height

                        };

     

        //setting up other stuff, like events and things here...

     

        editor.Show();

        editor.WindowState = WindowState.Maximized; //do this after Show() or won't draw on secondary screens

        editor.Focus();

    }

    The setting of WindowState to Maximized after Show() is a trick/workaround for something that seems to be a bug or something I don't grok about WPF in full screen and multiple monitors. The editor window itself has WindowStyle="None" ResizeMode="NoResize" set.

    Hope this helps someone.

  • Big Problems with iTunes and App Store

    itunesappstoreApple currently got what seems to be huge probs with iTunes and the iPhone App Store. People all over the world cannot log into iTunes App Store to buy and upgrade programs because of connection timeouts. Some people are taking it with a smile, I guess they're used to it:

    It's only 3:30AM in Cupertino. You don't expect an online store to be open in the middle of the night, do you?

    I wrote yesterday about my gripes with iTunes, and this sure doesn't make things better I can tell you. One would think that Apple had the App Store system spread out the world for concurrency and minimize problems like this, but apparently not.

  • iTunes and iPhone...

    Why is iTunes one of the most widespread, annoying, unresponsive but still CPU-munching program out there? Probably because you cannot sync your iPhone without installing it... It's amazingly bad and Apple has to do something about it.

    There... feels much better now, but I'm definitely getting closer and closer to that jailbreak decision.