KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've got a WPF window with SizeToContent="Height" . This window contains an <Expander /> that displays a list of recent activity. What I'd like is when the expander is expanded the window grows in size proportionally. When hidden the window again resizes proportionally. If the window is resized the expander and it's contained list view should grow to use the new space. (don't mind the colors there there to help me figure this out): Normal View alt text http://www.deploylx.com/so/wpfexpander/Open.png Collapsed alt text http://www.deploylx.com/so/wpfexpander/Closed.png Resized to new space alt text http://www.deploylx.com/so/wpfexpander/Expanded.png So far this works great. The problem comes when the <Expander /> is collapsed after the window is resized. Rather than the window collapsing again, the list view is simply hidden: Collapsed after Resize alt text http://www.deploylx.com/so/wpfexpander/Collapsed.png My intuition tells me that the Height of the window is being set when the window resizes and thus overrides the SizeToContent property. So, how can I get the window to keep it's size to content behavior after it's been resized? Current XAML: <Window x:Class="DeployLX.Licensing.Nlm.Admin.v3.DashboardWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Dashboard" Width="
Tags (comma-separated)
Save Edits
Cancel