MvvmCross / MvvmCross-Tutorials

16 stars 25 forks source link

ToLayoutConstraints is obsolete #19

Closed yaliashkevich closed 8 years ago

yaliashkevich commented 8 years ago

Just noticed that FluentLayout.ToLayoutConstraints() is obsolete now. I often use it like this:

        var c = _title.AtBottomOf(_view).ToLayoutConstraints().First();
        c.Active = false;
        //something happened and I need update constrains
        c.Active = true;

Propose to and "Active" property to FluentLayout if you want make resulting constraint private. So I will be able to keep reference to FluentLayout instead of NSConstraint and update Active value when needed. That is common technique I use to implement collapse/expand cases, or hide single view inside large hierarchy if there is nothing to display in this view (making couple of constraints active/inactive is good alternative for removing all and reacreating whole set of constraints again).

yaliashkevich commented 8 years ago

Posted here instead: 'https://github.com/FluentLayout/Cirrious.FluentLayout/issues/29'