Quantcast
Channel: AvalonDock
Viewing all articles
Browse latest Browse all 2690

Commented Issue: [verion 2.0] Autohiding anchorables does not store size information [15191]

$
0
0
I think that autohiding anchorables uses FloatWidth/FloatHeight to determine size of the sliding control.

However, when autohiding anchorable is resized, the information is not reflected to the model.


TO REPRODUCE THE BUG:

Try resize any autohiding anchorable, then dock it and set autohiding again. It will have the orginal size.

The same issue occurs after serialization/deserialization.
Comments: ** Comment from web user: yvm **

The AutoHideWidth and AutoHideHeight properties are stored but they not persisted - try Save in test app and see that these properties are not serialized. To fix this I had to modify LayoutAnchorable.cs as follow (the proper fix probbaly will do better job on minimizing stored info):

public override void ReadXml(System.Xml.XmlReader reader)
{
if (reader.MoveToAttribute("CanHide"))
CanHide = bool.Parse(reader.Value);
if (reader.MoveToAttribute("CanAutoHide"))
CanAutoHide = bool.Parse(reader.Value);
if (reader.MoveToAttribute("AutoHideWidth"))
AutoHideWidth = double.Parse(reader.Value);
if (reader.MoveToAttribute("AutoHideHeight"))
AutoHideHeight = double.Parse(reader.Value);

base.ReadXml(reader);
}

public override void WriteXml(System.Xml.XmlWriter writer)
{
if (!CanHide)
writer.WriteAttributeString("CanHide", CanHide.ToString());
if (!CanAutoHide)
writer.WriteAttributeString("CanAutoHide", CanAutoHide.ToString());
writer.WriteAttributeString("AutoHideWidth", AutoHideWidth.ToString());
writer.WriteAttributeString("AutoHideHeight", AutoHideHeight.ToString());

base.WriteXml(writer);
}


Viewing all articles
Browse latest Browse all 2690

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>