Welcome to WindowsClient.net | Sign in | Join

Rob Relyea - XAMLified

WPF, Silverlight and XAML

Syndication

Sponsors





  • advertise here
XamlPadSample-Step 1d-Window

My Window now works exactly like I want:

  1. remembers WindowState it was in (Maximized, Restored, Minimized, FullScreen)
  2. remembers monitor is was on
  3. remembers where to restore to.

I had to use a bit more code that I would have liked, but it all is good. (Ideally, WPF Window can be improved to make this scenario work with a bit less code. Until then, the workarounds could likely be factored into a nice attached behavior…but I’m not planning on doing that. Thanks to Joe/Eric for helping me work through those issues.)

[overview of project: XamlPadSample page –today’s source snapshot: 2010-01-24 Source Snapshot]

Update to Backlog.txt in Source:

--------------------------------------------- 
2010/01/24 - posted v1d - Window - focused on more fixes to Window remembering state
--------------------------------------------- 
Fixed: Maximized or fullscreen windows on 2nd monitor will launch on primary monitor after relaunch. (thanks Joe)

XamlPadHelpers project
•XamlPad.xaml
◦Added AcceptsTab="True" to TextBox, so I can put a tab into the textbox.
   (TODO: should I add a feature to turn a tab into spaces?)

XamlPadSample project
•MainWindow.xaml
◦Removed binding to Window.WindowState. In order to fix the maximize on 2nd monitor bug, I had to move this to code.
    (Ideally Window should have worked like I tried. Bugs are opened.)

•MainWindow.xaml.cs
◦Dealt with WindowState after the window source was initialized.
◦In closing handler, worked around issue where sometimes the saved height and width was full screen, even after I Restored the window.

Published Sunday, January 24, 2010 6:56 AM by Rob_Relyea

Comments

# Dew Drop – January 24, 2010 | Alvin Ashcraft's Morning Dew@ Sunday, January 24, 2010 2:34 PM

Pingback from  Dew Drop – January 24, 2010 | Alvin Ashcraft's Morning Dew

Leave a Comment

(required) 
(required) 
(optional)
(required) 
Page view counter