public static Task ShowDrawer <T>(DrawerDirection direction = DrawerDirection.Right) { UserControl?view = CreateView <T>(); if (view == null || ShowingDrawer == null) { return(Task.CompletedTask); } return(ShowingDrawer.Invoke(view, direction)); }
public static Task ShowDrawer(object view, DrawerDirection direction = DrawerDirection.Right) { if (!(view is UserControl control)) { throw new Exception("Invalid view"); } if (ShowingDrawer == null) { return(Task.CompletedTask); } return(ShowingDrawer.Invoke(control, direction)); }