public static GraphLayout add_Graph(this ascx_Xaml_Host xamlHost) { return((GraphLayout)xamlHost.invokeOnThread( () => { var zoom = xamlHost.element().add_Zoom(); var graphLayout = zoom.set <GraphLayout>(); graphLayout.newGraph(); graphLayout.defaultLayout(); return graphLayout; })); }
public static T add_Control <T>(this ascx_Xaml_Host xamlHost) where T : UIElement { return((T)xamlHost.invokeOnThread( () => { try { var wpfControl = typeof(T).ctor(); if (wpfControl is UIElement) { xamlHost.element().Child = (UIElement)wpfControl; return (T)wpfControl; } } catch (Exception ex) { ex.log("in add_Control"); } return null; })); }