Add support for Auto for Width and Height properties
See original GitHub issueRepro:
<DockPanel LastChildFill="True" Background="Pink">
<DockPanel LastChildFill="True" Width="180" DockPanel.Dock="Left">
<Border Background="Red" Width="180" Height="250" DockPanel.Dock="Top"/>
<Border Background="Blue" Width="180" Height="Auto" DockPanel.Dock="Bottom"/>
</DockPanel>
<DockPanel LastChildFill="True" Width="240" DockPanel.Dock="Right">
<Border Background="Green" Width="240" Height="250" DockPanel.Dock="Top"/>
<Border Background="Orange" Width="240" Height="Auto" DockPanel.Dock="Bottom"/>
</DockPanel>
<Grid>
<Border Background="Gray" Width="300" Height="300"/>
</Grid>
</DockPanel>
Exception:
Portable.Xaml.XamlObjectWriterException
HResult=0x80131500
Message=Could not convert object 'Auto' (of type System.String) to {http://schemas.microsoft.com/winfx/2006/xaml}Double: Auto is not a valid value for Double.
Source=Avalonia.Markup.Xaml
StackTrace:
at Portable.Xaml.XamlObjectWriterInternal.GetCorrectlyTypedValue(XamlMember xm, XamlType xt, Object value)
at Portable.Xaml.XamlObjectWriterInternal.StoreAppropriatelyTypedValue(ObjectState state, MemberAndValue ms, Object obj, Object keyObj)
at Portable.Xaml.XamlObjectWriterInternal.OnWriteValue(Object value)
at Portable.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
at Avalonia.Markup.Xaml.AvaloniaXamlLoader.LoadFromReader(XamlReader reader, AvaloniaXamlContext context, IAmbientProvider parentAmbientProvider)
at Avalonia.Markup.Xaml.AvaloniaXamlLoader.Load(Stream stream, Assembly localAssembly, Object rootInstance, Uri uri)
at Avalonia.Markup.Xaml.AvaloniaXamlLoader.Load(Type type, Object rootInstance)
at Avalonia.Markup.Xaml.AvaloniaXamlLoader.Load(Object obj)
at Core2D.Avalonia.Views.MainControl.InitializeComponent() in D:\DOWNLOADS\GitHub-Avalonia\Core2D\src\Core2D.Avalonia\Views\MainControl.xaml.cs:line 26
at Core2D.Avalonia.Views.MainControl..ctor() in D:\DOWNLOADS\GitHub-Avalonia\Core2D\src\Core2D.Avalonia\Views\MainControl.xaml.cs:line 18
Inner Exception 1:
Exception: Auto is not a valid value for Double.
Inner Exception 2:
FormatException: Input string was not in a correct format.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Allow 'auto' value for width/height attributes of image tags ...
1 Answer 1 ... While the CSS attributes width and height support the auto value, the HTML attributes width and height do not...
Read more >Setting Height And Width On Images Is Important Again
To prevent layout shifts and improve performance scores, we need to always set width and height attributes on our images.
Read more >Everything About Auto in CSS
In CSS, we have the value auto which could be used for properties like margin, positioning, height, width, and a lot more.
Read more >CSS Height, Width and Max-width
The height and width properties are used to set the height and width of an element. The height and width properties do not...
Read more >Explore auto layout properties
You can set minimum or maximum width and height to any auto layout frame and its children. Open the Width dropdown to find...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Wow, I didn’t even know this was supported in WPF. Yes we should do this too.
It works now with Combobox.HorizontalAlignment set to Stretch.