FluentLayout / Cirrious.FluentLayout

FluentLayout for Xamarin.iOS - sample uses MvvmCross
Microsoft Public License
148 stars 54 forks source link

ToLayoutConstraints is obsolete #29

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

:) Just noticed that SetActive() is already here!

gshackles commented 8 years ago

You can also set the Active property directly, which will do the same thing.