private bool CallOnNavigatedFrom(UserControl page, UserControl newPage) { var method = page.GetType().GetTypeInfo().GetDeclaredMethod("OnNavigatedFrom"); if (method != null) { if (method.GetParameters().Count() == 1) { var finishedAction = new Action(() => { Window.Current.Dispatcher.Invoke( Windows.UI.Core.CoreDispatcherPriority.Normal, delegate { SetPage(newPage); CallOnNavigatedTo(newPage); }, page, null); }); method.Invoke(page, new object[] { finishedAction }); return true; } } SetPage(newPage); CallOnNavigatedTo(newPage); return false; }
static public void ExampleControlCreated(string name, UserControl control) { if (control.GetType() == typeof(DeveloperTools)) return; exampleControls.Add(new KeyValuePair<string, WeakReference<UserControl>>(name, new WeakReference<UserControl>(control))); }
public async static void Close(UserControl viewToClose) { foreach (var child in PopupService._rootControl.Children) { if (child.GetType().Name == "PopupView") { PopupView pv = (PopupView)child; if (pv.MainContent.GetType().Name == viewToClose.GetType().Name) { pv.Hide(); return; }; } } }
public static bool IsToolbarVisible(UserControl viewToInterogate) { bool ret = false; foreach (var child in PopupService._rootControl.Children) { if (child.GetType().Name == "PopupView") { PopupView pv = (PopupView)child; if (pv.MainContent.GetType().Name == viewToInterogate.GetType().Name) { return pv.ToolbarIsVisible; }; } } return ret; }
private async static void Move( UserControl viewToMove, Thickness margin, SumoNinjaMonkey.Framework.Controls.PopupView.eCalloutAlign calloutAlign ) { foreach (var child in PopupService._rootControl.Children) { if (child.GetType().Name == "PopupView") { PopupView pv = (PopupView)child; if (pv.MainContent.GetType().Name == viewToMove.GetType().Name) { //pv.Margin = margin; pv.Move(margin.Left, margin.Top); pv.CalloutAlign = calloutAlign; return; }; } } }
private void CallOnNavigatedTo(UserControl page) { var method = page.GetType().GetTypeInfo().GetDeclaredMethod("OnNavigatedTo"); if (method != null) method.Invoke(page, null); }