public GLFormViewRenderer(GLHostedElement viewHost, OpenGLRenderKit kit,
                                  GLWindowsContext context)
            : base(viewHost, context)
        {
            _viewHost       = viewHost;
            _measureContext = kit.MeasureContext;
            _renderContext  = kit.RenderContext;
            _renderRect     = new Rectangle(0, 0, 1, 1);

            _context = context;
        }
Exemple #2
0
        public GLForm Show <TViewModel>(TViewModel viewModel,
                                        IView view)
        {
            //var styleContext = view.StyleContext;

            var control = new GLHostedElement(view, BaselineThemeProvider.Instance);
            var form    = new GLForm(control);

            view.DataContext = viewModel;
            //view.SetDataContext(viewModel);

            WindowShown?.Invoke(form);

            return(form);
        }
Exemple #3
0
        //public GLForm Show<TViewModel>(TViewModel viewModel,
        //                               IBindableElement view)
        //    //where TViewModel : IViewModel
        //{
        //    //var styleContext = view.StyleContext;
        //    //var styleContext = DefaultStyleContext.Instance;

        //    var control = new GLHostedElement(view);
        //    var form = new GLForm(control);

        //    view.DataContext = viewModel;
        //    //view.SetDataContext(viewModel);

        //    WindowShown?.Invoke(form);

        //    return form;
        //}

        public GLForm Show <TRectangle>(IView view,
                                        TRectangle rect)
            where TRectangle : IRectangle
        {
            // var styleContext = view.StyleContext;

            var control = new GLHostedElement(view,
                                              BaselineThemeProvider.Instance);
            var form = new GLForm(control);

            form.Bounds = new System.Drawing.Rectangle(
                Convert.ToInt32(rect.Left),
                Convert.ToInt32(rect.Top),
                Convert.ToInt32(rect.Width),
                Convert.ToInt32(rect.Height));


            WindowShown?.Invoke(form);

            return(form);
        }
Exemple #4
0
 public GLForm(GLHostedElement element) : base(element)
 {
     _element = element;
 }
Exemple #5
0
 public PanelRenderer(GLHostedElement control, GLWindowsContext context)
     : base(control, context)
 {
 }