Remember/restore state, suppress collapse button

Aug 18, 2010 at 6:00 PM
Edited Aug 18, 2010 at 6:03 PM

Q1: How to remember control state:

 Active button

Button client area height

Control width

in isolated storage and restore them if application is running again ?

Q2: I added gridsplitter which allows to set outlookbar width incrementally. After this collapse button (in upper right corner) causes narrow outlookbar to appear in center of column. This is ugly.

How to add click event handler to collapse button and suppress its default behaviour or force Grid column to contract/expand if collapse button is pressed?

Layout is:

<Grid >

<Grid.ColumnDefinitions>

<ColumnDefinition Width="180" /> <ColumnDefinition Width="*" />

</Grid.ColumnDefinitions>

<my:OutlookBar Visibility="Collapsed" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Name="Menu" />

<swc:GridSplitter Width="2" Foreground="Black" VerticalAlignment="Stretch" />

....