Skip to content

Instantly share code, notes, and snippets.

@dupuyjs
Last active March 4, 2016 14:41
Show Gist options
  • Save dupuyjs/5b7dbaede0eb5dc1bcf7 to your computer and use it in GitHub Desktop.
Save dupuyjs/5b7dbaede0eb5dc1bcf7 to your computer and use it in GitHub Desktop.
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