public Hit(PhoneApplicationPage page) { this.Title = page.Title; this.Path = page.GetType().Name; Events = new List<Event>(); }
/// <summary> /// Detach provided <paramref name="handler"/> from VisibleBoundsChanged event. /// </summary> /// <param name="page">Target page.</param> /// <param name="handler">Delegate to detach from the event.</param> /// <exception cref="NotSupportedException">Thrown if application is running on older version of /// Windows Phone than Windows Phone 8.1 Update 1.</exception> public static void VisibleBoundsChangedRemove(this PhoneApplicationPage page, EventHandler handler) { EnsureVersion(); EventInfo eventInfo = page.GetType().GetEvent("VisibleBoundsChanged"); Delegate convertedHandler = Delegate.CreateDelegate( eventInfo.EventHandlerType, handler.Target, handler.Method); eventInfo.RemoveEventHandler(page, convertedHandler); }
/// <summary> /// Get the VisibleBounds value from provided <see cref="PhoneApplicationPage"/> /// </summary> /// <param name="page">Target page.</param> /// <returns>Current Visible Bounds value.</returns> /// <exception cref="NotSupportedException">Thrown if application is running on older version of /// Windows Phone than Windows Phone 8.1 Update 1.</exception> public static Thickness GetVisibleBounds(this PhoneApplicationPage page) { EnsureVersion(); return((Thickness)page.GetType().GetProperty("VisibleBounds").GetValue(page)); }