Esempio n. 1
0
        public ContentRoot CreateContentRoot(ContentRootType type, Color backgroundColor, UIElement?rootElement)
        {
            var contentRoot = new ContentRoot(type, backgroundColor, rootElement, _coreServices);

            _contentRoots.Add(contentRoot);

            return(contentRoot);
        }
Esempio n. 2
0
 public ContentRoot(ContentRootType type, Color backgroundColor, UIElement?rootElement, CoreServices coreServices)
 {
     //TODO Uno: Does not match WinUI exactly, additional logic can be ported later.
     _coreServices = coreServices ?? throw new ArgumentNullException(nameof(coreServices));
     VisualTree    = new VisualTree(coreServices, backgroundColor, rootElement, this);
     FocusManager  = new FocusManager(this);
     InputManager  = new InputManager(this);
     //TODO Uno: We may want to create a custom version of adapter and observer specific to Uno.
     FocusAdapter = new FocusAdapter(this);
     FocusManager.SetFocusObserver(new FocusObserver(this));
     switch (type)
     {
     case ContentRootType.CoreWindow:
         MUX_ASSERT(coreServices.ContentRootCoordinator.CoreWindowContentRoot == null);
         coreServices.ContentRootCoordinator.CoreWindowContentRoot = this;
         break;
     }
 }