migrated layerpanel to partial class of MainWindow