private async void ToggleSheetVisibility(bool shouldOpen) { if (m_modalityLayout == null) { return; } if (shouldOpen) { m_sheetView = new SheetView(this); if (SheetContentTemplate != null) { SheetContent = (View)SheetContentTemplate.CreateContent(); } SetupSheet(); await m_sheetView.Open(); } else { if (m_sheetView is null) { return; } BeforeClosing(); m_sheetView.Close(); m_modalityLayout.Hide(m_sheetView); } }