public static Label add_Label(this ascx_Xaml_Host xamlHost, string text)
        {
            var label = add_Control <Label>(xamlHost);

            label.set_Text_Wpf(text);
            //"in add_Label".debug();
            return(label);
        }
Пример #2
0
        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;
     }));
 }
 public static StackPanel add_StackPanel(this ascx_Xaml_Host xamlHost)
 {
     return(add_Control <StackPanel>(xamlHost));
 }
 public static Grid add_Grid(this ascx_Xaml_Host xamlHost)
 {
     return(add_Control <Grid>(xamlHost));
 }
Пример #6
0
 public static WpfTextEditor add_WpfTextEditor(this ascx_Xaml_Host control)
 {
     return(control.add_Control <WpfTextEditor>());
 }