Last active
March 4, 2016 14:41
-
-
Save dupuyjs/5b7dbaede0eb5dc1bcf7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Numerics; | |
using Windows.ApplicationModel.Core; | |
using Windows.UI; | |
using Windows.UI.Composition; | |
using Windows.UI.Core; | |
namespace DemoComposition | |
{ | |
class DefaultView : IFrameworkView, IFrameworkViewSource | |
{ | |
Compositor _compositor = default(Compositor); | |
CompositionTarget _target = default(CompositionTarget); | |
static void Main() | |
{ | |
CoreApplication.Run(new DefaultView()); | |
} | |
public IFrameworkView CreateView() | |
{ | |
return this; | |
} | |
public void Run() | |
{ | |
CoreWindow window = CoreWindow.GetForCurrentThread(); | |
window.Activate(); | |
window.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessUntilQuit); | |
} | |
public void SetWindow(CoreWindow window) | |
{ | |
_compositor = new Compositor(); | |
_target = _compositor.CreateTargetForCurrentView(); | |
ContainerVisual root = _compositor.CreateContainerVisual(); | |
_target.Root = root; | |
// a kind of magic to add here | |
} | |
public void Initialize(CoreApplicationView applicationView) { } | |
public void Load(string entryPoint) { } | |
public void Uninitialize() { } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment