sizetocontent

Get ListBox to resize with window, but not resize with content

旧巷老猫 提交于 2021-02-08 12:24:11
问题 There must be an elegant solution to this problem, but I can't find anything online. I have a grid that has one column and row with width/height *, containing a ListBox. I have my Window SizeToContents set to WidthAndHeight to allow the window to resize to the proper size for each set of UI widgets/fonts. When I add items to the ListBox, it resizes, causing the window to grow. I want the ListBox to resize if I change the size of the window, but if I add content that is longer than the width

wpf center child window not working with sizetocontent

穿精又带淫゛_ 提交于 2019-12-23 07:26:41
问题 If i set SizeToContent to WidthAndHeight , then WindowStartupLocation="CenterOwner" does not work properly. Instead of the center of the new window to be at the center of its parent owner, it looks more like the top left hand corner of the child window to be at the center of the parent. If i remove SizeToContent then all is ok. What is wrong? 回答1: When a window is shown, it is measured, then WindowStartupLocation is processed using the ActualWidth and ActualHeight of the window computed by

Determine size of SizeToContent WPF Window before its rendered

ぐ巨炮叔叔 提交于 2019-12-21 07:29:25
问题 I have a window in my WPF application that is displayed on occasion. When it is shown it is faded in with an annimation, and when closed it is faded out. Nothing fancy, just a storyboard that modifies the opacity. Actually the window is never really closed, the opacity is just faded out to 0 where it remains until its to be displayed again. This window is an informative window and doesn't always show the same content. It is sized to content (Width and Height) and works well in that regard.

Xamarin.Forms ListView size to content?

怎甘沉沦 提交于 2019-12-04 11:23:27
问题 I have a pretty large form (adapted mainly for tablets), that has a TabbedPage nesting a ScrollView and a vertical StackPanel containing many controls. I have few occurrences where I have a ListView that contains a few single-line items, and I need it to size to content. I'd like to get rid of its scroll-bars, but anyway I don't want it to take up more space than what's required for its items. Is there a way (even an ugly one) to achieve that without have to write a renderer x3 platforms?

Determine size of SizeToContent WPF Window before its rendered

余生颓废 提交于 2019-12-04 01:32:17
I have a window in my WPF application that is displayed on occasion. When it is shown it is faded in with an annimation, and when closed it is faded out. Nothing fancy, just a storyboard that modifies the opacity. Actually the window is never really closed, the opacity is just faded out to 0 where it remains until its to be displayed again. This window is an informative window and doesn't always show the same content. It is sized to content (Width and Height) and works well in that regard. The user chooses the basic area of the screen for it to be displayed (TopLeft, TopRight, Center,

Xamarin.Forms ListView size to content?

最后都变了- 提交于 2019-12-03 07:15:50
I have a pretty large form (adapted mainly for tablets), that has a TabbedPage nesting a ScrollView and a vertical StackPanel containing many controls. I have few occurrences where I have a ListView that contains a few single-line items, and I need it to size to content. I'd like to get rid of its scroll-bars, but anyway I don't want it to take up more space than what's required for its items. Is there a way (even an ugly one) to achieve that without have to write a renderer x3 platforms? Here's a pseudo describing my tree: <ContentPage> <MasterDetailPage> <MasterDetailPage.Detail> <TabbedPage

How do you keep the WPF window sized to content with an Expander after resize

元气小坏坏 提交于 2019-12-03 04:04:15
问题 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