Forum Discussion

tscholze's avatar
tscholze
Iron Contributor
Feb 13, 2020

Lessons learned: Updating an app from copied Duo lib files to Xamarin.Forms.DualScreen NuGet package

I just updated my https://github.com/tscholze/xamarin-road-to-surface-duo to use the freshly released https://www.nuget.org/packages/Xamarin.Forms.DualScreen/4.5.0.282-pre4. That's why I wanna share my lessons learned, maybe some will be for others obvious, maybe not.

 

Do not forget

  • Update Xamarin.Forms package, to the latest pre-release (don't forget to mark the checkbox)
  • Install the Xamarin.Forms.DualScreen package, it's a pre-release (don't forget to mark the checkbox)
  • Delete all old copy-and-pasted "Duo Lib" that you copy pasted from the very first sample project
  • Embed new namespace in duo-specific (e.g. master/detail pages) files

 

 

xmlns:dualScreen="clr-namespace:Xamarin.Forms.DualScreen;assembly=Xamarin.Forms.DualScreen"​

 

 

  • Update, usage of TwoPaneView to new syntax with child elements

 

 

<dualScreen:TwoPaneView>
    <dualScreen:TwoPaneView.Pane1>
        <views:ItemsView x:Name="MasterPane" />
    </dualScreen:TwoPaneView.Pane1>

    <dualScreen:TwoPaneView.Pane2>
        <views:ItemView x:Name="DetailPane" />
    </dualScreen:TwoPaneView.Pane2>
</dualScreen:TwoPaneView>​

 

 

  • Check if you set the config values correct in the MainActivity.cs to listen on Duo-specific changes 

 

 

ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize​​

 

 

Conclusion

It's great to see that you do not longer need copy & (w/p)asted files in your library. There are not really breaking changes. It took me max. an hour to update my app.

 

No RepliesBe the first to reply

Resources