예제 #1
0
        public WindowFactory <TWindow> HasPanel <TArea, TAreaData>(Func <TWindow, TAreaData> selector, AreaLayout layout = null)
        {
            OnSetAreasForWindowDrawer += w =>
            {
                var typedViewModel = w.ViewModel as TWindow;
                if (typedViewModel == null)
                {
                    return;
                }
                var area = (Area <TAreaData>)Activator.CreateInstance(typeof(TArea));
                InvertApplication.Container.Inject(area);
                area.DataSelector = () => selector(typedViewModel);
                area.Layout       = layout ?? new AreaLayout(0, 0, 16, 16);
                w.Drawers.Add(area);
            };

            return(this);
        }
예제 #2
0
        public WindowFactory <TWindow> HasPanel <TArea, TAreaData>(AreaLayout layout = null) where TAreaData : class, TWindow
        {
            this.HasPanel <TArea, TAreaData>(w => w as TAreaData, layout);

            return(this);
        }