[forms-devel] Should the Popped event be raised when PopToRoot is called.

johan.kson at gmail.com johan.kson at gmail.com
Wed May 25 06:48:54 UTC 2016


One last question before writing the proposal. What would break in the code base if we create a new signature where the new event args inherit from the old?

OnDuck(sender, ArgsA) becomes OnDuck(sender, ArgsB) where ArgsB inherit from ArgsA. 

That should be considered a non modifying extension of the code (open/closed principal?). 

Old code would still only see the old args and new code can take advantage of the new args.

I'm sure you are absolutely right when saying this would break something. I'm just trying to understand what I'm missing? Is it a strict policy not to change signatures even through inheritance of arguments?

Best regards

Johan

Skickat från min iPhone

> 24 maj 2016 kl. 19:45 skrev Jason Smith <jason.smith at xamarin.com>:
> 
> Just realize I accidentally the entire conversation off the mailing list.
> 
> I hate mailing lists for this reason...
> 
>> On Tue, May 24, 2016 at 10:37 AM, Jason Smith <jason.smith at xamarin.com> wrote:
>> We could do that yes, it would however be "hidden" API because we couldn't actually change the signature of the event. If you know about it and are will to cast though that is probably the best solution. Consider proposing a spec to the https://github.com/xamarin/xamarin-evolution repo :)
>> 
>>> On Tue, May 24, 2016 at 10:17 AM, <johan.kson at gmail.com> wrote:
>>> What about adding to the event args? I do understand that one simply can't add stuff without carefully considering it so I will not argue about that. 
>>> 
>>> This wouldn't break anything. 
>>> 
>>> class PopToRootEventArgs : NavigationEventArgs
>>> {
>>>     public List<Page> PoppedPages {...}
>>> }
>>> 
>>> I will not trouble you again with this, just want to make sure you considered the event args option. :)
>>> 
>>> // Johan
>>> 
>>> Skickat från min iPhone
>>> 
>>>> 24 maj 2016 kl. 19:02 skrev Jason Smith <jason.smith at xamarin.com>:
>>>> 
>>>> We could consider another event, however it does result in some ugliness for consumers, it just makes the entire process much uglier in general to use.
>>>> 
>>>> We need to weight waiting for quirks against doing this now and being saddled with a bad API forever :/
>>>> 
>>>>> On Tue, May 24, 2016 at 9:37 AM, <johan.kson at gmail.com> wrote:
>>>>> Hi!
>>>>> 
>>>>> I figured that might be the case. Could we find an alternative way? Adding another event or extension point without cluttering the architecture?
>>>>> 
>>>>> Perhaps adding an property to the event args passed in PoppedToRoot that contains a list of pages that are dismissed? This wouldn't break any existing behavior and would be nicely tucked away in the only place where this would matter. 
>>>>> 
>>>>> In my case I need to loop through them to deregister stuff. 
>>>>> 
>>>>> Best regards. 
>>>>> 
>>>>> // Johan
>>>>> 
>>>>> Skickat från min iPhone
>>>>> 
>>>>>> 24 maj 2016 kl. 18:11 skrev Jason Smith <jason.smith at xamarin.com>:
>>>>>> 
>>>>>> Unfortunately this may result in behavioral changes which could break some users apps. This means this suggestion is more or less dead in the water until we get our quirks mode developed.
>>>>>> 
>>>>>> Jason
>>>>>> 
>>>>>>> On Tue, May 24, 2016 at 8:41 AM, Johan Karlsson <johan.kson at gmail.com> wrote:
>>>>>>> Hi!
>>>>>>> 
>>>>>>> My summary and suggested conceptual change is in this post
>>>>>>> 
>>>>>>> https://forums.xamarin.com/discussion/66155/poptoroot#latest
>>>>>>> 
>>>>>>> Good idea? Bad idea?
>>>>>>> 
>>>>>>> Best regards 
>>>>>>> 
>>>>>>> // Johan
>>>>>>> 
>>>>>>> _______________________________________________
>>>>>>> forms-devel mailing list
>>>>>>> forms-devel at lists.xamarin.com
>>>>>>> http://lists.ximian.com/mailman/listinfo/forms-devel
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/forms-devel/attachments/20160525/057a8661/attachment-0001.html>


More information about the forms-devel mailing list