HandyControl icon indicating copy to clipboard operation
HandyControl copied to clipboard

Button height doesn't work well in Designer View. [WPF]

Open JasperCalapini opened this issue 2 years ago • 1 comments

The height of button do not adapt properly on designer that view. This works when I run the program but not 'quite' in the designer view.

example:

<Grid>
<Button Height="auto" 
        VerticalAlignment="Stretch"
        HorizontalAlignment="Stretch"
        Text="Fill the Grid">
</Grid>

In the designer's view, only the HorizontalAlignment="Stretch" works. When I look at the properties on the Button, It says Auto (30). When I set a constant height like Height="10" then set it back Height="auto", The VerticalAlignment="Stretch" work.

Screenshots

handycontrol_button_bug_height_in_designer_view_ss1 handycontrol_button_bug_height_in_designer_view_ss2 handycontrol_button_bug_height_in_designer_view_ss3 handycontrol_button_bug_height_in_designer_view_ss4

Environment

  • .net : 4.8.04084
  • IDE : Microsoft Visual Studio Community 2019
  • Version : 16.11.5

Additional context when you reopen the project/xaml, the VerticalAlignment won't work again, height will again auto(30) on the properties. Same if you increase the font size.

It works on Runtime but It would be nice if it works on designer view as well. I am new to this wpf/programming and trying this wonderful

JasperCalapini avatar Nov 06 '21 02:11 JasperCalapini

It is very common for weird issues to occur in the wpf designer. Most people would advise you not to use it, as it creates all sorts of problems. Often the app appears normal in the designer but turns out horrible on runtime (or the other way around). I would advise you to don't rely on the designer and write your own xaml code and use "xaml hot reload" to view changes.

This issue has got nothing to do with HandyControls but with the designer itself.

6outtaTen avatar Feb 01 '22 21:02 6outtaTen

It is very common for weird issues to occur in the wpf designer. Most people would advise you not to use it, as it creates all sorts of problems. Often the app appears normal in the designer but turns out horrible on runtime (or the other way around). I would advise you to don't rely on the designer and write your own xaml code and use "xaml hot reload" to view changes.

This issue has got nothing to do with HandyControls but with the designer itself.

NaBian avatar Mar 07 '24 05:03 NaBian