// Copyright (c) The NodeRT Contributors
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the ""License""); you may
// not use this file except in compliance with the License. You may obtain a
// copy of the License at http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED ON AN  *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing permissions
// and limitations under the License.

// TODO: Verify that this is is still needed..
#define NTDDI_VERSION 0x06010000

#include <v8.h>
#include "nan.h"
#include <string>
#include <ppltasks.h>
#include "CollectionsConverter.h"
#include "CollectionsWrap.h"
#include "node-async.h"
#include "NodeRtUtils.h"
#include "OpaqueWrapper.h"
#include "WrapperBase.h"

#using <Windows.WinMD>

// this undefs fixes the issues of compiling Windows.Data.Json, Windows.Storag.FileProperties, and Windows.Stroage.Search
// Some of the node header files brings windows definitions with the same names as some of the WinRT methods
#undef DocumentProperties
#undef GetObject
#undef CreateEvent
#undef FindText
#undef SendMessage

const char* REGISTRATION_TOKEN_MAP_PROPERTY_NAME = "__registrationTokenMap__";

using v8::Array;
using v8::String;
using v8::Value;
using v8::Boolean;
using v8::Integer;
using v8::FunctionTemplate;
using v8::Object;
using v8::Local;
using v8::Function;
using v8::Date;
using v8::Number;
using v8::PropertyAttribute;
using v8::Primitive;
using Nan::HandleScope;
using Nan::Persistent;
using Nan::Undefined;
using Nan::True;
using Nan::False;
using Nan::Null;
using Nan::MaybeLocal;
using Nan::EscapableHandleScope;
using Nan::HandleScope;
using Nan::TryCatch;
using namespace concurrency;

namespace NodeRT { namespace Windows { namespace UI { namespace Xaml { namespace Media { 
  v8::Local<v8::Value> WrapVisualTreeHelper(::Windows::UI::Xaml::Media::VisualTreeHelper^ wintRtInstance);
  ::Windows::UI::Xaml::Media::VisualTreeHelper^ UnwrapVisualTreeHelper(Local<Value> value);
  
  v8::Local<v8::Value> WrapPartialMediaFailureDetectedEventArgs(::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^ wintRtInstance);
  ::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^ UnwrapPartialMediaFailureDetectedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapBrushCollection(::Windows::UI::Xaml::Media::BrushCollection^ wintRtInstance);
  ::Windows::UI::Xaml::Media::BrushCollection^ UnwrapBrushCollection(Local<Value> value);
  
  v8::Local<v8::Value> WrapRenderedEventArgs(::Windows::UI::Xaml::Media::RenderedEventArgs^ wintRtInstance);
  ::Windows::UI::Xaml::Media::RenderedEventArgs^ UnwrapRenderedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionTarget(::Windows::UI::Xaml::Media::CompositionTarget^ wintRtInstance);
  ::Windows::UI::Xaml::Media::CompositionTarget^ UnwrapCompositionTarget(Local<Value> value);
  
  v8::Local<v8::Value> WrapDoubleCollection(::Windows::UI::Xaml::Media::DoubleCollection^ wintRtInstance);
  ::Windows::UI::Xaml::Media::DoubleCollection^ UnwrapDoubleCollection(Local<Value> value);
  
  v8::Local<v8::Value> WrapFontFamily(::Windows::UI::Xaml::Media::FontFamily^ wintRtInstance);
  ::Windows::UI::Xaml::Media::FontFamily^ UnwrapFontFamily(Local<Value> value);
  
  v8::Local<v8::Value> WrapMediaTransportControlsThumbnailRequestedEventArgs(::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^ wintRtInstance);
  ::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^ UnwrapMediaTransportControlsThumbnailRequestedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapPointCollection(::Windows::UI::Xaml::Media::PointCollection^ wintRtInstance);
  ::Windows::UI::Xaml::Media::PointCollection^ UnwrapPointCollection(Local<Value> value);
  
  v8::Local<v8::Value> WrapRenderingEventArgs(::Windows::UI::Xaml::Media::RenderingEventArgs^ wintRtInstance);
  ::Windows::UI::Xaml::Media::RenderingEventArgs^ UnwrapRenderingEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapTimelineMarkerCollection(::Windows::UI::Xaml::Media::TimelineMarkerCollection^ wintRtInstance);
  ::Windows::UI::Xaml::Media::TimelineMarkerCollection^ UnwrapTimelineMarkerCollection(Local<Value> value);
  
  v8::Local<v8::Value> WrapTransformCollection(::Windows::UI::Xaml::Media::TransformCollection^ wintRtInstance);
  ::Windows::UI::Xaml::Media::TransformCollection^ UnwrapTransformCollection(Local<Value> value);
  
  v8::Local<v8::Value> WrapBrush(::Windows::UI::Xaml::Media::Brush^ wintRtInstance);
  ::Windows::UI::Xaml::Media::Brush^ UnwrapBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapCacheMode(::Windows::UI::Xaml::Media::CacheMode^ wintRtInstance);
  ::Windows::UI::Xaml::Media::CacheMode^ UnwrapCacheMode(Local<Value> value);
  
  v8::Local<v8::Value> WrapGeneralTransform(::Windows::UI::Xaml::Media::GeneralTransform^ wintRtInstance);
  ::Windows::UI::Xaml::Media::GeneralTransform^ UnwrapGeneralTransform(Local<Value> value);
  
  v8::Local<v8::Value> WrapGeometry(::Windows::UI::Xaml::Media::Geometry^ wintRtInstance);
  ::Windows::UI::Xaml::Media::Geometry^ UnwrapGeometry(Local<Value> value);
  
  v8::Local<v8::Value> WrapImageSource(::Windows::UI::Xaml::Media::ImageSource^ wintRtInstance);
  ::Windows::UI::Xaml::Media::ImageSource^ UnwrapImageSource(Local<Value> value);
  
  v8::Local<v8::Value> WrapPathSegment(::Windows::UI::Xaml::Media::PathSegment^ wintRtInstance);
  ::Windows::UI::Xaml::Media::PathSegment^ UnwrapPathSegment(Local<Value> value);
  
  v8::Local<v8::Value> WrapProjection(::Windows::UI::Xaml::Media::Projection^ wintRtInstance);
  ::Windows::UI::Xaml::Media::Projection^ UnwrapProjection(Local<Value> value);
  
  v8::Local<v8::Value> WrapRateChangedRoutedEventArgs(::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs^ wintRtInstance);
  ::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs^ UnwrapRateChangedRoutedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapTimelineMarker(::Windows::UI::Xaml::Media::TimelineMarker^ wintRtInstance);
  ::Windows::UI::Xaml::Media::TimelineMarker^ UnwrapTimelineMarker(Local<Value> value);
  
  v8::Local<v8::Value> WrapTimelineMarkerRoutedEventArgs(::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^ wintRtInstance);
  ::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^ UnwrapTimelineMarkerRoutedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapXamlLight(::Windows::UI::Xaml::Media::XamlLight^ wintRtInstance);
  ::Windows::UI::Xaml::Media::XamlLight^ UnwrapXamlLight(Local<Value> value);
  
  v8::Local<v8::Value> WrapBitmapCache(::Windows::UI::Xaml::Media::BitmapCache^ wintRtInstance);
  ::Windows::UI::Xaml::Media::BitmapCache^ UnwrapBitmapCache(Local<Value> value);
  
  v8::Local<v8::Value> WrapMatrix3DProjection(::Windows::UI::Xaml::Media::Matrix3DProjection^ wintRtInstance);
  ::Windows::UI::Xaml::Media::Matrix3DProjection^ UnwrapMatrix3DProjection(Local<Value> value);
  
  v8::Local<v8::Value> WrapPlaneProjection(::Windows::UI::Xaml::Media::PlaneProjection^ wintRtInstance);
  ::Windows::UI::Xaml::Media::PlaneProjection^ UnwrapPlaneProjection(Local<Value> value);
  
  v8::Local<v8::Value> WrapRectangleGeometry(::Windows::UI::Xaml::Media::RectangleGeometry^ wintRtInstance);
  ::Windows::UI::Xaml::Media::RectangleGeometry^ UnwrapRectangleGeometry(Local<Value> value);
  
  v8::Local<v8::Value> WrapSolidColorBrush(::Windows::UI::Xaml::Media::SolidColorBrush^ wintRtInstance);
  ::Windows::UI::Xaml::Media::SolidColorBrush^ UnwrapSolidColorBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapTransform(::Windows::UI::Xaml::Media::Transform^ wintRtInstance);
  ::Windows::UI::Xaml::Media::Transform^ UnwrapTransform(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositeTransform(::Windows::UI::Xaml::Media::CompositeTransform^ wintRtInstance);
  ::Windows::UI::Xaml::Media::CompositeTransform^ UnwrapCompositeTransform(Local<Value> value);
  
  v8::Local<v8::Value> WrapMatrixTransform(::Windows::UI::Xaml::Media::MatrixTransform^ wintRtInstance);
  ::Windows::UI::Xaml::Media::MatrixTransform^ UnwrapMatrixTransform(Local<Value> value);
  
  v8::Local<v8::Value> WrapRotateTransform(::Windows::UI::Xaml::Media::RotateTransform^ wintRtInstance);
  ::Windows::UI::Xaml::Media::RotateTransform^ UnwrapRotateTransform(Local<Value> value);
  
  v8::Local<v8::Value> WrapScaleTransform(::Windows::UI::Xaml::Media::ScaleTransform^ wintRtInstance);
  ::Windows::UI::Xaml::Media::ScaleTransform^ UnwrapScaleTransform(Local<Value> value);
  
  v8::Local<v8::Value> WrapSkewTransform(::Windows::UI::Xaml::Media::SkewTransform^ wintRtInstance);
  ::Windows::UI::Xaml::Media::SkewTransform^ UnwrapSkewTransform(Local<Value> value);
  
  v8::Local<v8::Value> WrapTransformGroup(::Windows::UI::Xaml::Media::TransformGroup^ wintRtInstance);
  ::Windows::UI::Xaml::Media::TransformGroup^ UnwrapTransformGroup(Local<Value> value);
  
  v8::Local<v8::Value> WrapTranslateTransform(::Windows::UI::Xaml::Media::TranslateTransform^ wintRtInstance);
  ::Windows::UI::Xaml::Media::TranslateTransform^ UnwrapTranslateTransform(Local<Value> value);
  
  v8::Local<v8::Value> WrapGeometryCollection(::Windows::UI::Xaml::Media::GeometryCollection^ wintRtInstance);
  ::Windows::UI::Xaml::Media::GeometryCollection^ UnwrapGeometryCollection(Local<Value> value);
  
  v8::Local<v8::Value> WrapGradientStopCollection(::Windows::UI::Xaml::Media::GradientStopCollection^ wintRtInstance);
  ::Windows::UI::Xaml::Media::GradientStopCollection^ UnwrapGradientStopCollection(Local<Value> value);
  
  v8::Local<v8::Value> WrapLoadedImageSourceLoadCompletedEventArgs(::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^ wintRtInstance);
  ::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^ UnwrapLoadedImageSourceLoadCompletedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapLoadedImageSurface(::Windows::UI::Xaml::Media::LoadedImageSurface^ wintRtInstance);
  ::Windows::UI::Xaml::Media::LoadedImageSurface^ UnwrapLoadedImageSurface(Local<Value> value);
  
  v8::Local<v8::Value> WrapPathFigureCollection(::Windows::UI::Xaml::Media::PathFigureCollection^ wintRtInstance);
  ::Windows::UI::Xaml::Media::PathFigureCollection^ UnwrapPathFigureCollection(Local<Value> value);
  
  v8::Local<v8::Value> WrapPathSegmentCollection(::Windows::UI::Xaml::Media::PathSegmentCollection^ wintRtInstance);
  ::Windows::UI::Xaml::Media::PathSegmentCollection^ UnwrapPathSegmentCollection(Local<Value> value);
  
  v8::Local<v8::Value> WrapGradientStop(::Windows::UI::Xaml::Media::GradientStop^ wintRtInstance);
  ::Windows::UI::Xaml::Media::GradientStop^ UnwrapGradientStop(Local<Value> value);
  
  v8::Local<v8::Value> WrapPathFigure(::Windows::UI::Xaml::Media::PathFigure^ wintRtInstance);
  ::Windows::UI::Xaml::Media::PathFigure^ UnwrapPathFigure(Local<Value> value);
  
  v8::Local<v8::Value> WrapArcSegment(::Windows::UI::Xaml::Media::ArcSegment^ wintRtInstance);
  ::Windows::UI::Xaml::Media::ArcSegment^ UnwrapArcSegment(Local<Value> value);
  
  v8::Local<v8::Value> WrapBezierSegment(::Windows::UI::Xaml::Media::BezierSegment^ wintRtInstance);
  ::Windows::UI::Xaml::Media::BezierSegment^ UnwrapBezierSegment(Local<Value> value);
  
  v8::Local<v8::Value> WrapEllipseGeometry(::Windows::UI::Xaml::Media::EllipseGeometry^ wintRtInstance);
  ::Windows::UI::Xaml::Media::EllipseGeometry^ UnwrapEllipseGeometry(Local<Value> value);
  
  v8::Local<v8::Value> WrapGeometryGroup(::Windows::UI::Xaml::Media::GeometryGroup^ wintRtInstance);
  ::Windows::UI::Xaml::Media::GeometryGroup^ UnwrapGeometryGroup(Local<Value> value);
  
  v8::Local<v8::Value> WrapGradientBrush(::Windows::UI::Xaml::Media::GradientBrush^ wintRtInstance);
  ::Windows::UI::Xaml::Media::GradientBrush^ UnwrapGradientBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapLineGeometry(::Windows::UI::Xaml::Media::LineGeometry^ wintRtInstance);
  ::Windows::UI::Xaml::Media::LineGeometry^ UnwrapLineGeometry(Local<Value> value);
  
  v8::Local<v8::Value> WrapLineSegment(::Windows::UI::Xaml::Media::LineSegment^ wintRtInstance);
  ::Windows::UI::Xaml::Media::LineSegment^ UnwrapLineSegment(Local<Value> value);
  
  v8::Local<v8::Value> WrapPathGeometry(::Windows::UI::Xaml::Media::PathGeometry^ wintRtInstance);
  ::Windows::UI::Xaml::Media::PathGeometry^ UnwrapPathGeometry(Local<Value> value);
  
  v8::Local<v8::Value> WrapPolyBezierSegment(::Windows::UI::Xaml::Media::PolyBezierSegment^ wintRtInstance);
  ::Windows::UI::Xaml::Media::PolyBezierSegment^ UnwrapPolyBezierSegment(Local<Value> value);
  
  v8::Local<v8::Value> WrapPolyLineSegment(::Windows::UI::Xaml::Media::PolyLineSegment^ wintRtInstance);
  ::Windows::UI::Xaml::Media::PolyLineSegment^ UnwrapPolyLineSegment(Local<Value> value);
  
  v8::Local<v8::Value> WrapPolyQuadraticBezierSegment(::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^ wintRtInstance);
  ::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^ UnwrapPolyQuadraticBezierSegment(Local<Value> value);
  
  v8::Local<v8::Value> WrapQuadraticBezierSegment(::Windows::UI::Xaml::Media::QuadraticBezierSegment^ wintRtInstance);
  ::Windows::UI::Xaml::Media::QuadraticBezierSegment^ UnwrapQuadraticBezierSegment(Local<Value> value);
  
  v8::Local<v8::Value> WrapTileBrush(::Windows::UI::Xaml::Media::TileBrush^ wintRtInstance);
  ::Windows::UI::Xaml::Media::TileBrush^ UnwrapTileBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapXamlCompositionBrushBase(::Windows::UI::Xaml::Media::XamlCompositionBrushBase^ wintRtInstance);
  ::Windows::UI::Xaml::Media::XamlCompositionBrushBase^ UnwrapXamlCompositionBrushBase(Local<Value> value);
  
  v8::Local<v8::Value> WrapAcrylicBrush(::Windows::UI::Xaml::Media::AcrylicBrush^ wintRtInstance);
  ::Windows::UI::Xaml::Media::AcrylicBrush^ UnwrapAcrylicBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapRevealBrush(::Windows::UI::Xaml::Media::RevealBrush^ wintRtInstance);
  ::Windows::UI::Xaml::Media::RevealBrush^ UnwrapRevealBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapRevealBorderBrush(::Windows::UI::Xaml::Media::RevealBorderBrush^ wintRtInstance);
  ::Windows::UI::Xaml::Media::RevealBorderBrush^ UnwrapRevealBorderBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapRevealBackgroundBrush(::Windows::UI::Xaml::Media::RevealBackgroundBrush^ wintRtInstance);
  ::Windows::UI::Xaml::Media::RevealBackgroundBrush^ UnwrapRevealBackgroundBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapImageBrush(::Windows::UI::Xaml::Media::ImageBrush^ wintRtInstance);
  ::Windows::UI::Xaml::Media::ImageBrush^ UnwrapImageBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapLinearGradientBrush(::Windows::UI::Xaml::Media::LinearGradientBrush^ wintRtInstance);
  ::Windows::UI::Xaml::Media::LinearGradientBrush^ UnwrapLinearGradientBrush(Local<Value> value);
  



  static void InitAcrylicBackgroundSourceEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("AcrylicBackgroundSource").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("hostBackdrop").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AcrylicBackgroundSource::HostBackdrop)));
    Nan::Set(enumObject, Nan::New<String>("backdrop").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AcrylicBackgroundSource::Backdrop)));
  }

  static void InitRevealBrushStateEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("RevealBrushState").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("normal").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::RevealBrushState::Normal)));
    Nan::Set(enumObject, Nan::New<String>("pointerOver").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::RevealBrushState::PointerOver)));
    Nan::Set(enumObject, Nan::New<String>("pressed").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::RevealBrushState::Pressed)));
  }

  static void InitMediaElementStateEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("MediaElementState").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("closed").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::MediaElementState::Closed)));
    Nan::Set(enumObject, Nan::New<String>("opening").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::MediaElementState::Opening)));
    Nan::Set(enumObject, Nan::New<String>("buffering").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::MediaElementState::Buffering)));
    Nan::Set(enumObject, Nan::New<String>("playing").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::MediaElementState::Playing)));
    Nan::Set(enumObject, Nan::New<String>("paused").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::MediaElementState::Paused)));
    Nan::Set(enumObject, Nan::New<String>("stopped").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::MediaElementState::Stopped)));
  }

  static void InitAudioCategoryEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("AudioCategory").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("other").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioCategory::Other)));
    Nan::Set(enumObject, Nan::New<String>("foregroundOnlyMedia").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioCategory::ForegroundOnlyMedia)));
    Nan::Set(enumObject, Nan::New<String>("backgroundCapableMedia").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioCategory::BackgroundCapableMedia)));
    Nan::Set(enumObject, Nan::New<String>("communications").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioCategory::Communications)));
    Nan::Set(enumObject, Nan::New<String>("alerts").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioCategory::Alerts)));
    Nan::Set(enumObject, Nan::New<String>("soundEffects").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioCategory::SoundEffects)));
    Nan::Set(enumObject, Nan::New<String>("gameEffects").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioCategory::GameEffects)));
    Nan::Set(enumObject, Nan::New<String>("gameMedia").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioCategory::GameMedia)));
    Nan::Set(enumObject, Nan::New<String>("gameChat").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioCategory::GameChat)));
    Nan::Set(enumObject, Nan::New<String>("speech").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioCategory::Speech)));
    Nan::Set(enumObject, Nan::New<String>("movie").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioCategory::Movie)));
    Nan::Set(enumObject, Nan::New<String>("media").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioCategory::Media)));
  }

  static void InitAudioDeviceTypeEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("AudioDeviceType").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("console").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioDeviceType::Console)));
    Nan::Set(enumObject, Nan::New<String>("multimedia").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioDeviceType::Multimedia)));
    Nan::Set(enumObject, Nan::New<String>("communications").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AudioDeviceType::Communications)));
  }

  static void InitBrushMappingModeEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("BrushMappingMode").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("absolute").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::BrushMappingMode::Absolute)));
    Nan::Set(enumObject, Nan::New<String>("relativeToBoundingBox").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::BrushMappingMode::RelativeToBoundingBox)));
  }

  static void InitColorInterpolationModeEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("ColorInterpolationMode").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("scRgbLinearInterpolation").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::ColorInterpolationMode::ScRgbLinearInterpolation)));
    Nan::Set(enumObject, Nan::New<String>("sRgbLinearInterpolation").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::ColorInterpolationMode::SRgbLinearInterpolation)));
  }

  static void InitElementCompositeModeEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("ElementCompositeMode").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("inherit").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::ElementCompositeMode::Inherit)));
    Nan::Set(enumObject, Nan::New<String>("sourceOver").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::ElementCompositeMode::SourceOver)));
    Nan::Set(enumObject, Nan::New<String>("minBlend").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::ElementCompositeMode::MinBlend)));
  }

  static void InitFastPlayFallbackBehaviourEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("FastPlayFallbackBehaviour").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("skip").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::FastPlayFallbackBehaviour::Skip)));
    Nan::Set(enumObject, Nan::New<String>("hide").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::FastPlayFallbackBehaviour::Hide)));
    Nan::Set(enumObject, Nan::New<String>("disable").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::FastPlayFallbackBehaviour::Disable)));
  }

  static void InitFillRuleEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("FillRule").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("evenOdd").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::FillRule::EvenOdd)));
    Nan::Set(enumObject, Nan::New<String>("nonzero").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::FillRule::Nonzero)));
  }

  static void InitGradientSpreadMethodEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("GradientSpreadMethod").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("pad").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::GradientSpreadMethod::Pad)));
    Nan::Set(enumObject, Nan::New<String>("reflect").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::GradientSpreadMethod::Reflect)));
    Nan::Set(enumObject, Nan::New<String>("repeat").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::GradientSpreadMethod::Repeat)));
  }

  static void InitMediaCanPlayResponseEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("MediaCanPlayResponse").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("notSupported").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::MediaCanPlayResponse::NotSupported)));
    Nan::Set(enumObject, Nan::New<String>("maybe").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::MediaCanPlayResponse::Maybe)));
    Nan::Set(enumObject, Nan::New<String>("probably").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::MediaCanPlayResponse::Probably)));
  }

  static void InitPenLineCapEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("PenLineCap").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("flat").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::PenLineCap::Flat)));
    Nan::Set(enumObject, Nan::New<String>("square").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::PenLineCap::Square)));
    Nan::Set(enumObject, Nan::New<String>("round").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::PenLineCap::Round)));
    Nan::Set(enumObject, Nan::New<String>("triangle").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::PenLineCap::Triangle)));
  }

  static void InitPenLineJoinEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("PenLineJoin").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("miter").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::PenLineJoin::Miter)));
    Nan::Set(enumObject, Nan::New<String>("bevel").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::PenLineJoin::Bevel)));
    Nan::Set(enumObject, Nan::New<String>("round").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::PenLineJoin::Round)));
  }

  static void InitStereo3DVideoPackingModeEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("Stereo3DVideoPackingMode").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("none").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::Stereo3DVideoPackingMode::None)));
    Nan::Set(enumObject, Nan::New<String>("sideBySide").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::Stereo3DVideoPackingMode::SideBySide)));
    Nan::Set(enumObject, Nan::New<String>("topBottom").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::Stereo3DVideoPackingMode::TopBottom)));
  }

  static void InitStereo3DVideoRenderModeEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("Stereo3DVideoRenderMode").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("mono").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::Stereo3DVideoRenderMode::Mono)));
    Nan::Set(enumObject, Nan::New<String>("stereo").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::Stereo3DVideoRenderMode::Stereo)));
  }

  static void InitStretchEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("Stretch").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("none").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::Stretch::None)));
    Nan::Set(enumObject, Nan::New<String>("fill").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::Stretch::Fill)));
    Nan::Set(enumObject, Nan::New<String>("uniform").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::Stretch::Uniform)));
    Nan::Set(enumObject, Nan::New<String>("uniformToFill").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::Stretch::UniformToFill)));
  }

  static void InitStyleSimulationsEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("StyleSimulations").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("none").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::StyleSimulations::None)));
    Nan::Set(enumObject, Nan::New<String>("boldSimulation").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::StyleSimulations::BoldSimulation)));
    Nan::Set(enumObject, Nan::New<String>("italicSimulation").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::StyleSimulations::ItalicSimulation)));
    Nan::Set(enumObject, Nan::New<String>("boldItalicSimulation").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::StyleSimulations::BoldItalicSimulation)));
  }

  static void InitSweepDirectionEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("SweepDirection").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("counterclockwise").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::SweepDirection::Counterclockwise)));
    Nan::Set(enumObject, Nan::New<String>("clockwise").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::SweepDirection::Clockwise)));
  }

  static void InitAlignmentXEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("AlignmentX").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("left").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AlignmentX::Left)));
    Nan::Set(enumObject, Nan::New<String>("center").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AlignmentX::Center)));
    Nan::Set(enumObject, Nan::New<String>("right").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AlignmentX::Right)));
  }

  static void InitAlignmentYEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("AlignmentY").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("top").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AlignmentY::Top)));
    Nan::Set(enumObject, Nan::New<String>("center").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AlignmentY::Center)));
    Nan::Set(enumObject, Nan::New<String>("bottom").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::AlignmentY::Bottom)));
  }

  static void InitLoadedImageSourceLoadStatusEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("LoadedImageSourceLoadStatus").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("success").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::LoadedImageSourceLoadStatus::Success)));
    Nan::Set(enumObject, Nan::New<String>("networkError").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::LoadedImageSourceLoadStatus::NetworkError)));
    Nan::Set(enumObject, Nan::New<String>("invalidFormat").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::LoadedImageSourceLoadStatus::InvalidFormat)));
    Nan::Set(enumObject, Nan::New<String>("other").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Xaml::Media::LoadedImageSourceLoadStatus::Other)));
  }


  static bool IsPointJsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    return true;
  }

  ::Windows::Foundation::Point PointFromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Windows::Foundation::Point returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    return returnValue;
  }

  Local<Value> PointToJsObject(::Windows::Foundation::Point value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();


    return scope.Escape(obj);
  }
  static bool IsRectJsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    return true;
  }

  ::Windows::Foundation::Rect RectFromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Windows::Foundation::Rect returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    return returnValue;
  }

  Local<Value> RectToJsObject(::Windows::Foundation::Rect value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();


    return scope.Escape(obj);
  }
  static bool IsMatrix3DJsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    return true;
  }

  ::Windows::UI::Xaml::Media::Media3D::Matrix3D Matrix3DFromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Windows::UI::Xaml::Media::Media3D::Matrix3D returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    return returnValue;
  }

  Local<Value> Matrix3DToJsObject(::Windows::UI::Xaml::Media::Media3D::Matrix3D value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();


    return scope.Escape(obj);
  }
  static bool IsColorJsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    return true;
  }

  ::Windows::UI::Color ColorFromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Windows::UI::Color returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    return returnValue;
  }

  Local<Value> ColorToJsObject(::Windows::UI::Color value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();


    return scope.Escape(obj);
  }
  static bool IsSizeJsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    return true;
  }

  ::Windows::Foundation::Size SizeFromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Windows::Foundation::Size returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    return returnValue;
  }

  Local<Value> SizeToJsObject(::Windows::Foundation::Size value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();


    return scope.Escape(obj);
  }

  class VisualTreeHelper : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("VisualTreeHelper").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);






        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetMethod(constructor, "getOpenPopups", GetOpenPopups);
        Nan::SetMethod(constructor, "findElementsInHostCoordinates", FindElementsInHostCoordinates);
        Nan::SetMethod(constructor, "getChild", GetChild);
        Nan::SetMethod(constructor, "getChildrenCount", GetChildrenCount);
        Nan::SetMethod(constructor, "getParent", GetParent);
        Nan::SetMethod(constructor, "disconnectChildrenRecursive", DisconnectChildrenRecursive);


        Nan::Set(exports, Nan::New<String>("VisualTreeHelper").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      VisualTreeHelper(::Windows::UI::Xaml::Media::VisualTreeHelper^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::VisualTreeHelper^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::VisualTreeHelper^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::VisualTreeHelper^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      VisualTreeHelper *wrapperInstance = new VisualTreeHelper(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::VisualTreeHelper^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::VisualTreeHelper^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::VisualTreeHelper^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapVisualTreeHelper(winRtInstance));
    }





    static void GetOpenPopups(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Window^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Window^ arg0 = dynamic_cast<::Windows::UI::Xaml::Window^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          ::Windows::Foundation::Collections::IVectorView<::Windows::UI::Xaml::Controls::Primitives::Popup^>^ result;
          result = ::Windows::UI::Xaml::Media::VisualTreeHelper::GetOpenPopups(arg0);
          info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Windows::UI::Xaml::Controls::Primitives::Popup^>::CreateVectorViewWrapper(result, 
            [](::Windows::UI::Xaml::Controls::Primitives::Popup^ val) -> Local<Value> {
              return NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml.Controls.Primitives", "Popup", val);
            },
            [](Local<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Controls::Primitives::Popup^>(value);
            },
            [](Local<Value> value) -> ::Windows::UI::Xaml::Controls::Primitives::Popup^ {
              return dynamic_cast<::Windows::UI::Xaml::Controls::Primitives::Popup^>(NodeRT::Utils::GetObjectInstance(value));
            }
          ));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void FindElementsInHostCoordinates(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 2
        && NodeRT::Utils::IsPoint(info[0])
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::UIElement^>(info[1]))
      {
        try
        {
          ::Windows::Foundation::Point arg0 = NodeRT::Utils::PointFromJs(info[0]);
          ::Windows::UI::Xaml::UIElement^ arg1 = dynamic_cast<::Windows::UI::Xaml::UIElement^>(NodeRT::Utils::GetObjectInstance(info[1]));
          
          ::Windows::Foundation::Collections::IIterable<::Windows::UI::Xaml::UIElement^>^ result;
          result = ::Windows::UI::Xaml::Media::VisualTreeHelper::FindElementsInHostCoordinates(arg0, arg1);
          info.GetReturnValue().Set(NodeRT::Collections::IterableWrapper<::Windows::UI::Xaml::UIElement^>::CreateIterableWrapper(result, 
            [](::Windows::UI::Xaml::UIElement^ val) -> Local<Value> {
              return NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "UIElement", val);
            }
          ));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 2
        && NodeRT::Utils::IsRect(info[0])
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::UIElement^>(info[1]))
      {
        try
        {
          ::Windows::Foundation::Rect arg0 = NodeRT::Utils::RectFromJs(info[0]);
          ::Windows::UI::Xaml::UIElement^ arg1 = dynamic_cast<::Windows::UI::Xaml::UIElement^>(NodeRT::Utils::GetObjectInstance(info[1]));
          
          ::Windows::Foundation::Collections::IIterable<::Windows::UI::Xaml::UIElement^>^ result;
          result = ::Windows::UI::Xaml::Media::VisualTreeHelper::FindElementsInHostCoordinates(arg0, arg1);
          info.GetReturnValue().Set(NodeRT::Collections::IterableWrapper<::Windows::UI::Xaml::UIElement^>::CreateIterableWrapper(result, 
            [](::Windows::UI::Xaml::UIElement^ val) -> Local<Value> {
              return NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "UIElement", val);
            }
          ));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 3
        && NodeRT::Utils::IsPoint(info[0])
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::UIElement^>(info[1])
        && info[2]->IsBoolean())
      {
        try
        {
          ::Windows::Foundation::Point arg0 = NodeRT::Utils::PointFromJs(info[0]);
          ::Windows::UI::Xaml::UIElement^ arg1 = dynamic_cast<::Windows::UI::Xaml::UIElement^>(NodeRT::Utils::GetObjectInstance(info[1]));
          bool arg2 = Nan::To<bool>(info[2]).FromMaybe(false);
          
          ::Windows::Foundation::Collections::IIterable<::Windows::UI::Xaml::UIElement^>^ result;
          result = ::Windows::UI::Xaml::Media::VisualTreeHelper::FindElementsInHostCoordinates(arg0, arg1, arg2);
          info.GetReturnValue().Set(NodeRT::Collections::IterableWrapper<::Windows::UI::Xaml::UIElement^>::CreateIterableWrapper(result, 
            [](::Windows::UI::Xaml::UIElement^ val) -> Local<Value> {
              return NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "UIElement", val);
            }
          ));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 3
        && NodeRT::Utils::IsRect(info[0])
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::UIElement^>(info[1])
        && info[2]->IsBoolean())
      {
        try
        {
          ::Windows::Foundation::Rect arg0 = NodeRT::Utils::RectFromJs(info[0]);
          ::Windows::UI::Xaml::UIElement^ arg1 = dynamic_cast<::Windows::UI::Xaml::UIElement^>(NodeRT::Utils::GetObjectInstance(info[1]));
          bool arg2 = Nan::To<bool>(info[2]).FromMaybe(false);
          
          ::Windows::Foundation::Collections::IIterable<::Windows::UI::Xaml::UIElement^>^ result;
          result = ::Windows::UI::Xaml::Media::VisualTreeHelper::FindElementsInHostCoordinates(arg0, arg1, arg2);
          info.GetReturnValue().Set(NodeRT::Collections::IterableWrapper<::Windows::UI::Xaml::UIElement^>::CreateIterableWrapper(result, 
            [](::Windows::UI::Xaml::UIElement^ val) -> Local<Value> {
              return NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "UIElement", val);
            }
          ));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void GetChild(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info[0])
        && info[1]->IsInt32())
      {
        try
        {
          ::Windows::UI::Xaml::DependencyObject^ arg0 = dynamic_cast<::Windows::UI::Xaml::DependencyObject^>(NodeRT::Utils::GetObjectInstance(info[0]));
          int arg1 = static_cast<int>(Nan::To<int32_t>(info[1]).FromMaybe(0));
          
          ::Windows::UI::Xaml::DependencyObject^ result;
          result = ::Windows::UI::Xaml::Media::VisualTreeHelper::GetChild(arg0, arg1);
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyObject", result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void GetChildrenCount(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::DependencyObject^ arg0 = dynamic_cast<::Windows::UI::Xaml::DependencyObject^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          int result;
          result = ::Windows::UI::Xaml::Media::VisualTreeHelper::GetChildrenCount(arg0);
          info.GetReturnValue().Set(Nan::New<Integer>(result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void GetParent(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::DependencyObject^ arg0 = dynamic_cast<::Windows::UI::Xaml::DependencyObject^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          ::Windows::UI::Xaml::DependencyObject^ result;
          result = ::Windows::UI::Xaml::Media::VisualTreeHelper::GetParent(arg0);
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyObject", result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void DisconnectChildrenRecursive(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::UIElement^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::UIElement^ arg0 = dynamic_cast<::Windows::UI::Xaml::UIElement^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          ::Windows::UI::Xaml::Media::VisualTreeHelper::DisconnectChildrenRecursive(arg0);
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    private:
      ::Windows::UI::Xaml::Media::VisualTreeHelper^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapVisualTreeHelper(::Windows::UI::Xaml::Media::VisualTreeHelper^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::VisualTreeHelper^ UnwrapVisualTreeHelper(Local<Value> value);
  };

  Persistent<FunctionTemplate> VisualTreeHelper::s_constructorTemplate;

  v8::Local<v8::Value> WrapVisualTreeHelper(::Windows::UI::Xaml::Media::VisualTreeHelper^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(VisualTreeHelper::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::VisualTreeHelper^ UnwrapVisualTreeHelper(Local<Value> value) {
     return VisualTreeHelper::Unwrap<VisualTreeHelper>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitVisualTreeHelper(Local<Object> exports) {
    VisualTreeHelper::Init(exports);
  }

  class PartialMediaFailureDetectedEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("PartialMediaFailureDetectedEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("streamKind").ToLocalChecked(), StreamKindGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("extendedError").ToLocalChecked(), ExtendedErrorGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("PartialMediaFailureDetectedEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      PartialMediaFailureDetectedEventArgs(::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      PartialMediaFailureDetectedEventArgs *wrapperInstance = new PartialMediaFailureDetectedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapPartialMediaFailureDetectedEventArgs(winRtInstance));
    }





    static void StreamKindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^>(info.This())) {
        return;
      }

      PartialMediaFailureDetectedEventArgs *wrapper = PartialMediaFailureDetectedEventArgs::Unwrap<PartialMediaFailureDetectedEventArgs>(info.This());

      try  {
        ::Windows::Media::Playback::FailedMediaStreamKind result = wrapper->_instance->StreamKind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ExtendedErrorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^>(info.This())) {
        return;
      }

      PartialMediaFailureDetectedEventArgs *wrapper = PartialMediaFailureDetectedEventArgs::Unwrap<PartialMediaFailureDetectedEventArgs>(info.This());

      try  {
        ::Windows::Foundation::HResult result = wrapper->_instance->ExtendedError;
        info.GetReturnValue().Set(Nan::New<Integer>(result.Value));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapPartialMediaFailureDetectedEventArgs(::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^ UnwrapPartialMediaFailureDetectedEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> PartialMediaFailureDetectedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapPartialMediaFailureDetectedEventArgs(::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(PartialMediaFailureDetectedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::PartialMediaFailureDetectedEventArgs^ UnwrapPartialMediaFailureDetectedEventArgs(Local<Value> value) {
     return PartialMediaFailureDetectedEventArgs::Unwrap<PartialMediaFailureDetectedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitPartialMediaFailureDetectedEventArgs(Local<Object> exports) {
    PartialMediaFailureDetectedEventArgs::Init(exports);
  }

  class BrushCollection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("BrushCollection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getAt", GetAt);
            Nan::SetPrototypeMethod(localRef, "getView", GetView);
            Nan::SetPrototypeMethod(localRef, "indexOf", IndexOf);
            Nan::SetPrototypeMethod(localRef, "setAt", SetAt);
            Nan::SetPrototypeMethod(localRef, "insertAt", InsertAt);
            Nan::SetPrototypeMethod(localRef, "removeAt", RemoveAt);
            Nan::SetPrototypeMethod(localRef, "append", Append);
            Nan::SetPrototypeMethod(localRef, "removeAtEnd", RemoveAtEnd);
            Nan::SetPrototypeMethod(localRef, "clear", Clear);
            Nan::SetPrototypeMethod(localRef, "getMany", GetMany);
            Nan::SetPrototypeMethod(localRef, "replaceAll", ReplaceAll);
            Nan::SetPrototypeMethod(localRef, "first", First);
          




        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("BrushCollection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      BrushCollection(::Windows::UI::Xaml::Media::BrushCollection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::BrushCollection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BrushCollection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::BrushCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::BrushCollection();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      BrushCollection *wrapperInstance = new BrushCollection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BrushCollection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::BrushCollection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::BrushCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapBrushCollection(winRtInstance));
    }


    static void GetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BrushCollection^>(info.This())) {
        return;
      }

      BrushCollection *wrapper = BrushCollection::Unwrap<BrushCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          ::Windows::UI::Xaml::Media::Brush^ result;
          result = wrapper->_instance->GetAt(arg0);
          info.GetReturnValue().Set(WrapBrush(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BrushCollection^>(info.This())) {
        return;
      }

      BrushCollection *wrapper = BrushCollection::Unwrap<BrushCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IVectorView<::Windows::UI::Xaml::Media::Brush^>^ result;
          result = wrapper->_instance->GetView();
          info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Windows::UI::Xaml::Media::Brush^>::CreateVectorViewWrapper(result, 
            [](::Windows::UI::Xaml::Media::Brush^ val) -> Local<Value> {
              return WrapBrush(val);
            },
            [](Local<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(value);
            },
            [](Local<Value> value) -> ::Windows::UI::Xaml::Media::Brush^ {
              return UnwrapBrush(value);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void IndexOf(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BrushCollection^>(info.This())) {
        return;
      }

      BrushCollection *wrapper = BrushCollection::Unwrap<BrushCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Media::Brush^ arg0 = UnwrapBrush(info[0]);
          unsigned int arg1;
          
          bool result;
          result = wrapper->_instance->IndexOf(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("boolean").ToLocalChecked(), Nan::New<Boolean>(result));
          Nan::Set(resObj, Nan::New<String>("index").ToLocalChecked(), Nan::New<Integer>(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BrushCollection^>(info.This())) {
        return;
      }

      BrushCollection *wrapper = BrushCollection::Unwrap<BrushCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Xaml::Media::Brush^ arg1 = UnwrapBrush(info[1]);
          
          wrapper->_instance->SetAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BrushCollection^>(info.This())) {
        return;
      }

      BrushCollection *wrapper = BrushCollection::Unwrap<BrushCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Xaml::Media::Brush^ arg1 = UnwrapBrush(info[1]);
          
          wrapper->_instance->InsertAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BrushCollection^>(info.This())) {
        return;
      }

      BrushCollection *wrapper = BrushCollection::Unwrap<BrushCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          wrapper->_instance->RemoveAt(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Append(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BrushCollection^>(info.This())) {
        return;
      }

      BrushCollection *wrapper = BrushCollection::Unwrap<BrushCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Media::Brush^ arg0 = UnwrapBrush(info[0]);
          
          wrapper->_instance->Append(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAtEnd(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BrushCollection^>(info.This())) {
        return;
      }

      BrushCollection *wrapper = BrushCollection::Unwrap<BrushCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->RemoveAtEnd();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BrushCollection^>(info.This())) {
        return;
      }

      BrushCollection *wrapper = BrushCollection::Unwrap<BrushCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Clear();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetMany(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Not implemented")));
    }
    static void ReplaceAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BrushCollection^>(info.This())) {
        return;
      }

      BrushCollection *wrapper = BrushCollection::Unwrap<BrushCollection>(info.This());

      if (info.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<::Windows::UI::Xaml::Media::Brush^>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Platform::Array<::Windows::UI::Xaml::Media::Brush^>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<::Windows::UI::Xaml::Media::Brush^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<::Windows::UI::Xaml::Media::Brush^>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(value);
                 },
                 [](Local<Value> value) -> ::Windows::UI::Xaml::Media::Brush^ {
                   return UnwrapBrush(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<::Windows::UI::Xaml::Media::Brush^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          wrapper->_instance->ReplaceAll(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BrushCollection^>(info.This())) {
        return;
      }

      BrushCollection *wrapper = BrushCollection::Unwrap<BrushCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::UI::Xaml::Media::Brush^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::UI::Xaml::Media::Brush^>::CreateIteratorWrapper(result, 
            [](::Windows::UI::Xaml::Media::Brush^ val) -> Local<Value> {
              return WrapBrush(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





    private:
      ::Windows::UI::Xaml::Media::BrushCollection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapBrushCollection(::Windows::UI::Xaml::Media::BrushCollection^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::BrushCollection^ UnwrapBrushCollection(Local<Value> value);
  };

  Persistent<FunctionTemplate> BrushCollection::s_constructorTemplate;

  v8::Local<v8::Value> WrapBrushCollection(::Windows::UI::Xaml::Media::BrushCollection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(BrushCollection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::BrushCollection^ UnwrapBrushCollection(Local<Value> value) {
     return BrushCollection::Unwrap<BrushCollection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitBrushCollection(Local<Object> exports) {
    BrushCollection::Init(exports);
  }

  class RenderedEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("RenderedEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("frameDuration").ToLocalChecked(), FrameDurationGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("RenderedEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      RenderedEventArgs(::Windows::UI::Xaml::Media::RenderedEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::RenderedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RenderedEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::RenderedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      RenderedEventArgs *wrapperInstance = new RenderedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RenderedEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::RenderedEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::RenderedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapRenderedEventArgs(winRtInstance));
    }





    static void FrameDurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RenderedEventArgs^>(info.This())) {
        return;
      }

      RenderedEventArgs *wrapper = RenderedEventArgs::Unwrap<RenderedEventArgs>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->FrameDuration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Xaml::Media::RenderedEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapRenderedEventArgs(::Windows::UI::Xaml::Media::RenderedEventArgs^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::RenderedEventArgs^ UnwrapRenderedEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> RenderedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapRenderedEventArgs(::Windows::UI::Xaml::Media::RenderedEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(RenderedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::RenderedEventArgs^ UnwrapRenderedEventArgs(Local<Value> value) {
     return RenderedEventArgs::Unwrap<RenderedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitRenderedEventArgs(Local<Object> exports) {
    RenderedEventArgs::Init(exports);
  }

  class CompositionTarget : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionTarget").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);






        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        
              Local<Function> addListenerFunc = Nan::GetFunction(Nan::New<FunctionTemplate>(AddListener)).ToLocalChecked();
              Nan::Set(constructor, Nan::New<String>("addListener").ToLocalChecked(), addListenerFunc);
              Nan::Set(constructor, Nan::New<String>("on").ToLocalChecked(), addListenerFunc);
              Local<Function> removeListenerFunc = Nan::GetFunction(Nan::New<FunctionTemplate>(RemoveListener)).ToLocalChecked();
              Nan::Set(constructor, Nan::New<String>("removeListener").ToLocalChecked(), removeListenerFunc);
              Nan::Set(constructor, Nan::New<String>("off").ToLocalChecked(), removeListenerFunc);


        Nan::Set(exports, Nan::New<String>("CompositionTarget").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionTarget(::Windows::UI::Xaml::Media::CompositionTarget^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::CompositionTarget^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositionTarget^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::CompositionTarget^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionTarget *wrapperInstance = new CompositionTarget(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositionTarget^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::CompositionTarget^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::CompositionTarget^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionTarget(winRtInstance));
    }







    static void AddListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected arguments are eventName(string),callback(function)")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      Local<Function> callback = info[1].As<Function>();

      ::Windows::Foundation::EventRegistrationToken registrationToken;
      if (NodeRT::Utils::CaseInsenstiveEquals(L"rendered", str))
      {
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = ::Windows::UI::Xaml::Media::CompositionTarget::Rendered::add(
            ref new ::Windows::Foundation::EventHandler<::Windows::UI::Xaml::Media::RenderedEventArgs^>(
            [callbackObjPtr](::Platform::Object^ arg0, ::Windows::UI::Xaml::Media::RenderedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = CreateOpaqueWrapper(arg0);
                  wrappedArg1 = WrapRenderedEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"rendering", str))
      {
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = ::Windows::UI::Xaml::Media::CompositionTarget::Rendering::add(
            ref new ::Windows::Foundation::EventHandler<::Platform::Object^>(
            [callbackObjPtr](::Platform::Object^ arg0, ::Platform::Object^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = CreateOpaqueWrapper(arg0);
                  wrappedArg1 = CreateOpaqueWrapper(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"surfaceContentsLost", str))
      {
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = ::Windows::UI::Xaml::Media::CompositionTarget::SurfaceContentsLost::add(
            ref new ::Windows::Foundation::EventHandler<::Platform::Object^>(
            [callbackObjPtr](::Platform::Object^ arg0, ::Platform::Object^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = CreateOpaqueWrapper(arg0);
                  wrappedArg1 = CreateOpaqueWrapper(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
 else  {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Value> tokenMapVal = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());
      Local<Object> tokenMap;

      if (tokenMapVal.IsEmpty() || Nan::Equals(tokenMapVal, Undefined()).FromMaybe(false)) {
        tokenMap = Nan::New<Object>();
        NodeRT::Utils::SetHiddenValueWithObject(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked(), tokenMap);
      } else {
        tokenMap = Nan::To<Object>(tokenMapVal).ToLocalChecked();
      }

      Nan::Set(tokenMap, info[0], CreateOpaqueWrapper(::Windows::Foundation::PropertyValue::CreateInt64(registrationToken.Value)));
    }

    static void RemoveListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected a string and a callback")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      if ((!NodeRT::Utils::CaseInsenstiveEquals(L"rendered", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"rendering", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"surfaceContentsLost", str))) {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Function> callback = info[1].As<Function>();
      Local<Value> tokenMap = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());

      if (tokenMap.IsEmpty() || Nan::Equals(tokenMap, Undefined()).FromMaybe(false)) {
        return;
      }

      Local<Value> opaqueWrapperObj =  Nan::Get(Nan::To<Object>(tokenMap).ToLocalChecked(), info[0]).ToLocalChecked();

      if (opaqueWrapperObj.IsEmpty() || Nan::Equals(opaqueWrapperObj,Undefined()).FromMaybe(false)) {
        return;
      }

      OpaqueWrapper *opaqueWrapper = OpaqueWrapper::Unwrap<OpaqueWrapper>(opaqueWrapperObj.As<Object>());

      long long tokenValue = (long long) opaqueWrapper->GetObjectInstance();
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      registrationToken.Value = tokenValue;

      try  {
        if (NodeRT::Utils::CaseInsenstiveEquals(L"rendered", str)) {
          ::Windows::UI::Xaml::Media::CompositionTarget::Rendered::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"rendering", str))
        {
          ::Windows::UI::Xaml::Media::CompositionTarget::Rendering::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"surfaceContentsLost", str))
        {
          ::Windows::UI::Xaml::Media::CompositionTarget::SurfaceContentsLost::remove(registrationToken);
        }
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }

      Nan::Delete(Nan::To<Object>(tokenMap).ToLocalChecked(), Nan::To<String>(info[0]).ToLocalChecked());
    }
    private:
      ::Windows::UI::Xaml::Media::CompositionTarget^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionTarget(::Windows::UI::Xaml::Media::CompositionTarget^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::CompositionTarget^ UnwrapCompositionTarget(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionTarget::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionTarget(::Windows::UI::Xaml::Media::CompositionTarget^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionTarget::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::CompositionTarget^ UnwrapCompositionTarget(Local<Value> value) {
     return CompositionTarget::Unwrap<CompositionTarget>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionTarget(Local<Object> exports) {
    CompositionTarget::Init(exports);
  }

  class DoubleCollection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("DoubleCollection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getAt", GetAt);
            Nan::SetPrototypeMethod(localRef, "getView", GetView);
            Nan::SetPrototypeMethod(localRef, "indexOf", IndexOf);
            Nan::SetPrototypeMethod(localRef, "setAt", SetAt);
            Nan::SetPrototypeMethod(localRef, "insertAt", InsertAt);
            Nan::SetPrototypeMethod(localRef, "removeAt", RemoveAt);
            Nan::SetPrototypeMethod(localRef, "append", Append);
            Nan::SetPrototypeMethod(localRef, "removeAtEnd", RemoveAtEnd);
            Nan::SetPrototypeMethod(localRef, "clear", Clear);
            Nan::SetPrototypeMethod(localRef, "getMany", GetMany);
            Nan::SetPrototypeMethod(localRef, "replaceAll", ReplaceAll);
            Nan::SetPrototypeMethod(localRef, "first", First);
          




        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("DoubleCollection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      DoubleCollection(::Windows::UI::Xaml::Media::DoubleCollection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::DoubleCollection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::DoubleCollection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::DoubleCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::DoubleCollection();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      DoubleCollection *wrapperInstance = new DoubleCollection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::DoubleCollection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::DoubleCollection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::DoubleCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapDoubleCollection(winRtInstance));
    }


    static void GetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::DoubleCollection^>(info.This())) {
        return;
      }

      DoubleCollection *wrapper = DoubleCollection::Unwrap<DoubleCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          double result;
          result = wrapper->_instance->GetAt(arg0);
          info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::DoubleCollection^>(info.This())) {
        return;
      }

      DoubleCollection *wrapper = DoubleCollection::Unwrap<DoubleCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IVectorView<double>^ result;
          result = wrapper->_instance->GetView();
          info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<double>::CreateVectorViewWrapper(result, 
            [](double val) -> Local<Value> {
              return Nan::New<Number>(static_cast<double>(val));
            },
            [](Local<Value> value) -> bool {
              return value->IsNumber();
            },
            [](Local<Value> value) -> double {
              return Nan::To<double>(value).FromMaybe(0.0);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void IndexOf(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::DoubleCollection^>(info.This())) {
        return;
      }

      DoubleCollection *wrapper = DoubleCollection::Unwrap<DoubleCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsNumber())
      {
        try
        {
          double arg0 = Nan::To<double>(info[0]).FromMaybe(0.0);
          unsigned int arg1;
          
          bool result;
          result = wrapper->_instance->IndexOf(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("boolean").ToLocalChecked(), Nan::New<Boolean>(result));
          Nan::Set(resObj, Nan::New<String>("index").ToLocalChecked(), Nan::New<Integer>(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::DoubleCollection^>(info.This())) {
        return;
      }

      DoubleCollection *wrapper = DoubleCollection::Unwrap<DoubleCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && info[1]->IsNumber())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          double arg1 = Nan::To<double>(info[1]).FromMaybe(0.0);
          
          wrapper->_instance->SetAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::DoubleCollection^>(info.This())) {
        return;
      }

      DoubleCollection *wrapper = DoubleCollection::Unwrap<DoubleCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && info[1]->IsNumber())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          double arg1 = Nan::To<double>(info[1]).FromMaybe(0.0);
          
          wrapper->_instance->InsertAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::DoubleCollection^>(info.This())) {
        return;
      }

      DoubleCollection *wrapper = DoubleCollection::Unwrap<DoubleCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          wrapper->_instance->RemoveAt(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Append(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::DoubleCollection^>(info.This())) {
        return;
      }

      DoubleCollection *wrapper = DoubleCollection::Unwrap<DoubleCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsNumber())
      {
        try
        {
          double arg0 = Nan::To<double>(info[0]).FromMaybe(0.0);
          
          wrapper->_instance->Append(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAtEnd(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::DoubleCollection^>(info.This())) {
        return;
      }

      DoubleCollection *wrapper = DoubleCollection::Unwrap<DoubleCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->RemoveAtEnd();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::DoubleCollection^>(info.This())) {
        return;
      }

      DoubleCollection *wrapper = DoubleCollection::Unwrap<DoubleCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Clear();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetMany(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Not implemented")));
    }
    static void ReplaceAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::DoubleCollection^>(info.This())) {
        return;
      }

      DoubleCollection *wrapper = DoubleCollection::Unwrap<DoubleCollection>(info.This());

      if (info.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<double>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Platform::Array<double>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<double>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<double>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return value->IsNumber();
                 },
                 [](Local<Value> value) -> double {
                   return Nan::To<double>(value).FromMaybe(0.0);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<double>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          wrapper->_instance->ReplaceAll(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::DoubleCollection^>(info.This())) {
        return;
      }

      DoubleCollection *wrapper = DoubleCollection::Unwrap<DoubleCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<double>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<double>::CreateIteratorWrapper(result, 
            [](double val) -> Local<Value> {
              return Nan::New<Number>(static_cast<double>(val));
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





    private:
      ::Windows::UI::Xaml::Media::DoubleCollection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapDoubleCollection(::Windows::UI::Xaml::Media::DoubleCollection^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::DoubleCollection^ UnwrapDoubleCollection(Local<Value> value);
  };

  Persistent<FunctionTemplate> DoubleCollection::s_constructorTemplate;

  v8::Local<v8::Value> WrapDoubleCollection(::Windows::UI::Xaml::Media::DoubleCollection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(DoubleCollection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::DoubleCollection^ UnwrapDoubleCollection(Local<Value> value) {
     return DoubleCollection::Unwrap<DoubleCollection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitDoubleCollection(Local<Object> exports) {
    DoubleCollection::Init(exports);
  }

  class FontFamily : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("FontFamily").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("source").ToLocalChecked(), SourceGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("xamlAutoFontFamily").ToLocalChecked(), XamlAutoFontFamilyGetter);


        Nan::Set(exports, Nan::New<String>("FontFamily").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      FontFamily(::Windows::UI::Xaml::Media::FontFamily^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::FontFamily^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::FontFamily^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::FontFamily^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 1
        && info[0]->IsString())
      {
        try {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          
          winRtInstance = ref new ::Windows::UI::Xaml::Media::FontFamily(arg0);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      FontFamily *wrapperInstance = new FontFamily(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::FontFamily^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::FontFamily^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::FontFamily^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapFontFamily(winRtInstance));
    }





    static void SourceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::FontFamily^>(info.This())) {
        return;
      }

      FontFamily *wrapper = FontFamily::Unwrap<FontFamily>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Source;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void XamlAutoFontFamilyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::Media::FontFamily^ result = ::Windows::UI::Xaml::Media::FontFamily::XamlAutoFontFamily;
        info.GetReturnValue().Set(WrapFontFamily(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::FontFamily^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapFontFamily(::Windows::UI::Xaml::Media::FontFamily^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::FontFamily^ UnwrapFontFamily(Local<Value> value);
  };

  Persistent<FunctionTemplate> FontFamily::s_constructorTemplate;

  v8::Local<v8::Value> WrapFontFamily(::Windows::UI::Xaml::Media::FontFamily^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(FontFamily::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::FontFamily^ UnwrapFontFamily(Local<Value> value) {
     return FontFamily::Unwrap<FontFamily>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitFontFamily(Local<Object> exports) {
    FontFamily::Init(exports);
  }

  class MediaTransportControlsThumbnailRequestedEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("MediaTransportControlsThumbnailRequestedEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "setThumbnailImage", SetThumbnailImage);
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          




        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("MediaTransportControlsThumbnailRequestedEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      MediaTransportControlsThumbnailRequestedEventArgs(::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      MediaTransportControlsThumbnailRequestedEventArgs *wrapperInstance = new MediaTransportControlsThumbnailRequestedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapMediaTransportControlsThumbnailRequestedEventArgs(winRtInstance));
    }


    static void SetThumbnailImage(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^>(info.This())) {
        return;
      }

      MediaTransportControlsThumbnailRequestedEventArgs *wrapper = MediaTransportControlsThumbnailRequestedEventArgs::Unwrap<MediaTransportControlsThumbnailRequestedEventArgs>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Storage::Streams::IInputStream^>(info[0]))
      {
        try
        {
          ::Windows::Storage::Streams::IInputStream^ arg0 = dynamic_cast<::Windows::Storage::Streams::IInputStream^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          wrapper->_instance->SetThumbnailImage(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^>(info.This())) {
        return;
      }

      MediaTransportControlsThumbnailRequestedEventArgs *wrapper = MediaTransportControlsThumbnailRequestedEventArgs::Unwrap<MediaTransportControlsThumbnailRequestedEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





    private:
      ::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapMediaTransportControlsThumbnailRequestedEventArgs(::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^ UnwrapMediaTransportControlsThumbnailRequestedEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> MediaTransportControlsThumbnailRequestedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapMediaTransportControlsThumbnailRequestedEventArgs(::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(MediaTransportControlsThumbnailRequestedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::MediaTransportControlsThumbnailRequestedEventArgs^ UnwrapMediaTransportControlsThumbnailRequestedEventArgs(Local<Value> value) {
     return MediaTransportControlsThumbnailRequestedEventArgs::Unwrap<MediaTransportControlsThumbnailRequestedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitMediaTransportControlsThumbnailRequestedEventArgs(Local<Object> exports) {
    MediaTransportControlsThumbnailRequestedEventArgs::Init(exports);
  }

  class PointCollection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("PointCollection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getAt", GetAt);
            Nan::SetPrototypeMethod(localRef, "getView", GetView);
            Nan::SetPrototypeMethod(localRef, "indexOf", IndexOf);
            Nan::SetPrototypeMethod(localRef, "setAt", SetAt);
            Nan::SetPrototypeMethod(localRef, "insertAt", InsertAt);
            Nan::SetPrototypeMethod(localRef, "removeAt", RemoveAt);
            Nan::SetPrototypeMethod(localRef, "append", Append);
            Nan::SetPrototypeMethod(localRef, "removeAtEnd", RemoveAtEnd);
            Nan::SetPrototypeMethod(localRef, "clear", Clear);
            Nan::SetPrototypeMethod(localRef, "getMany", GetMany);
            Nan::SetPrototypeMethod(localRef, "replaceAll", ReplaceAll);
            Nan::SetPrototypeMethod(localRef, "first", First);
          




        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("PointCollection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      PointCollection(::Windows::UI::Xaml::Media::PointCollection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::PointCollection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::PointCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::PointCollection();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      PointCollection *wrapperInstance = new PointCollection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::PointCollection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::PointCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapPointCollection(winRtInstance));
    }


    static void GetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(info.This())) {
        return;
      }

      PointCollection *wrapper = PointCollection::Unwrap<PointCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          ::Windows::Foundation::Point result;
          result = wrapper->_instance->GetAt(arg0);
          info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(info.This())) {
        return;
      }

      PointCollection *wrapper = PointCollection::Unwrap<PointCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IVectorView<::Windows::Foundation::Point>^ result;
          result = wrapper->_instance->GetView();
          info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Windows::Foundation::Point>::CreateVectorViewWrapper(result, 
            [](::Windows::Foundation::Point val) -> Local<Value> {
              return NodeRT::Utils::PointToJs(val);
            },
            [](Local<Value> value) -> bool {
              return NodeRT::Utils::IsPoint(value);
            },
            [](Local<Value> value) -> ::Windows::Foundation::Point {
              return NodeRT::Utils::PointFromJs(value);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void IndexOf(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(info.This())) {
        return;
      }

      PointCollection *wrapper = PointCollection::Unwrap<PointCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsPoint(info[0]))
      {
        try
        {
          ::Windows::Foundation::Point arg0 = NodeRT::Utils::PointFromJs(info[0]);
          unsigned int arg1;
          
          bool result;
          result = wrapper->_instance->IndexOf(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("boolean").ToLocalChecked(), Nan::New<Boolean>(result));
          Nan::Set(resObj, Nan::New<String>("index").ToLocalChecked(), Nan::New<Integer>(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(info.This())) {
        return;
      }

      PointCollection *wrapper = PointCollection::Unwrap<PointCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsPoint(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::Foundation::Point arg1 = NodeRT::Utils::PointFromJs(info[1]);
          
          wrapper->_instance->SetAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(info.This())) {
        return;
      }

      PointCollection *wrapper = PointCollection::Unwrap<PointCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsPoint(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::Foundation::Point arg1 = NodeRT::Utils::PointFromJs(info[1]);
          
          wrapper->_instance->InsertAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(info.This())) {
        return;
      }

      PointCollection *wrapper = PointCollection::Unwrap<PointCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          wrapper->_instance->RemoveAt(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Append(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(info.This())) {
        return;
      }

      PointCollection *wrapper = PointCollection::Unwrap<PointCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsPoint(info[0]))
      {
        try
        {
          ::Windows::Foundation::Point arg0 = NodeRT::Utils::PointFromJs(info[0]);
          
          wrapper->_instance->Append(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAtEnd(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(info.This())) {
        return;
      }

      PointCollection *wrapper = PointCollection::Unwrap<PointCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->RemoveAtEnd();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(info.This())) {
        return;
      }

      PointCollection *wrapper = PointCollection::Unwrap<PointCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Clear();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetMany(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Not implemented")));
    }
    static void ReplaceAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(info.This())) {
        return;
      }

      PointCollection *wrapper = PointCollection::Unwrap<PointCollection>(info.This());

      if (info.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<::Windows::Foundation::Point>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Platform::Array<::Windows::Foundation::Point>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<::Windows::Foundation::Point>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<::Windows::Foundation::Point>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsPoint(value);
                 },
                 [](Local<Value> value) -> ::Windows::Foundation::Point {
                   return NodeRT::Utils::PointFromJs(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<::Windows::Foundation::Point>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          wrapper->_instance->ReplaceAll(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(info.This())) {
        return;
      }

      PointCollection *wrapper = PointCollection::Unwrap<PointCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::Foundation::Point>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::Foundation::Point>::CreateIteratorWrapper(result, 
            [](::Windows::Foundation::Point val) -> Local<Value> {
              return NodeRT::Utils::PointToJs(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





    private:
      ::Windows::UI::Xaml::Media::PointCollection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapPointCollection(::Windows::UI::Xaml::Media::PointCollection^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::PointCollection^ UnwrapPointCollection(Local<Value> value);
  };

  Persistent<FunctionTemplate> PointCollection::s_constructorTemplate;

  v8::Local<v8::Value> WrapPointCollection(::Windows::UI::Xaml::Media::PointCollection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(PointCollection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::PointCollection^ UnwrapPointCollection(Local<Value> value) {
     return PointCollection::Unwrap<PointCollection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitPointCollection(Local<Object> exports) {
    PointCollection::Init(exports);
  }

  class RenderingEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("RenderingEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("renderingTime").ToLocalChecked(), RenderingTimeGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("RenderingEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      RenderingEventArgs(::Windows::UI::Xaml::Media::RenderingEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::RenderingEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RenderingEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::RenderingEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      RenderingEventArgs *wrapperInstance = new RenderingEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RenderingEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::RenderingEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::RenderingEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapRenderingEventArgs(winRtInstance));
    }





    static void RenderingTimeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RenderingEventArgs^>(info.This())) {
        return;
      }

      RenderingEventArgs *wrapper = RenderingEventArgs::Unwrap<RenderingEventArgs>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->RenderingTime;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Xaml::Media::RenderingEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapRenderingEventArgs(::Windows::UI::Xaml::Media::RenderingEventArgs^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::RenderingEventArgs^ UnwrapRenderingEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> RenderingEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapRenderingEventArgs(::Windows::UI::Xaml::Media::RenderingEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(RenderingEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::RenderingEventArgs^ UnwrapRenderingEventArgs(Local<Value> value) {
     return RenderingEventArgs::Unwrap<RenderingEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitRenderingEventArgs(Local<Object> exports) {
    RenderingEventArgs::Init(exports);
  }

  class TimelineMarkerCollection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("TimelineMarkerCollection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getAt", GetAt);
            Nan::SetPrototypeMethod(localRef, "getView", GetView);
            Nan::SetPrototypeMethod(localRef, "indexOf", IndexOf);
            Nan::SetPrototypeMethod(localRef, "setAt", SetAt);
            Nan::SetPrototypeMethod(localRef, "insertAt", InsertAt);
            Nan::SetPrototypeMethod(localRef, "removeAt", RemoveAt);
            Nan::SetPrototypeMethod(localRef, "append", Append);
            Nan::SetPrototypeMethod(localRef, "removeAtEnd", RemoveAtEnd);
            Nan::SetPrototypeMethod(localRef, "clear", Clear);
            Nan::SetPrototypeMethod(localRef, "getMany", GetMany);
            Nan::SetPrototypeMethod(localRef, "replaceAll", ReplaceAll);
            Nan::SetPrototypeMethod(localRef, "first", First);
          




        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("TimelineMarkerCollection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      TimelineMarkerCollection(::Windows::UI::Xaml::Media::TimelineMarkerCollection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::TimelineMarkerCollection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerCollection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::TimelineMarkerCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::TimelineMarkerCollection();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      TimelineMarkerCollection *wrapperInstance = new TimelineMarkerCollection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerCollection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::TimelineMarkerCollection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::TimelineMarkerCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapTimelineMarkerCollection(winRtInstance));
    }


    static void GetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerCollection^>(info.This())) {
        return;
      }

      TimelineMarkerCollection *wrapper = TimelineMarkerCollection::Unwrap<TimelineMarkerCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          ::Windows::UI::Xaml::Media::TimelineMarker^ result;
          result = wrapper->_instance->GetAt(arg0);
          info.GetReturnValue().Set(WrapTimelineMarker(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerCollection^>(info.This())) {
        return;
      }

      TimelineMarkerCollection *wrapper = TimelineMarkerCollection::Unwrap<TimelineMarkerCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IVectorView<::Windows::UI::Xaml::Media::TimelineMarker^>^ result;
          result = wrapper->_instance->GetView();
          info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Windows::UI::Xaml::Media::TimelineMarker^>::CreateVectorViewWrapper(result, 
            [](::Windows::UI::Xaml::Media::TimelineMarker^ val) -> Local<Value> {
              return WrapTimelineMarker(val);
            },
            [](Local<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(value);
            },
            [](Local<Value> value) -> ::Windows::UI::Xaml::Media::TimelineMarker^ {
              return UnwrapTimelineMarker(value);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void IndexOf(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerCollection^>(info.This())) {
        return;
      }

      TimelineMarkerCollection *wrapper = TimelineMarkerCollection::Unwrap<TimelineMarkerCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Media::TimelineMarker^ arg0 = UnwrapTimelineMarker(info[0]);
          unsigned int arg1;
          
          bool result;
          result = wrapper->_instance->IndexOf(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("boolean").ToLocalChecked(), Nan::New<Boolean>(result));
          Nan::Set(resObj, Nan::New<String>("index").ToLocalChecked(), Nan::New<Integer>(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerCollection^>(info.This())) {
        return;
      }

      TimelineMarkerCollection *wrapper = TimelineMarkerCollection::Unwrap<TimelineMarkerCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Xaml::Media::TimelineMarker^ arg1 = UnwrapTimelineMarker(info[1]);
          
          wrapper->_instance->SetAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerCollection^>(info.This())) {
        return;
      }

      TimelineMarkerCollection *wrapper = TimelineMarkerCollection::Unwrap<TimelineMarkerCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Xaml::Media::TimelineMarker^ arg1 = UnwrapTimelineMarker(info[1]);
          
          wrapper->_instance->InsertAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerCollection^>(info.This())) {
        return;
      }

      TimelineMarkerCollection *wrapper = TimelineMarkerCollection::Unwrap<TimelineMarkerCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          wrapper->_instance->RemoveAt(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Append(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerCollection^>(info.This())) {
        return;
      }

      TimelineMarkerCollection *wrapper = TimelineMarkerCollection::Unwrap<TimelineMarkerCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Media::TimelineMarker^ arg0 = UnwrapTimelineMarker(info[0]);
          
          wrapper->_instance->Append(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAtEnd(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerCollection^>(info.This())) {
        return;
      }

      TimelineMarkerCollection *wrapper = TimelineMarkerCollection::Unwrap<TimelineMarkerCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->RemoveAtEnd();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerCollection^>(info.This())) {
        return;
      }

      TimelineMarkerCollection *wrapper = TimelineMarkerCollection::Unwrap<TimelineMarkerCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Clear();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetMany(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Not implemented")));
    }
    static void ReplaceAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerCollection^>(info.This())) {
        return;
      }

      TimelineMarkerCollection *wrapper = TimelineMarkerCollection::Unwrap<TimelineMarkerCollection>(info.This());

      if (info.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<::Windows::UI::Xaml::Media::TimelineMarker^>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Platform::Array<::Windows::UI::Xaml::Media::TimelineMarker^>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<::Windows::UI::Xaml::Media::TimelineMarker^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<::Windows::UI::Xaml::Media::TimelineMarker^>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(value);
                 },
                 [](Local<Value> value) -> ::Windows::UI::Xaml::Media::TimelineMarker^ {
                   return UnwrapTimelineMarker(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<::Windows::UI::Xaml::Media::TimelineMarker^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          wrapper->_instance->ReplaceAll(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerCollection^>(info.This())) {
        return;
      }

      TimelineMarkerCollection *wrapper = TimelineMarkerCollection::Unwrap<TimelineMarkerCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::UI::Xaml::Media::TimelineMarker^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::UI::Xaml::Media::TimelineMarker^>::CreateIteratorWrapper(result, 
            [](::Windows::UI::Xaml::Media::TimelineMarker^ val) -> Local<Value> {
              return WrapTimelineMarker(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





    private:
      ::Windows::UI::Xaml::Media::TimelineMarkerCollection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapTimelineMarkerCollection(::Windows::UI::Xaml::Media::TimelineMarkerCollection^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::TimelineMarkerCollection^ UnwrapTimelineMarkerCollection(Local<Value> value);
  };

  Persistent<FunctionTemplate> TimelineMarkerCollection::s_constructorTemplate;

  v8::Local<v8::Value> WrapTimelineMarkerCollection(::Windows::UI::Xaml::Media::TimelineMarkerCollection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(TimelineMarkerCollection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::TimelineMarkerCollection^ UnwrapTimelineMarkerCollection(Local<Value> value) {
     return TimelineMarkerCollection::Unwrap<TimelineMarkerCollection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitTimelineMarkerCollection(Local<Object> exports) {
    TimelineMarkerCollection::Init(exports);
  }

  class TransformCollection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("TransformCollection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getAt", GetAt);
            Nan::SetPrototypeMethod(localRef, "getView", GetView);
            Nan::SetPrototypeMethod(localRef, "indexOf", IndexOf);
            Nan::SetPrototypeMethod(localRef, "setAt", SetAt);
            Nan::SetPrototypeMethod(localRef, "insertAt", InsertAt);
            Nan::SetPrototypeMethod(localRef, "removeAt", RemoveAt);
            Nan::SetPrototypeMethod(localRef, "append", Append);
            Nan::SetPrototypeMethod(localRef, "removeAtEnd", RemoveAtEnd);
            Nan::SetPrototypeMethod(localRef, "clear", Clear);
            Nan::SetPrototypeMethod(localRef, "getMany", GetMany);
            Nan::SetPrototypeMethod(localRef, "replaceAll", ReplaceAll);
            Nan::SetPrototypeMethod(localRef, "first", First);
          




        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("TransformCollection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      TransformCollection(::Windows::UI::Xaml::Media::TransformCollection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::TransformCollection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformCollection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::TransformCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::TransformCollection();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      TransformCollection *wrapperInstance = new TransformCollection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformCollection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::TransformCollection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::TransformCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapTransformCollection(winRtInstance));
    }


    static void GetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformCollection^>(info.This())) {
        return;
      }

      TransformCollection *wrapper = TransformCollection::Unwrap<TransformCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          ::Windows::UI::Xaml::Media::Transform^ result;
          result = wrapper->_instance->GetAt(arg0);
          info.GetReturnValue().Set(WrapTransform(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformCollection^>(info.This())) {
        return;
      }

      TransformCollection *wrapper = TransformCollection::Unwrap<TransformCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IVectorView<::Windows::UI::Xaml::Media::Transform^>^ result;
          result = wrapper->_instance->GetView();
          info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Windows::UI::Xaml::Media::Transform^>::CreateVectorViewWrapper(result, 
            [](::Windows::UI::Xaml::Media::Transform^ val) -> Local<Value> {
              return WrapTransform(val);
            },
            [](Local<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value);
            },
            [](Local<Value> value) -> ::Windows::UI::Xaml::Media::Transform^ {
              return UnwrapTransform(value);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void IndexOf(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformCollection^>(info.This())) {
        return;
      }

      TransformCollection *wrapper = TransformCollection::Unwrap<TransformCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Media::Transform^ arg0 = UnwrapTransform(info[0]);
          unsigned int arg1;
          
          bool result;
          result = wrapper->_instance->IndexOf(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("boolean").ToLocalChecked(), Nan::New<Boolean>(result));
          Nan::Set(resObj, Nan::New<String>("index").ToLocalChecked(), Nan::New<Integer>(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformCollection^>(info.This())) {
        return;
      }

      TransformCollection *wrapper = TransformCollection::Unwrap<TransformCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Xaml::Media::Transform^ arg1 = UnwrapTransform(info[1]);
          
          wrapper->_instance->SetAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformCollection^>(info.This())) {
        return;
      }

      TransformCollection *wrapper = TransformCollection::Unwrap<TransformCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Xaml::Media::Transform^ arg1 = UnwrapTransform(info[1]);
          
          wrapper->_instance->InsertAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformCollection^>(info.This())) {
        return;
      }

      TransformCollection *wrapper = TransformCollection::Unwrap<TransformCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          wrapper->_instance->RemoveAt(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Append(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformCollection^>(info.This())) {
        return;
      }

      TransformCollection *wrapper = TransformCollection::Unwrap<TransformCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Media::Transform^ arg0 = UnwrapTransform(info[0]);
          
          wrapper->_instance->Append(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAtEnd(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformCollection^>(info.This())) {
        return;
      }

      TransformCollection *wrapper = TransformCollection::Unwrap<TransformCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->RemoveAtEnd();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformCollection^>(info.This())) {
        return;
      }

      TransformCollection *wrapper = TransformCollection::Unwrap<TransformCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Clear();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetMany(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Not implemented")));
    }
    static void ReplaceAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformCollection^>(info.This())) {
        return;
      }

      TransformCollection *wrapper = TransformCollection::Unwrap<TransformCollection>(info.This());

      if (info.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<::Windows::UI::Xaml::Media::Transform^>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Platform::Array<::Windows::UI::Xaml::Media::Transform^>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<::Windows::UI::Xaml::Media::Transform^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<::Windows::UI::Xaml::Media::Transform^>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value);
                 },
                 [](Local<Value> value) -> ::Windows::UI::Xaml::Media::Transform^ {
                   return UnwrapTransform(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<::Windows::UI::Xaml::Media::Transform^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          wrapper->_instance->ReplaceAll(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformCollection^>(info.This())) {
        return;
      }

      TransformCollection *wrapper = TransformCollection::Unwrap<TransformCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::UI::Xaml::Media::Transform^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::UI::Xaml::Media::Transform^>::CreateIteratorWrapper(result, 
            [](::Windows::UI::Xaml::Media::Transform^ val) -> Local<Value> {
              return WrapTransform(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





    private:
      ::Windows::UI::Xaml::Media::TransformCollection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapTransformCollection(::Windows::UI::Xaml::Media::TransformCollection^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::TransformCollection^ UnwrapTransformCollection(Local<Value> value);
  };

  Persistent<FunctionTemplate> TransformCollection::s_constructorTemplate;

  v8::Local<v8::Value> WrapTransformCollection(::Windows::UI::Xaml::Media::TransformCollection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(TransformCollection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::TransformCollection^ UnwrapTransformCollection(Local<Value> value) {
     return TransformCollection::Unwrap<TransformCollection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitTransformCollection(Local<Object> exports) {
    TransformCollection::Init(exports);
  }

  class Brush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("Brush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("relativeTransform").ToLocalChecked(), RelativeTransformGetter, RelativeTransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("opacityProperty").ToLocalChecked(), OpacityPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("relativeTransformProperty").ToLocalChecked(), RelativeTransformPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("Brush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      Brush(::Windows::UI::Xaml::Media::Brush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::Brush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::Brush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      Brush *wrapperInstance = new Brush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::Brush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::Brush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapBrush(winRtInstance));
    }





    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RelativeTransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->RelativeTransform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RelativeTransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->RelativeTransform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        double result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void OpacityPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::OpacityProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RelativeTransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::RelativeTransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::Brush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapBrush(::Windows::UI::Xaml::Media::Brush^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::Brush^ UnwrapBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> Brush::s_constructorTemplate;

  v8::Local<v8::Value> WrapBrush(::Windows::UI::Xaml::Media::Brush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(Brush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::Brush^ UnwrapBrush(Local<Value> value) {
     return Brush::Unwrap<Brush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitBrush(Local<Object> exports) {
    Brush::Init(exports);
  }

  class CacheMode : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CacheMode").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CacheMode").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CacheMode(::Windows::UI::Xaml::Media::CacheMode^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::CacheMode^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CacheMode^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::CacheMode^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CacheMode *wrapperInstance = new CacheMode(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CacheMode^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::CacheMode^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::CacheMode^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCacheMode(winRtInstance));
    }





    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Xaml::Media::CacheMode^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCacheMode(::Windows::UI::Xaml::Media::CacheMode^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::CacheMode^ UnwrapCacheMode(Local<Value> value);
  };

  Persistent<FunctionTemplate> CacheMode::s_constructorTemplate;

  v8::Local<v8::Value> WrapCacheMode(::Windows::UI::Xaml::Media::CacheMode^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CacheMode::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::CacheMode^ UnwrapCacheMode(Local<Value> value) {
     return CacheMode::Unwrap<CacheMode>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCacheMode(Local<Object> exports) {
    CacheMode::Init(exports);
  }

  class GeneralTransform : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("GeneralTransform").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "transformPoint", TransformPoint);
            Nan::SetPrototypeMethod(localRef, "tryTransform", TryTransform);
            Nan::SetPrototypeMethod(localRef, "transformBounds", TransformBounds);
            Nan::SetPrototypeMethod(localRef, "tryTransformCore", TryTransformCore);
            Nan::SetPrototypeMethod(localRef, "transformBoundsCore", TransformBoundsCore);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("inverse").ToLocalChecked(), InverseGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("GeneralTransform").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      GeneralTransform(::Windows::UI::Xaml::Media::GeneralTransform^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::GeneralTransform^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::GeneralTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      GeneralTransform *wrapperInstance = new GeneralTransform(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::GeneralTransform^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::GeneralTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapGeneralTransform(winRtInstance));
    }


    static void TransformPoint(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info.This())) {
        return;
      }

      GeneralTransform *wrapper = GeneralTransform::Unwrap<GeneralTransform>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsPoint(info[0]))
      {
        try
        {
          ::Windows::Foundation::Point arg0 = NodeRT::Utils::PointFromJs(info[0]);
          
          ::Windows::Foundation::Point result;
          result = wrapper->_instance->TransformPoint(arg0);
          info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void TryTransform(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info.This())) {
        return;
      }

      GeneralTransform *wrapper = GeneralTransform::Unwrap<GeneralTransform>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsPoint(info[0]))
      {
        try
        {
          ::Windows::Foundation::Point arg0 = NodeRT::Utils::PointFromJs(info[0]);
          ::Windows::Foundation::Point arg1;
          
          bool result;
          result = wrapper->_instance->TryTransform(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("boolean").ToLocalChecked(), Nan::New<Boolean>(result));
          Nan::Set(resObj, Nan::New<String>("outPoint").ToLocalChecked(), NodeRT::Utils::PointToJs(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void TransformBounds(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info.This())) {
        return;
      }

      GeneralTransform *wrapper = GeneralTransform::Unwrap<GeneralTransform>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsRect(info[0]))
      {
        try
        {
          ::Windows::Foundation::Rect arg0 = NodeRT::Utils::RectFromJs(info[0]);
          
          ::Windows::Foundation::Rect result;
          result = wrapper->_instance->TransformBounds(arg0);
          info.GetReturnValue().Set(NodeRT::Utils::RectToJs(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void TryTransformCore(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info.This())) {
        return;
      }

      GeneralTransform *wrapper = GeneralTransform::Unwrap<GeneralTransform>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsPoint(info[0]))
      {
        try
        {
          ::Windows::Foundation::Point arg0 = NodeRT::Utils::PointFromJs(info[0]);
          ::Windows::Foundation::Point arg1;
          
          bool result;
          result = wrapper->_instance->TryTransformCore(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("boolean").ToLocalChecked(), Nan::New<Boolean>(result));
          Nan::Set(resObj, Nan::New<String>("outPoint").ToLocalChecked(), NodeRT::Utils::PointToJs(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void TransformBoundsCore(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info.This())) {
        return;
      }

      GeneralTransform *wrapper = GeneralTransform::Unwrap<GeneralTransform>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsRect(info[0]))
      {
        try
        {
          ::Windows::Foundation::Rect arg0 = NodeRT::Utils::RectFromJs(info[0]);
          
          ::Windows::Foundation::Rect result;
          result = wrapper->_instance->TransformBoundsCore(arg0);
          info.GetReturnValue().Set(NodeRT::Utils::RectToJs(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void InverseGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info.This())) {
        return;
      }

      GeneralTransform *wrapper = GeneralTransform::Unwrap<GeneralTransform>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::GeneralTransform^ result = wrapper->_instance->Inverse;
        info.GetReturnValue().Set(WrapGeneralTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Xaml::Media::GeneralTransform^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapGeneralTransform(::Windows::UI::Xaml::Media::GeneralTransform^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::GeneralTransform^ UnwrapGeneralTransform(Local<Value> value);
  };

  Persistent<FunctionTemplate> GeneralTransform::s_constructorTemplate;

  v8::Local<v8::Value> WrapGeneralTransform(::Windows::UI::Xaml::Media::GeneralTransform^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(GeneralTransform::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::GeneralTransform^ UnwrapGeneralTransform(Local<Value> value) {
     return GeneralTransform::Unwrap<GeneralTransform>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitGeneralTransform(Local<Object> exports) {
    GeneralTransform::Init(exports);
  }

  class Geometry : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("Geometry").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("bounds").ToLocalChecked(), BoundsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("empty").ToLocalChecked(), EmptyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("standardFlatteningTolerance").ToLocalChecked(), StandardFlatteningToleranceGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("Geometry").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      Geometry(::Windows::UI::Xaml::Media::Geometry^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::Geometry^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::Geometry^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      Geometry *wrapperInstance = new Geometry(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::Geometry^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::Geometry^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapGeometry(winRtInstance));
    }





    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BoundsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try  {
        ::Windows::Foundation::Rect result = wrapper->_instance->Bounds;
        info.GetReturnValue().Set(NodeRT::Utils::RectToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void EmptyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::Media::Geometry^ result = ::Windows::UI::Xaml::Media::Geometry::Empty;
        info.GetReturnValue().Set(WrapGeometry(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void StandardFlatteningToleranceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        double result = ::Windows::UI::Xaml::Media::Geometry::StandardFlatteningTolerance;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Geometry::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::Geometry^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapGeometry(::Windows::UI::Xaml::Media::Geometry^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::Geometry^ UnwrapGeometry(Local<Value> value);
  };

  Persistent<FunctionTemplate> Geometry::s_constructorTemplate;

  v8::Local<v8::Value> WrapGeometry(::Windows::UI::Xaml::Media::Geometry^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(Geometry::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::Geometry^ UnwrapGeometry(Local<Value> value) {
     return Geometry::Unwrap<Geometry>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitGeometry(Local<Object> exports) {
    Geometry::Init(exports);
  }

  class ImageSource : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("ImageSource").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("ImageSource").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      ImageSource(::Windows::UI::Xaml::Media::ImageSource^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::ImageSource^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ImageSource^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::ImageSource^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      ImageSource *wrapperInstance = new ImageSource(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ImageSource^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::ImageSource^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::ImageSource^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapImageSource(winRtInstance));
    }





    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Xaml::Media::ImageSource^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapImageSource(::Windows::UI::Xaml::Media::ImageSource^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::ImageSource^ UnwrapImageSource(Local<Value> value);
  };

  Persistent<FunctionTemplate> ImageSource::s_constructorTemplate;

  v8::Local<v8::Value> WrapImageSource(::Windows::UI::Xaml::Media::ImageSource^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(ImageSource::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::ImageSource^ UnwrapImageSource(Local<Value> value) {
     return ImageSource::Unwrap<ImageSource>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitImageSource(Local<Object> exports) {
    ImageSource::Init(exports);
  }

  class PathSegment : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("PathSegment").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("PathSegment").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      PathSegment(::Windows::UI::Xaml::Media::PathSegment^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::PathSegment^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegment^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::PathSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      PathSegment *wrapperInstance = new PathSegment(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegment^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::PathSegment^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::PathSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapPathSegment(winRtInstance));
    }





    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Xaml::Media::PathSegment^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapPathSegment(::Windows::UI::Xaml::Media::PathSegment^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::PathSegment^ UnwrapPathSegment(Local<Value> value);
  };

  Persistent<FunctionTemplate> PathSegment::s_constructorTemplate;

  v8::Local<v8::Value> WrapPathSegment(::Windows::UI::Xaml::Media::PathSegment^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(PathSegment::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::PathSegment^ UnwrapPathSegment(Local<Value> value) {
     return PathSegment::Unwrap<PathSegment>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitPathSegment(Local<Object> exports) {
    PathSegment::Init(exports);
  }

  class Projection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("Projection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("Projection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      Projection(::Windows::UI::Xaml::Media::Projection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::Projection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Projection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::Projection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      Projection *wrapperInstance = new Projection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Projection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::Projection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::Projection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapProjection(winRtInstance));
    }





    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Xaml::Media::Projection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapProjection(::Windows::UI::Xaml::Media::Projection^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::Projection^ UnwrapProjection(Local<Value> value);
  };

  Persistent<FunctionTemplate> Projection::s_constructorTemplate;

  v8::Local<v8::Value> WrapProjection(::Windows::UI::Xaml::Media::Projection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(Projection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::Projection^ UnwrapProjection(Local<Value> value) {
     return Projection::Unwrap<Projection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitProjection(Local<Object> exports) {
    Projection::Init(exports);
  }

  class RateChangedRoutedEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("RateChangedRoutedEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("originalSource").ToLocalChecked(), OriginalSourceGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("RateChangedRoutedEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      RateChangedRoutedEventArgs(::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      RateChangedRoutedEventArgs *wrapperInstance = new RateChangedRoutedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapRateChangedRoutedEventArgs(winRtInstance));
    }





    static void OriginalSourceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::RoutedEventArgs^>(info.This())) {
        return;
      }

      RoutedEventArgs *wrapper = RoutedEventArgs::Unwrap<RoutedEventArgs>(info.This());

      try  {
        ::Platform::Object^ result = wrapper->_instance->OriginalSource;
        info.GetReturnValue().Set(CreateOpaqueWrapper(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapRateChangedRoutedEventArgs(::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs^ UnwrapRateChangedRoutedEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> RateChangedRoutedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapRateChangedRoutedEventArgs(::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(RateChangedRoutedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::RateChangedRoutedEventArgs^ UnwrapRateChangedRoutedEventArgs(Local<Value> value) {
     return RateChangedRoutedEventArgs::Unwrap<RateChangedRoutedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitRateChangedRoutedEventArgs(Local<Object> exports) {
    RateChangedRoutedEventArgs::Init(exports);
  }

  class TimelineMarker : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("TimelineMarker").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("type").ToLocalChecked(), TypeGetter, TypeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("time").ToLocalChecked(), TimeGetter, TimeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("text").ToLocalChecked(), TextGetter, TextSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("textProperty").ToLocalChecked(), TextPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("timeProperty").ToLocalChecked(), TimePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("typeProperty").ToLocalChecked(), TypePropertyGetter);


        Nan::Set(exports, Nan::New<String>("TimelineMarker").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      TimelineMarker(::Windows::UI::Xaml::Media::TimelineMarker^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::TimelineMarker^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::TimelineMarker^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::TimelineMarker();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      TimelineMarker *wrapperInstance = new TimelineMarker(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::TimelineMarker^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::TimelineMarker^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapTimelineMarker(winRtInstance));
    }





    static void TypeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(info.This())) {
        return;
      }

      TimelineMarker *wrapper = TimelineMarker::Unwrap<TimelineMarker>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Type;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TypeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(info.This())) {
        return;
      }

      TimelineMarker *wrapper = TimelineMarker::Unwrap<TimelineMarker>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Type = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TimeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(info.This())) {
        return;
      }

      TimelineMarker *wrapper = TimelineMarker::Unwrap<TimelineMarker>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->Time;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TimeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(info.This())) {
        return;
      }

      TimelineMarker *wrapper = TimelineMarker::Unwrap<TimelineMarker>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->Time = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TextGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(info.This())) {
        return;
      }

      TimelineMarker *wrapper = TimelineMarker::Unwrap<TimelineMarker>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Text;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TextSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(info.This())) {
        return;
      }

      TimelineMarker *wrapper = TimelineMarker::Unwrap<TimelineMarker>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Text = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void TextPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::TimelineMarker::TextProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TimePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::TimelineMarker::TimeProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TypePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::TimelineMarker::TypeProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::TimelineMarker^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapTimelineMarker(::Windows::UI::Xaml::Media::TimelineMarker^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::TimelineMarker^ UnwrapTimelineMarker(Local<Value> value);
  };

  Persistent<FunctionTemplate> TimelineMarker::s_constructorTemplate;

  v8::Local<v8::Value> WrapTimelineMarker(::Windows::UI::Xaml::Media::TimelineMarker^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(TimelineMarker::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::TimelineMarker^ UnwrapTimelineMarker(Local<Value> value) {
     return TimelineMarker::Unwrap<TimelineMarker>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitTimelineMarker(Local<Object> exports) {
    TimelineMarker::Init(exports);
  }

  class TimelineMarkerRoutedEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("TimelineMarkerRoutedEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("marker").ToLocalChecked(), MarkerGetter, MarkerSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("originalSource").ToLocalChecked(), OriginalSourceGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("TimelineMarkerRoutedEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      TimelineMarkerRoutedEventArgs(::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      TimelineMarkerRoutedEventArgs *wrapperInstance = new TimelineMarkerRoutedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapTimelineMarkerRoutedEventArgs(winRtInstance));
    }





    static void MarkerGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^>(info.This())) {
        return;
      }

      TimelineMarkerRoutedEventArgs *wrapper = TimelineMarkerRoutedEventArgs::Unwrap<TimelineMarkerRoutedEventArgs>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::TimelineMarker^ result = wrapper->_instance->Marker;
        info.GetReturnValue().Set(WrapTimelineMarker(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void MarkerSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarker^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^>(info.This())) {
        return;
      }

      TimelineMarkerRoutedEventArgs *wrapper = TimelineMarkerRoutedEventArgs::Unwrap<TimelineMarkerRoutedEventArgs>(info.This());

      try {

        ::Windows::UI::Xaml::Media::TimelineMarker^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::TimelineMarker^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Marker = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OriginalSourceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::RoutedEventArgs^>(info.This())) {
        return;
      }

      RoutedEventArgs *wrapper = RoutedEventArgs::Unwrap<RoutedEventArgs>(info.This());

      try  {
        ::Platform::Object^ result = wrapper->_instance->OriginalSource;
        info.GetReturnValue().Set(CreateOpaqueWrapper(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapTimelineMarkerRoutedEventArgs(::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^ UnwrapTimelineMarkerRoutedEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> TimelineMarkerRoutedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapTimelineMarkerRoutedEventArgs(::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(TimelineMarkerRoutedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::TimelineMarkerRoutedEventArgs^ UnwrapTimelineMarkerRoutedEventArgs(Local<Value> value) {
     return TimelineMarkerRoutedEventArgs::Unwrap<TimelineMarkerRoutedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitTimelineMarkerRoutedEventArgs(Local<Object> exports) {
    TimelineMarkerRoutedEventArgs::Init(exports);
  }

  class XamlLight : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("XamlLight").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getId", GetId);
            Nan::SetPrototypeMethod(localRef, "onConnected", OnConnected);
            Nan::SetPrototypeMethod(localRef, "onDisconnected", OnDisconnected);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetMethod(constructor, "addTargetElement", AddTargetElement);
        Nan::SetMethod(constructor, "removeTargetElement", RemoveTargetElement);
        Nan::SetMethod(constructor, "addTargetBrush", AddTargetBrush);
        Nan::SetMethod(constructor, "removeTargetBrush", RemoveTargetBrush);


        Nan::Set(exports, Nan::New<String>("XamlLight").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      XamlLight(::Windows::UI::Xaml::Media::XamlLight^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::XamlLight^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlLight^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::XamlLight^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::XamlLight();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      XamlLight *wrapperInstance = new XamlLight(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlLight^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::XamlLight^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::XamlLight^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapXamlLight(winRtInstance));
    }


    static void GetId(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlLight^>(info.This())) {
        return;
      }

      XamlLight *wrapper = XamlLight::Unwrap<XamlLight>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          Platform::String^ result;
          result = wrapper->_instance->GetId();
          info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void OnConnected(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlLight^>(info.This())) {
        return;
      }

      XamlLight *wrapper = XamlLight::Unwrap<XamlLight>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::UIElement^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::UIElement^ arg0 = dynamic_cast<::Windows::UI::Xaml::UIElement^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          wrapper->_instance->OnConnected(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void OnDisconnected(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlLight^>(info.This())) {
        return;
      }

      XamlLight *wrapper = XamlLight::Unwrap<XamlLight>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::UIElement^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::UIElement^ arg0 = dynamic_cast<::Windows::UI::Xaml::UIElement^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          wrapper->_instance->OnDisconnected(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void AddTargetElement(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 2
        && info[0]->IsString()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::UIElement^>(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Windows::UI::Xaml::UIElement^ arg1 = dynamic_cast<::Windows::UI::Xaml::UIElement^>(NodeRT::Utils::GetObjectInstance(info[1]));
          
          ::Windows::UI::Xaml::Media::XamlLight::AddTargetElement(arg0, arg1);
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void RemoveTargetElement(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 2
        && info[0]->IsString()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::UIElement^>(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Windows::UI::Xaml::UIElement^ arg1 = dynamic_cast<::Windows::UI::Xaml::UIElement^>(NodeRT::Utils::GetObjectInstance(info[1]));
          
          ::Windows::UI::Xaml::Media::XamlLight::RemoveTargetElement(arg0, arg1);
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void AddTargetBrush(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 2
        && info[0]->IsString()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Windows::UI::Xaml::Media::Brush^ arg1 = UnwrapBrush(info[1]);
          
          ::Windows::UI::Xaml::Media::XamlLight::AddTargetBrush(arg0, arg1);
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void RemoveTargetBrush(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 2
        && info[0]->IsString()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Windows::UI::Xaml::Media::Brush^ arg1 = UnwrapBrush(info[1]);
          
          ::Windows::UI::Xaml::Media::XamlLight::RemoveTargetBrush(arg0, arg1);
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Xaml::Media::XamlLight^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapXamlLight(::Windows::UI::Xaml::Media::XamlLight^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::XamlLight^ UnwrapXamlLight(Local<Value> value);
  };

  Persistent<FunctionTemplate> XamlLight::s_constructorTemplate;

  v8::Local<v8::Value> WrapXamlLight(::Windows::UI::Xaml::Media::XamlLight^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(XamlLight::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::XamlLight^ UnwrapXamlLight(Local<Value> value) {
     return XamlLight::Unwrap<XamlLight>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitXamlLight(Local<Object> exports) {
    XamlLight::Init(exports);
  }

  class BitmapCache : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("BitmapCache").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("BitmapCache").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      BitmapCache(::Windows::UI::Xaml::Media::BitmapCache^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::BitmapCache^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BitmapCache^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::BitmapCache^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::BitmapCache();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      BitmapCache *wrapperInstance = new BitmapCache(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BitmapCache^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::BitmapCache^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::BitmapCache^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapBitmapCache(winRtInstance));
    }





    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Xaml::Media::BitmapCache^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapBitmapCache(::Windows::UI::Xaml::Media::BitmapCache^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::BitmapCache^ UnwrapBitmapCache(Local<Value> value);
  };

  Persistent<FunctionTemplate> BitmapCache::s_constructorTemplate;

  v8::Local<v8::Value> WrapBitmapCache(::Windows::UI::Xaml::Media::BitmapCache^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(BitmapCache::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::BitmapCache^ UnwrapBitmapCache(Local<Value> value) {
     return BitmapCache::Unwrap<BitmapCache>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitBitmapCache(Local<Object> exports) {
    BitmapCache::Init(exports);
  }

  class Matrix3DProjection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("Matrix3DProjection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("projectionMatrix").ToLocalChecked(), ProjectionMatrixGetter, ProjectionMatrixSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("projectionMatrixProperty").ToLocalChecked(), ProjectionMatrixPropertyGetter);


        Nan::Set(exports, Nan::New<String>("Matrix3DProjection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      Matrix3DProjection(::Windows::UI::Xaml::Media::Matrix3DProjection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::Matrix3DProjection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Matrix3DProjection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::Matrix3DProjection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::Matrix3DProjection();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      Matrix3DProjection *wrapperInstance = new Matrix3DProjection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Matrix3DProjection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::Matrix3DProjection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::Matrix3DProjection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapMatrix3DProjection(winRtInstance));
    }





    static void ProjectionMatrixGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Matrix3DProjection^>(info.This())) {
        return;
      }

      Matrix3DProjection *wrapper = Matrix3DProjection::Unwrap<Matrix3DProjection>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Media3D::Matrix3D result = wrapper->_instance->ProjectionMatrix;
        info.GetReturnValue().Set(Matrix3DToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ProjectionMatrixSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsMatrix3DJsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Matrix3DProjection^>(info.This())) {
        return;
      }

      Matrix3DProjection *wrapper = Matrix3DProjection::Unwrap<Matrix3DProjection>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Media3D::Matrix3D winRtValue = Matrix3DFromJsObject(value);

        wrapper->_instance->ProjectionMatrix = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void ProjectionMatrixPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Matrix3DProjection::ProjectionMatrixProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::Matrix3DProjection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapMatrix3DProjection(::Windows::UI::Xaml::Media::Matrix3DProjection^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::Matrix3DProjection^ UnwrapMatrix3DProjection(Local<Value> value);
  };

  Persistent<FunctionTemplate> Matrix3DProjection::s_constructorTemplate;

  v8::Local<v8::Value> WrapMatrix3DProjection(::Windows::UI::Xaml::Media::Matrix3DProjection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(Matrix3DProjection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::Matrix3DProjection^ UnwrapMatrix3DProjection(Local<Value> value) {
     return Matrix3DProjection::Unwrap<Matrix3DProjection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitMatrix3DProjection(Local<Object> exports) {
    Matrix3DProjection::Init(exports);
  }

  class PlaneProjection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("PlaneProjection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("globalOffsetZ").ToLocalChecked(), GlobalOffsetZGetter, GlobalOffsetZSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("globalOffsetY").ToLocalChecked(), GlobalOffsetYGetter, GlobalOffsetYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("globalOffsetX").ToLocalChecked(), GlobalOffsetXGetter, GlobalOffsetXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerOfRotationZ").ToLocalChecked(), CenterOfRotationZGetter, CenterOfRotationZSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerOfRotationY").ToLocalChecked(), CenterOfRotationYGetter, CenterOfRotationYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerOfRotationX").ToLocalChecked(), CenterOfRotationXGetter, CenterOfRotationXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationZ").ToLocalChecked(), RotationZGetter, RotationZSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationY").ToLocalChecked(), RotationYGetter, RotationYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationX").ToLocalChecked(), RotationXGetter, RotationXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("localOffsetZ").ToLocalChecked(), LocalOffsetZGetter, LocalOffsetZSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("localOffsetY").ToLocalChecked(), LocalOffsetYGetter, LocalOffsetYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("localOffsetX").ToLocalChecked(), LocalOffsetXGetter, LocalOffsetXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("projectionMatrix").ToLocalChecked(), ProjectionMatrixGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("centerOfRotationXProperty").ToLocalChecked(), CenterOfRotationXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("centerOfRotationYProperty").ToLocalChecked(), CenterOfRotationYPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("centerOfRotationZProperty").ToLocalChecked(), CenterOfRotationZPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("globalOffsetXProperty").ToLocalChecked(), GlobalOffsetXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("globalOffsetYProperty").ToLocalChecked(), GlobalOffsetYPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("globalOffsetZProperty").ToLocalChecked(), GlobalOffsetZPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("localOffsetXProperty").ToLocalChecked(), LocalOffsetXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("localOffsetYProperty").ToLocalChecked(), LocalOffsetYPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("localOffsetZProperty").ToLocalChecked(), LocalOffsetZPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("projectionMatrixProperty").ToLocalChecked(), ProjectionMatrixPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("rotationXProperty").ToLocalChecked(), RotationXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("rotationYProperty").ToLocalChecked(), RotationYPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("rotationZProperty").ToLocalChecked(), RotationZPropertyGetter);


        Nan::Set(exports, Nan::New<String>("PlaneProjection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      PlaneProjection(::Windows::UI::Xaml::Media::PlaneProjection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::PlaneProjection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::PlaneProjection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::PlaneProjection();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      PlaneProjection *wrapperInstance = new PlaneProjection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::PlaneProjection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::PlaneProjection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapPlaneProjection(winRtInstance));
    }





    static void GlobalOffsetZGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try  {
        double result = wrapper->_instance->GlobalOffsetZ;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void GlobalOffsetZSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->GlobalOffsetZ = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void GlobalOffsetYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try  {
        double result = wrapper->_instance->GlobalOffsetY;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void GlobalOffsetYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->GlobalOffsetY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void GlobalOffsetXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try  {
        double result = wrapper->_instance->GlobalOffsetX;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void GlobalOffsetXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->GlobalOffsetX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterOfRotationZGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try  {
        double result = wrapper->_instance->CenterOfRotationZ;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterOfRotationZSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->CenterOfRotationZ = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterOfRotationYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try  {
        double result = wrapper->_instance->CenterOfRotationY;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterOfRotationYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->CenterOfRotationY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterOfRotationXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try  {
        double result = wrapper->_instance->CenterOfRotationX;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterOfRotationXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->CenterOfRotationX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationZGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try  {
        double result = wrapper->_instance->RotationZ;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationZSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->RotationZ = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try  {
        double result = wrapper->_instance->RotationY;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->RotationY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try  {
        double result = wrapper->_instance->RotationX;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->RotationX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void LocalOffsetZGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try  {
        double result = wrapper->_instance->LocalOffsetZ;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void LocalOffsetZSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->LocalOffsetZ = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void LocalOffsetYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try  {
        double result = wrapper->_instance->LocalOffsetY;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void LocalOffsetYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->LocalOffsetY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void LocalOffsetXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try  {
        double result = wrapper->_instance->LocalOffsetX;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void LocalOffsetXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->LocalOffsetX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ProjectionMatrixGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PlaneProjection^>(info.This())) {
        return;
      }

      PlaneProjection *wrapper = PlaneProjection::Unwrap<PlaneProjection>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Media3D::Matrix3D result = wrapper->_instance->ProjectionMatrix;
        info.GetReturnValue().Set(Matrix3DToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void CenterOfRotationXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PlaneProjection::CenterOfRotationXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void CenterOfRotationYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PlaneProjection::CenterOfRotationYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void CenterOfRotationZPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PlaneProjection::CenterOfRotationZProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void GlobalOffsetXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PlaneProjection::GlobalOffsetXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void GlobalOffsetYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PlaneProjection::GlobalOffsetYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void GlobalOffsetZPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PlaneProjection::GlobalOffsetZProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void LocalOffsetXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PlaneProjection::LocalOffsetXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void LocalOffsetYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PlaneProjection::LocalOffsetYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void LocalOffsetZPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PlaneProjection::LocalOffsetZProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void ProjectionMatrixPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PlaneProjection::ProjectionMatrixProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RotationXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PlaneProjection::RotationXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RotationYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PlaneProjection::RotationYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RotationZPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PlaneProjection::RotationZProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::PlaneProjection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapPlaneProjection(::Windows::UI::Xaml::Media::PlaneProjection^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::PlaneProjection^ UnwrapPlaneProjection(Local<Value> value);
  };

  Persistent<FunctionTemplate> PlaneProjection::s_constructorTemplate;

  v8::Local<v8::Value> WrapPlaneProjection(::Windows::UI::Xaml::Media::PlaneProjection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(PlaneProjection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::PlaneProjection^ UnwrapPlaneProjection(Local<Value> value) {
     return PlaneProjection::Unwrap<PlaneProjection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitPlaneProjection(Local<Object> exports) {
    PlaneProjection::Init(exports);
  }

  class RectangleGeometry : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("RectangleGeometry").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rect").ToLocalChecked(), RectGetter, RectSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("bounds").ToLocalChecked(), BoundsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("rectProperty").ToLocalChecked(), RectPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("empty").ToLocalChecked(), EmptyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("standardFlatteningTolerance").ToLocalChecked(), StandardFlatteningToleranceGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("RectangleGeometry").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      RectangleGeometry(::Windows::UI::Xaml::Media::RectangleGeometry^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::RectangleGeometry^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RectangleGeometry^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::RectangleGeometry^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::RectangleGeometry();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      RectangleGeometry *wrapperInstance = new RectangleGeometry(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RectangleGeometry^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::RectangleGeometry^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::RectangleGeometry^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapRectangleGeometry(winRtInstance));
    }





    static void RectGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RectangleGeometry^>(info.This())) {
        return;
      }

      RectangleGeometry *wrapper = RectangleGeometry::Unwrap<RectangleGeometry>(info.This());

      try  {
        ::Windows::Foundation::Rect result = wrapper->_instance->Rect;
        info.GetReturnValue().Set(NodeRT::Utils::RectToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RectSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsRect(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RectangleGeometry^>(info.This())) {
        return;
      }

      RectangleGeometry *wrapper = RectangleGeometry::Unwrap<RectangleGeometry>(info.This());

      try {

        ::Windows::Foundation::Rect winRtValue = NodeRT::Utils::RectFromJs(value);

        wrapper->_instance->Rect = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BoundsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try  {
        ::Windows::Foundation::Rect result = wrapper->_instance->Bounds;
        info.GetReturnValue().Set(NodeRT::Utils::RectToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void RectPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RectangleGeometry::RectProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void EmptyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::Media::Geometry^ result = ::Windows::UI::Xaml::Media::Geometry::Empty;
        info.GetReturnValue().Set(WrapGeometry(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void StandardFlatteningToleranceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        double result = ::Windows::UI::Xaml::Media::Geometry::StandardFlatteningTolerance;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Geometry::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::RectangleGeometry^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapRectangleGeometry(::Windows::UI::Xaml::Media::RectangleGeometry^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::RectangleGeometry^ UnwrapRectangleGeometry(Local<Value> value);
  };

  Persistent<FunctionTemplate> RectangleGeometry::s_constructorTemplate;

  v8::Local<v8::Value> WrapRectangleGeometry(::Windows::UI::Xaml::Media::RectangleGeometry^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(RectangleGeometry::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::RectangleGeometry^ UnwrapRectangleGeometry(Local<Value> value) {
     return RectangleGeometry::Unwrap<RectangleGeometry>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitRectangleGeometry(Local<Object> exports) {
    RectangleGeometry::Init(exports);
  }

  class SolidColorBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SolidColorBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("color").ToLocalChecked(), ColorGetter, ColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("relativeTransform").ToLocalChecked(), RelativeTransformGetter, RelativeTransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("colorProperty").ToLocalChecked(), ColorPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("opacityProperty").ToLocalChecked(), OpacityPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("relativeTransformProperty").ToLocalChecked(), RelativeTransformPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("SolidColorBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SolidColorBrush(::Windows::UI::Xaml::Media::SolidColorBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::SolidColorBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::SolidColorBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::SolidColorBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 1
        && NodeRT::Utils::IsColor(info[0]))
      {
        try {
          ::Windows::UI::Color arg0 = NodeRT::Utils::ColorFromJs(info[0]);
          
          winRtInstance = ref new ::Windows::UI::Xaml::Media::SolidColorBrush(arg0);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::SolidColorBrush();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SolidColorBrush *wrapperInstance = new SolidColorBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::SolidColorBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::SolidColorBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::SolidColorBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSolidColorBrush(winRtInstance));
    }





    static void ColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::SolidColorBrush^>(info.This())) {
        return;
      }

      SolidColorBrush *wrapper = SolidColorBrush::Unwrap<SolidColorBrush>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->Color;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::SolidColorBrush^>(info.This())) {
        return;
      }

      SolidColorBrush *wrapper = SolidColorBrush::Unwrap<SolidColorBrush>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->Color = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RelativeTransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->RelativeTransform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RelativeTransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->RelativeTransform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        double result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void ColorPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::SolidColorBrush::ColorProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void OpacityPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::OpacityProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RelativeTransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::RelativeTransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::SolidColorBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSolidColorBrush(::Windows::UI::Xaml::Media::SolidColorBrush^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::SolidColorBrush^ UnwrapSolidColorBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> SolidColorBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapSolidColorBrush(::Windows::UI::Xaml::Media::SolidColorBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SolidColorBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::SolidColorBrush^ UnwrapSolidColorBrush(Local<Value> value) {
     return SolidColorBrush::Unwrap<SolidColorBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSolidColorBrush(Local<Object> exports) {
    SolidColorBrush::Init(exports);
  }

  class Transform : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("Transform").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("inverse").ToLocalChecked(), InverseGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("Transform").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      Transform(::Windows::UI::Xaml::Media::Transform^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::Transform^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::Transform^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      Transform *wrapperInstance = new Transform(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::Transform^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::Transform^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapTransform(winRtInstance));
    }





    static void InverseGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info.This())) {
        return;
      }

      GeneralTransform *wrapper = GeneralTransform::Unwrap<GeneralTransform>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::GeneralTransform^ result = wrapper->_instance->Inverse;
        info.GetReturnValue().Set(WrapGeneralTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Xaml::Media::Transform^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapTransform(::Windows::UI::Xaml::Media::Transform^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::Transform^ UnwrapTransform(Local<Value> value);
  };

  Persistent<FunctionTemplate> Transform::s_constructorTemplate;

  v8::Local<v8::Value> WrapTransform(::Windows::UI::Xaml::Media::Transform^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(Transform::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::Transform^ UnwrapTransform(Local<Value> value) {
     return Transform::Unwrap<Transform>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitTransform(Local<Object> exports) {
    Transform::Init(exports);
  }

  class CompositeTransform : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositeTransform").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("translateY").ToLocalChecked(), TranslateYGetter, TranslateYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("translateX").ToLocalChecked(), TranslateXGetter, TranslateXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("skewY").ToLocalChecked(), SkewYGetter, SkewYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("skewX").ToLocalChecked(), SkewXGetter, SkewXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("scaleY").ToLocalChecked(), ScaleYGetter, ScaleYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("scaleX").ToLocalChecked(), ScaleXGetter, ScaleXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotation").ToLocalChecked(), RotationGetter, RotationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerY").ToLocalChecked(), CenterYGetter, CenterYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerX").ToLocalChecked(), CenterXGetter, CenterXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("inverse").ToLocalChecked(), InverseGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("centerXProperty").ToLocalChecked(), CenterXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("centerYProperty").ToLocalChecked(), CenterYPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("rotationProperty").ToLocalChecked(), RotationPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("scaleXProperty").ToLocalChecked(), ScaleXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("scaleYProperty").ToLocalChecked(), ScaleYPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("skewXProperty").ToLocalChecked(), SkewXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("skewYProperty").ToLocalChecked(), SkewYPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("translateXProperty").ToLocalChecked(), TranslateXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("translateYProperty").ToLocalChecked(), TranslateYPropertyGetter);


        Nan::Set(exports, Nan::New<String>("CompositeTransform").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositeTransform(::Windows::UI::Xaml::Media::CompositeTransform^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::CompositeTransform^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::CompositeTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::CompositeTransform();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositeTransform *wrapperInstance = new CompositeTransform(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::CompositeTransform^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::CompositeTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositeTransform(winRtInstance));
    }





    static void TranslateYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try  {
        double result = wrapper->_instance->TranslateY;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TranslateYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->TranslateY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TranslateXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try  {
        double result = wrapper->_instance->TranslateX;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TranslateXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->TranslateX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void SkewYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try  {
        double result = wrapper->_instance->SkewY;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SkewYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->SkewY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void SkewXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try  {
        double result = wrapper->_instance->SkewX;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SkewXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->SkewX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ScaleYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try  {
        double result = wrapper->_instance->ScaleY;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ScaleYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->ScaleY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ScaleXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try  {
        double result = wrapper->_instance->ScaleX;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ScaleXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->ScaleX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try  {
        double result = wrapper->_instance->Rotation;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Rotation = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try  {
        double result = wrapper->_instance->CenterY;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->CenterY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try  {
        double result = wrapper->_instance->CenterX;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::CompositeTransform^>(info.This())) {
        return;
      }

      CompositeTransform *wrapper = CompositeTransform::Unwrap<CompositeTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->CenterX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void InverseGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info.This())) {
        return;
      }

      GeneralTransform *wrapper = GeneralTransform::Unwrap<GeneralTransform>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::GeneralTransform^ result = wrapper->_instance->Inverse;
        info.GetReturnValue().Set(WrapGeneralTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void CenterXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::CompositeTransform::CenterXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void CenterYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::CompositeTransform::CenterYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RotationPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::CompositeTransform::RotationProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void ScaleXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::CompositeTransform::ScaleXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void ScaleYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::CompositeTransform::ScaleYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void SkewXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::CompositeTransform::SkewXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void SkewYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::CompositeTransform::SkewYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TranslateXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::CompositeTransform::TranslateXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TranslateYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::CompositeTransform::TranslateYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::CompositeTransform^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositeTransform(::Windows::UI::Xaml::Media::CompositeTransform^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::CompositeTransform^ UnwrapCompositeTransform(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositeTransform::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositeTransform(::Windows::UI::Xaml::Media::CompositeTransform^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositeTransform::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::CompositeTransform^ UnwrapCompositeTransform(Local<Value> value) {
     return CompositeTransform::Unwrap<CompositeTransform>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositeTransform(Local<Object> exports) {
    CompositeTransform::Init(exports);
  }

  class MatrixTransform : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("MatrixTransform").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("matrix").ToLocalChecked(), MatrixGetter, MatrixSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("inverse").ToLocalChecked(), InverseGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("matrixProperty").ToLocalChecked(), MatrixPropertyGetter);


        Nan::Set(exports, Nan::New<String>("MatrixTransform").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      MatrixTransform(::Windows::UI::Xaml::Media::MatrixTransform^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::MatrixTransform^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::MatrixTransform^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::MatrixTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::MatrixTransform();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      MatrixTransform *wrapperInstance = new MatrixTransform(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::MatrixTransform^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::MatrixTransform^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::MatrixTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapMatrixTransform(winRtInstance));
    }





    static void MatrixGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::MatrixTransform^>(info.This())) {
        return;
      }

      MatrixTransform *wrapper = MatrixTransform::Unwrap<MatrixTransform>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Matrix result = wrapper->_instance->Matrix;
        info.GetReturnValue().Set(MatrixToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void MatrixSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsMatrixJsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::MatrixTransform^>(info.This())) {
        return;
      }

      MatrixTransform *wrapper = MatrixTransform::Unwrap<MatrixTransform>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Matrix winRtValue = MatrixFromJsObject(value);

        wrapper->_instance->Matrix = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void InverseGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info.This())) {
        return;
      }

      GeneralTransform *wrapper = GeneralTransform::Unwrap<GeneralTransform>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::GeneralTransform^ result = wrapper->_instance->Inverse;
        info.GetReturnValue().Set(WrapGeneralTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void MatrixPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::MatrixTransform::MatrixProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::MatrixTransform^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapMatrixTransform(::Windows::UI::Xaml::Media::MatrixTransform^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::MatrixTransform^ UnwrapMatrixTransform(Local<Value> value);
  };

  Persistent<FunctionTemplate> MatrixTransform::s_constructorTemplate;

  v8::Local<v8::Value> WrapMatrixTransform(::Windows::UI::Xaml::Media::MatrixTransform^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(MatrixTransform::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::MatrixTransform^ UnwrapMatrixTransform(Local<Value> value) {
     return MatrixTransform::Unwrap<MatrixTransform>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitMatrixTransform(Local<Object> exports) {
    MatrixTransform::Init(exports);
  }

  class RotateTransform : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("RotateTransform").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerY").ToLocalChecked(), CenterYGetter, CenterYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerX").ToLocalChecked(), CenterXGetter, CenterXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("angle").ToLocalChecked(), AngleGetter, AngleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("inverse").ToLocalChecked(), InverseGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("angleProperty").ToLocalChecked(), AnglePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("centerXProperty").ToLocalChecked(), CenterXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("centerYProperty").ToLocalChecked(), CenterYPropertyGetter);


        Nan::Set(exports, Nan::New<String>("RotateTransform").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      RotateTransform(::Windows::UI::Xaml::Media::RotateTransform^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::RotateTransform^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RotateTransform^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::RotateTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::RotateTransform();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      RotateTransform *wrapperInstance = new RotateTransform(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RotateTransform^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::RotateTransform^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::RotateTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapRotateTransform(winRtInstance));
    }





    static void CenterYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RotateTransform^>(info.This())) {
        return;
      }

      RotateTransform *wrapper = RotateTransform::Unwrap<RotateTransform>(info.This());

      try  {
        double result = wrapper->_instance->CenterY;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RotateTransform^>(info.This())) {
        return;
      }

      RotateTransform *wrapper = RotateTransform::Unwrap<RotateTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->CenterY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RotateTransform^>(info.This())) {
        return;
      }

      RotateTransform *wrapper = RotateTransform::Unwrap<RotateTransform>(info.This());

      try  {
        double result = wrapper->_instance->CenterX;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RotateTransform^>(info.This())) {
        return;
      }

      RotateTransform *wrapper = RotateTransform::Unwrap<RotateTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->CenterX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AngleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RotateTransform^>(info.This())) {
        return;
      }

      RotateTransform *wrapper = RotateTransform::Unwrap<RotateTransform>(info.This());

      try  {
        double result = wrapper->_instance->Angle;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AngleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RotateTransform^>(info.This())) {
        return;
      }

      RotateTransform *wrapper = RotateTransform::Unwrap<RotateTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Angle = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void InverseGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info.This())) {
        return;
      }

      GeneralTransform *wrapper = GeneralTransform::Unwrap<GeneralTransform>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::GeneralTransform^ result = wrapper->_instance->Inverse;
        info.GetReturnValue().Set(WrapGeneralTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void AnglePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RotateTransform::AngleProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void CenterXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RotateTransform::CenterXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void CenterYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RotateTransform::CenterYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::RotateTransform^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapRotateTransform(::Windows::UI::Xaml::Media::RotateTransform^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::RotateTransform^ UnwrapRotateTransform(Local<Value> value);
  };

  Persistent<FunctionTemplate> RotateTransform::s_constructorTemplate;

  v8::Local<v8::Value> WrapRotateTransform(::Windows::UI::Xaml::Media::RotateTransform^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(RotateTransform::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::RotateTransform^ UnwrapRotateTransform(Local<Value> value) {
     return RotateTransform::Unwrap<RotateTransform>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitRotateTransform(Local<Object> exports) {
    RotateTransform::Init(exports);
  }

  class ScaleTransform : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("ScaleTransform").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("scaleY").ToLocalChecked(), ScaleYGetter, ScaleYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("scaleX").ToLocalChecked(), ScaleXGetter, ScaleXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerY").ToLocalChecked(), CenterYGetter, CenterYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerX").ToLocalChecked(), CenterXGetter, CenterXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("inverse").ToLocalChecked(), InverseGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("centerXProperty").ToLocalChecked(), CenterXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("centerYProperty").ToLocalChecked(), CenterYPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("scaleXProperty").ToLocalChecked(), ScaleXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("scaleYProperty").ToLocalChecked(), ScaleYPropertyGetter);


        Nan::Set(exports, Nan::New<String>("ScaleTransform").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      ScaleTransform(::Windows::UI::Xaml::Media::ScaleTransform^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::ScaleTransform^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ScaleTransform^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::ScaleTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::ScaleTransform();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      ScaleTransform *wrapperInstance = new ScaleTransform(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ScaleTransform^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::ScaleTransform^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::ScaleTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapScaleTransform(winRtInstance));
    }





    static void ScaleYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ScaleTransform^>(info.This())) {
        return;
      }

      ScaleTransform *wrapper = ScaleTransform::Unwrap<ScaleTransform>(info.This());

      try  {
        double result = wrapper->_instance->ScaleY;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ScaleYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ScaleTransform^>(info.This())) {
        return;
      }

      ScaleTransform *wrapper = ScaleTransform::Unwrap<ScaleTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->ScaleY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ScaleXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ScaleTransform^>(info.This())) {
        return;
      }

      ScaleTransform *wrapper = ScaleTransform::Unwrap<ScaleTransform>(info.This());

      try  {
        double result = wrapper->_instance->ScaleX;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ScaleXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ScaleTransform^>(info.This())) {
        return;
      }

      ScaleTransform *wrapper = ScaleTransform::Unwrap<ScaleTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->ScaleX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ScaleTransform^>(info.This())) {
        return;
      }

      ScaleTransform *wrapper = ScaleTransform::Unwrap<ScaleTransform>(info.This());

      try  {
        double result = wrapper->_instance->CenterY;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ScaleTransform^>(info.This())) {
        return;
      }

      ScaleTransform *wrapper = ScaleTransform::Unwrap<ScaleTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->CenterY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ScaleTransform^>(info.This())) {
        return;
      }

      ScaleTransform *wrapper = ScaleTransform::Unwrap<ScaleTransform>(info.This());

      try  {
        double result = wrapper->_instance->CenterX;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ScaleTransform^>(info.This())) {
        return;
      }

      ScaleTransform *wrapper = ScaleTransform::Unwrap<ScaleTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->CenterX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void InverseGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info.This())) {
        return;
      }

      GeneralTransform *wrapper = GeneralTransform::Unwrap<GeneralTransform>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::GeneralTransform^ result = wrapper->_instance->Inverse;
        info.GetReturnValue().Set(WrapGeneralTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void CenterXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::ScaleTransform::CenterXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void CenterYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::ScaleTransform::CenterYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void ScaleXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::ScaleTransform::ScaleXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void ScaleYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::ScaleTransform::ScaleYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::ScaleTransform^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapScaleTransform(::Windows::UI::Xaml::Media::ScaleTransform^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::ScaleTransform^ UnwrapScaleTransform(Local<Value> value);
  };

  Persistent<FunctionTemplate> ScaleTransform::s_constructorTemplate;

  v8::Local<v8::Value> WrapScaleTransform(::Windows::UI::Xaml::Media::ScaleTransform^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(ScaleTransform::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::ScaleTransform^ UnwrapScaleTransform(Local<Value> value) {
     return ScaleTransform::Unwrap<ScaleTransform>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitScaleTransform(Local<Object> exports) {
    ScaleTransform::Init(exports);
  }

  class SkewTransform : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SkewTransform").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerY").ToLocalChecked(), CenterYGetter, CenterYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerX").ToLocalChecked(), CenterXGetter, CenterXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("angleY").ToLocalChecked(), AngleYGetter, AngleYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("angleX").ToLocalChecked(), AngleXGetter, AngleXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("inverse").ToLocalChecked(), InverseGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("angleXProperty").ToLocalChecked(), AngleXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("angleYProperty").ToLocalChecked(), AngleYPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("centerXProperty").ToLocalChecked(), CenterXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("centerYProperty").ToLocalChecked(), CenterYPropertyGetter);


        Nan::Set(exports, Nan::New<String>("SkewTransform").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SkewTransform(::Windows::UI::Xaml::Media::SkewTransform^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::SkewTransform^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::SkewTransform^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::SkewTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::SkewTransform();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SkewTransform *wrapperInstance = new SkewTransform(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::SkewTransform^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::SkewTransform^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::SkewTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSkewTransform(winRtInstance));
    }





    static void CenterYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::SkewTransform^>(info.This())) {
        return;
      }

      SkewTransform *wrapper = SkewTransform::Unwrap<SkewTransform>(info.This());

      try  {
        double result = wrapper->_instance->CenterY;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::SkewTransform^>(info.This())) {
        return;
      }

      SkewTransform *wrapper = SkewTransform::Unwrap<SkewTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->CenterY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::SkewTransform^>(info.This())) {
        return;
      }

      SkewTransform *wrapper = SkewTransform::Unwrap<SkewTransform>(info.This());

      try  {
        double result = wrapper->_instance->CenterX;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::SkewTransform^>(info.This())) {
        return;
      }

      SkewTransform *wrapper = SkewTransform::Unwrap<SkewTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->CenterX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AngleYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::SkewTransform^>(info.This())) {
        return;
      }

      SkewTransform *wrapper = SkewTransform::Unwrap<SkewTransform>(info.This());

      try  {
        double result = wrapper->_instance->AngleY;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AngleYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::SkewTransform^>(info.This())) {
        return;
      }

      SkewTransform *wrapper = SkewTransform::Unwrap<SkewTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->AngleY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AngleXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::SkewTransform^>(info.This())) {
        return;
      }

      SkewTransform *wrapper = SkewTransform::Unwrap<SkewTransform>(info.This());

      try  {
        double result = wrapper->_instance->AngleX;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AngleXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::SkewTransform^>(info.This())) {
        return;
      }

      SkewTransform *wrapper = SkewTransform::Unwrap<SkewTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->AngleX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void InverseGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info.This())) {
        return;
      }

      GeneralTransform *wrapper = GeneralTransform::Unwrap<GeneralTransform>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::GeneralTransform^ result = wrapper->_instance->Inverse;
        info.GetReturnValue().Set(WrapGeneralTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void AngleXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::SkewTransform::AngleXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void AngleYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::SkewTransform::AngleYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void CenterXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::SkewTransform::CenterXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void CenterYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::SkewTransform::CenterYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::SkewTransform^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSkewTransform(::Windows::UI::Xaml::Media::SkewTransform^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::SkewTransform^ UnwrapSkewTransform(Local<Value> value);
  };

  Persistent<FunctionTemplate> SkewTransform::s_constructorTemplate;

  v8::Local<v8::Value> WrapSkewTransform(::Windows::UI::Xaml::Media::SkewTransform^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SkewTransform::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::SkewTransform^ UnwrapSkewTransform(Local<Value> value) {
     return SkewTransform::Unwrap<SkewTransform>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSkewTransform(Local<Object> exports) {
    SkewTransform::Init(exports);
  }

  class TransformGroup : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("TransformGroup").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("children").ToLocalChecked(), ChildrenGetter, ChildrenSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("value").ToLocalChecked(), ValueGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("inverse").ToLocalChecked(), InverseGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("childrenProperty").ToLocalChecked(), ChildrenPropertyGetter);


        Nan::Set(exports, Nan::New<String>("TransformGroup").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      TransformGroup(::Windows::UI::Xaml::Media::TransformGroup^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::TransformGroup^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformGroup^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::TransformGroup^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::TransformGroup();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      TransformGroup *wrapperInstance = new TransformGroup(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformGroup^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::TransformGroup^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::TransformGroup^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapTransformGroup(winRtInstance));
    }





    static void ChildrenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformGroup^>(info.This())) {
        return;
      }

      TransformGroup *wrapper = TransformGroup::Unwrap<TransformGroup>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::TransformCollection^ result = wrapper->_instance->Children;
        info.GetReturnValue().Set(WrapTransformCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ChildrenSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformGroup^>(info.This())) {
        return;
      }

      TransformGroup *wrapper = TransformGroup::Unwrap<TransformGroup>(info.This());

      try {

        ::Windows::UI::Xaml::Media::TransformCollection^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::TransformCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Children = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ValueGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TransformGroup^>(info.This())) {
        return;
      }

      TransformGroup *wrapper = TransformGroup::Unwrap<TransformGroup>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Matrix result = wrapper->_instance->Value;
        info.GetReturnValue().Set(MatrixToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void InverseGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info.This())) {
        return;
      }

      GeneralTransform *wrapper = GeneralTransform::Unwrap<GeneralTransform>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::GeneralTransform^ result = wrapper->_instance->Inverse;
        info.GetReturnValue().Set(WrapGeneralTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void ChildrenPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::TransformGroup::ChildrenProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::TransformGroup^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapTransformGroup(::Windows::UI::Xaml::Media::TransformGroup^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::TransformGroup^ UnwrapTransformGroup(Local<Value> value);
  };

  Persistent<FunctionTemplate> TransformGroup::s_constructorTemplate;

  v8::Local<v8::Value> WrapTransformGroup(::Windows::UI::Xaml::Media::TransformGroup^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(TransformGroup::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::TransformGroup^ UnwrapTransformGroup(Local<Value> value) {
     return TransformGroup::Unwrap<TransformGroup>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitTransformGroup(Local<Object> exports) {
    TransformGroup::Init(exports);
  }

  class TranslateTransform : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("TranslateTransform").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("y").ToLocalChecked(), YGetter, YSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("x").ToLocalChecked(), XGetter, XSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("inverse").ToLocalChecked(), InverseGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("xProperty").ToLocalChecked(), XPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("yProperty").ToLocalChecked(), YPropertyGetter);


        Nan::Set(exports, Nan::New<String>("TranslateTransform").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      TranslateTransform(::Windows::UI::Xaml::Media::TranslateTransform^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::TranslateTransform^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TranslateTransform^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::TranslateTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::TranslateTransform();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      TranslateTransform *wrapperInstance = new TranslateTransform(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TranslateTransform^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::TranslateTransform^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::TranslateTransform^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapTranslateTransform(winRtInstance));
    }





    static void YGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TranslateTransform^>(info.This())) {
        return;
      }

      TranslateTransform *wrapper = TranslateTransform::Unwrap<TranslateTransform>(info.This());

      try  {
        double result = wrapper->_instance->Y;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void YSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TranslateTransform^>(info.This())) {
        return;
      }

      TranslateTransform *wrapper = TranslateTransform::Unwrap<TranslateTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Y = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void XGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TranslateTransform^>(info.This())) {
        return;
      }

      TranslateTransform *wrapper = TranslateTransform::Unwrap<TranslateTransform>(info.This());

      try  {
        double result = wrapper->_instance->X;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void XSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TranslateTransform^>(info.This())) {
        return;
      }

      TranslateTransform *wrapper = TranslateTransform::Unwrap<TranslateTransform>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->X = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void InverseGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeneralTransform^>(info.This())) {
        return;
      }

      GeneralTransform *wrapper = GeneralTransform::Unwrap<GeneralTransform>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::GeneralTransform^ result = wrapper->_instance->Inverse;
        info.GetReturnValue().Set(WrapGeneralTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void XPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::TranslateTransform::XProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void YPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::TranslateTransform::YProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::TranslateTransform^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapTranslateTransform(::Windows::UI::Xaml::Media::TranslateTransform^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::TranslateTransform^ UnwrapTranslateTransform(Local<Value> value);
  };

  Persistent<FunctionTemplate> TranslateTransform::s_constructorTemplate;

  v8::Local<v8::Value> WrapTranslateTransform(::Windows::UI::Xaml::Media::TranslateTransform^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(TranslateTransform::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::TranslateTransform^ UnwrapTranslateTransform(Local<Value> value) {
     return TranslateTransform::Unwrap<TranslateTransform>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitTranslateTransform(Local<Object> exports) {
    TranslateTransform::Init(exports);
  }

  class GeometryCollection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("GeometryCollection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getAt", GetAt);
            Nan::SetPrototypeMethod(localRef, "getView", GetView);
            Nan::SetPrototypeMethod(localRef, "indexOf", IndexOf);
            Nan::SetPrototypeMethod(localRef, "setAt", SetAt);
            Nan::SetPrototypeMethod(localRef, "insertAt", InsertAt);
            Nan::SetPrototypeMethod(localRef, "removeAt", RemoveAt);
            Nan::SetPrototypeMethod(localRef, "append", Append);
            Nan::SetPrototypeMethod(localRef, "removeAtEnd", RemoveAtEnd);
            Nan::SetPrototypeMethod(localRef, "clear", Clear);
            Nan::SetPrototypeMethod(localRef, "getMany", GetMany);
            Nan::SetPrototypeMethod(localRef, "replaceAll", ReplaceAll);
            Nan::SetPrototypeMethod(localRef, "first", First);
          




        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("GeometryCollection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      GeometryCollection(::Windows::UI::Xaml::Media::GeometryCollection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::GeometryCollection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryCollection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::GeometryCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::GeometryCollection();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      GeometryCollection *wrapperInstance = new GeometryCollection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryCollection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::GeometryCollection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::GeometryCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapGeometryCollection(winRtInstance));
    }


    static void GetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryCollection^>(info.This())) {
        return;
      }

      GeometryCollection *wrapper = GeometryCollection::Unwrap<GeometryCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          ::Windows::UI::Xaml::Media::Geometry^ result;
          result = wrapper->_instance->GetAt(arg0);
          info.GetReturnValue().Set(WrapGeometry(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryCollection^>(info.This())) {
        return;
      }

      GeometryCollection *wrapper = GeometryCollection::Unwrap<GeometryCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IVectorView<::Windows::UI::Xaml::Media::Geometry^>^ result;
          result = wrapper->_instance->GetView();
          info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Windows::UI::Xaml::Media::Geometry^>::CreateVectorViewWrapper(result, 
            [](::Windows::UI::Xaml::Media::Geometry^ val) -> Local<Value> {
              return WrapGeometry(val);
            },
            [](Local<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(value);
            },
            [](Local<Value> value) -> ::Windows::UI::Xaml::Media::Geometry^ {
              return UnwrapGeometry(value);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void IndexOf(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryCollection^>(info.This())) {
        return;
      }

      GeometryCollection *wrapper = GeometryCollection::Unwrap<GeometryCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Media::Geometry^ arg0 = UnwrapGeometry(info[0]);
          unsigned int arg1;
          
          bool result;
          result = wrapper->_instance->IndexOf(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("boolean").ToLocalChecked(), Nan::New<Boolean>(result));
          Nan::Set(resObj, Nan::New<String>("index").ToLocalChecked(), Nan::New<Integer>(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryCollection^>(info.This())) {
        return;
      }

      GeometryCollection *wrapper = GeometryCollection::Unwrap<GeometryCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Xaml::Media::Geometry^ arg1 = UnwrapGeometry(info[1]);
          
          wrapper->_instance->SetAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryCollection^>(info.This())) {
        return;
      }

      GeometryCollection *wrapper = GeometryCollection::Unwrap<GeometryCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Xaml::Media::Geometry^ arg1 = UnwrapGeometry(info[1]);
          
          wrapper->_instance->InsertAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryCollection^>(info.This())) {
        return;
      }

      GeometryCollection *wrapper = GeometryCollection::Unwrap<GeometryCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          wrapper->_instance->RemoveAt(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Append(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryCollection^>(info.This())) {
        return;
      }

      GeometryCollection *wrapper = GeometryCollection::Unwrap<GeometryCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Media::Geometry^ arg0 = UnwrapGeometry(info[0]);
          
          wrapper->_instance->Append(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAtEnd(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryCollection^>(info.This())) {
        return;
      }

      GeometryCollection *wrapper = GeometryCollection::Unwrap<GeometryCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->RemoveAtEnd();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryCollection^>(info.This())) {
        return;
      }

      GeometryCollection *wrapper = GeometryCollection::Unwrap<GeometryCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Clear();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetMany(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Not implemented")));
    }
    static void ReplaceAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryCollection^>(info.This())) {
        return;
      }

      GeometryCollection *wrapper = GeometryCollection::Unwrap<GeometryCollection>(info.This());

      if (info.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<::Windows::UI::Xaml::Media::Geometry^>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Platform::Array<::Windows::UI::Xaml::Media::Geometry^>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<::Windows::UI::Xaml::Media::Geometry^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<::Windows::UI::Xaml::Media::Geometry^>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(value);
                 },
                 [](Local<Value> value) -> ::Windows::UI::Xaml::Media::Geometry^ {
                   return UnwrapGeometry(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<::Windows::UI::Xaml::Media::Geometry^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          wrapper->_instance->ReplaceAll(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryCollection^>(info.This())) {
        return;
      }

      GeometryCollection *wrapper = GeometryCollection::Unwrap<GeometryCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::UI::Xaml::Media::Geometry^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::UI::Xaml::Media::Geometry^>::CreateIteratorWrapper(result, 
            [](::Windows::UI::Xaml::Media::Geometry^ val) -> Local<Value> {
              return WrapGeometry(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





    private:
      ::Windows::UI::Xaml::Media::GeometryCollection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapGeometryCollection(::Windows::UI::Xaml::Media::GeometryCollection^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::GeometryCollection^ UnwrapGeometryCollection(Local<Value> value);
  };

  Persistent<FunctionTemplate> GeometryCollection::s_constructorTemplate;

  v8::Local<v8::Value> WrapGeometryCollection(::Windows::UI::Xaml::Media::GeometryCollection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(GeometryCollection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::GeometryCollection^ UnwrapGeometryCollection(Local<Value> value) {
     return GeometryCollection::Unwrap<GeometryCollection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitGeometryCollection(Local<Object> exports) {
    GeometryCollection::Init(exports);
  }

  class GradientStopCollection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("GradientStopCollection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getAt", GetAt);
            Nan::SetPrototypeMethod(localRef, "getView", GetView);
            Nan::SetPrototypeMethod(localRef, "indexOf", IndexOf);
            Nan::SetPrototypeMethod(localRef, "setAt", SetAt);
            Nan::SetPrototypeMethod(localRef, "insertAt", InsertAt);
            Nan::SetPrototypeMethod(localRef, "removeAt", RemoveAt);
            Nan::SetPrototypeMethod(localRef, "append", Append);
            Nan::SetPrototypeMethod(localRef, "removeAtEnd", RemoveAtEnd);
            Nan::SetPrototypeMethod(localRef, "clear", Clear);
            Nan::SetPrototypeMethod(localRef, "getMany", GetMany);
            Nan::SetPrototypeMethod(localRef, "replaceAll", ReplaceAll);
            Nan::SetPrototypeMethod(localRef, "first", First);
          




        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("GradientStopCollection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      GradientStopCollection(::Windows::UI::Xaml::Media::GradientStopCollection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::GradientStopCollection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::GradientStopCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::GradientStopCollection();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      GradientStopCollection *wrapperInstance = new GradientStopCollection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::GradientStopCollection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::GradientStopCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapGradientStopCollection(winRtInstance));
    }


    static void GetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(info.This())) {
        return;
      }

      GradientStopCollection *wrapper = GradientStopCollection::Unwrap<GradientStopCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          ::Windows::UI::Xaml::Media::GradientStop^ result;
          result = wrapper->_instance->GetAt(arg0);
          info.GetReturnValue().Set(WrapGradientStop(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(info.This())) {
        return;
      }

      GradientStopCollection *wrapper = GradientStopCollection::Unwrap<GradientStopCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IVectorView<::Windows::UI::Xaml::Media::GradientStop^>^ result;
          result = wrapper->_instance->GetView();
          info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Windows::UI::Xaml::Media::GradientStop^>::CreateVectorViewWrapper(result, 
            [](::Windows::UI::Xaml::Media::GradientStop^ val) -> Local<Value> {
              return WrapGradientStop(val);
            },
            [](Local<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStop^>(value);
            },
            [](Local<Value> value) -> ::Windows::UI::Xaml::Media::GradientStop^ {
              return UnwrapGradientStop(value);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void IndexOf(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(info.This())) {
        return;
      }

      GradientStopCollection *wrapper = GradientStopCollection::Unwrap<GradientStopCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStop^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Media::GradientStop^ arg0 = UnwrapGradientStop(info[0]);
          unsigned int arg1;
          
          bool result;
          result = wrapper->_instance->IndexOf(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("boolean").ToLocalChecked(), Nan::New<Boolean>(result));
          Nan::Set(resObj, Nan::New<String>("index").ToLocalChecked(), Nan::New<Integer>(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(info.This())) {
        return;
      }

      GradientStopCollection *wrapper = GradientStopCollection::Unwrap<GradientStopCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStop^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Xaml::Media::GradientStop^ arg1 = UnwrapGradientStop(info[1]);
          
          wrapper->_instance->SetAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(info.This())) {
        return;
      }

      GradientStopCollection *wrapper = GradientStopCollection::Unwrap<GradientStopCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStop^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Xaml::Media::GradientStop^ arg1 = UnwrapGradientStop(info[1]);
          
          wrapper->_instance->InsertAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(info.This())) {
        return;
      }

      GradientStopCollection *wrapper = GradientStopCollection::Unwrap<GradientStopCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          wrapper->_instance->RemoveAt(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Append(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(info.This())) {
        return;
      }

      GradientStopCollection *wrapper = GradientStopCollection::Unwrap<GradientStopCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStop^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Media::GradientStop^ arg0 = UnwrapGradientStop(info[0]);
          
          wrapper->_instance->Append(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAtEnd(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(info.This())) {
        return;
      }

      GradientStopCollection *wrapper = GradientStopCollection::Unwrap<GradientStopCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->RemoveAtEnd();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(info.This())) {
        return;
      }

      GradientStopCollection *wrapper = GradientStopCollection::Unwrap<GradientStopCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Clear();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetMany(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Not implemented")));
    }
    static void ReplaceAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(info.This())) {
        return;
      }

      GradientStopCollection *wrapper = GradientStopCollection::Unwrap<GradientStopCollection>(info.This());

      if (info.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<::Windows::UI::Xaml::Media::GradientStop^>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Platform::Array<::Windows::UI::Xaml::Media::GradientStop^>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<::Windows::UI::Xaml::Media::GradientStop^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<::Windows::UI::Xaml::Media::GradientStop^>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStop^>(value);
                 },
                 [](Local<Value> value) -> ::Windows::UI::Xaml::Media::GradientStop^ {
                   return UnwrapGradientStop(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<::Windows::UI::Xaml::Media::GradientStop^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          wrapper->_instance->ReplaceAll(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(info.This())) {
        return;
      }

      GradientStopCollection *wrapper = GradientStopCollection::Unwrap<GradientStopCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::UI::Xaml::Media::GradientStop^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::UI::Xaml::Media::GradientStop^>::CreateIteratorWrapper(result, 
            [](::Windows::UI::Xaml::Media::GradientStop^ val) -> Local<Value> {
              return WrapGradientStop(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





    private:
      ::Windows::UI::Xaml::Media::GradientStopCollection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapGradientStopCollection(::Windows::UI::Xaml::Media::GradientStopCollection^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::GradientStopCollection^ UnwrapGradientStopCollection(Local<Value> value);
  };

  Persistent<FunctionTemplate> GradientStopCollection::s_constructorTemplate;

  v8::Local<v8::Value> WrapGradientStopCollection(::Windows::UI::Xaml::Media::GradientStopCollection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(GradientStopCollection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::GradientStopCollection^ UnwrapGradientStopCollection(Local<Value> value) {
     return GradientStopCollection::Unwrap<GradientStopCollection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitGradientStopCollection(Local<Object> exports) {
    GradientStopCollection::Init(exports);
  }

  class LoadedImageSourceLoadCompletedEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("LoadedImageSourceLoadCompletedEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("status").ToLocalChecked(), StatusGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("LoadedImageSourceLoadCompletedEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LoadedImageSourceLoadCompletedEventArgs(::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      LoadedImageSourceLoadCompletedEventArgs *wrapperInstance = new LoadedImageSourceLoadCompletedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLoadedImageSourceLoadCompletedEventArgs(winRtInstance));
    }





    static void StatusGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^>(info.This())) {
        return;
      }

      LoadedImageSourceLoadCompletedEventArgs *wrapper = LoadedImageSourceLoadCompletedEventArgs::Unwrap<LoadedImageSourceLoadCompletedEventArgs>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::LoadedImageSourceLoadStatus result = wrapper->_instance->Status;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLoadedImageSourceLoadCompletedEventArgs(::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^ UnwrapLoadedImageSourceLoadCompletedEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> LoadedImageSourceLoadCompletedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapLoadedImageSourceLoadCompletedEventArgs(::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(LoadedImageSourceLoadCompletedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^ UnwrapLoadedImageSourceLoadCompletedEventArgs(Local<Value> value) {
     return LoadedImageSourceLoadCompletedEventArgs::Unwrap<LoadedImageSourceLoadCompletedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLoadedImageSourceLoadCompletedEventArgs(Local<Object> exports) {
    LoadedImageSourceLoadCompletedEventArgs::Init(exports);
  }

  class LoadedImageSurface : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("LoadedImageSurface").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "close", Close);
          


          
          Nan::SetPrototypeMethod(localRef,"addListener", AddListener);
          Nan::SetPrototypeMethod(localRef,"on", AddListener);
          Nan::SetPrototypeMethod(localRef,"removeListener", RemoveListener);
          Nan::SetPrototypeMethod(localRef, "off", RemoveListener);

          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("decodedPhysicalSize").ToLocalChecked(), DecodedPhysicalSizeGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("decodedSize").ToLocalChecked(), DecodedSizeGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("naturalSize").ToLocalChecked(), NaturalSizeGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetMethod(constructor, "startLoadFromUri", StartLoadFromUri);
        Nan::SetMethod(constructor, "startLoadFromStream", StartLoadFromStream);


        Nan::Set(exports, Nan::New<String>("LoadedImageSurface").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LoadedImageSurface(::Windows::UI::Xaml::Media::LoadedImageSurface^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::LoadedImageSurface^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LoadedImageSurface^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::LoadedImageSurface^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      LoadedImageSurface *wrapperInstance = new LoadedImageSurface(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LoadedImageSurface^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::LoadedImageSurface^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::LoadedImageSurface^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLoadedImageSurface(winRtInstance));
    }



    static void Close(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LoadedImageSurface^>(info.This())) {
        return;
      }

      LoadedImageSurface *wrapper = LoadedImageSurface::Unwrap<LoadedImageSurface>(info.This());

      if (info.Length() == 0) {
        try {
          delete wrapper->_instance;
          wrapper->_instance = nullptr;
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      } else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void StartLoadFromUri(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(info[0])
        && NodeRT::Utils::IsSize(info[1]))
      {
        try
        {
          ::Windows::Foundation::Uri^ arg0 = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(info[0]));
          ::Windows::Foundation::Size arg1 = NodeRT::Utils::SizeFromJs(info[1]);
          
          ::Windows::UI::Xaml::Media::LoadedImageSurface^ result;
          result = ::Windows::UI::Xaml::Media::LoadedImageSurface::StartLoadFromUri(arg0, arg1);
          info.GetReturnValue().Set(WrapLoadedImageSurface(result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(info[0]))
      {
        try
        {
          ::Windows::Foundation::Uri^ arg0 = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          ::Windows::UI::Xaml::Media::LoadedImageSurface^ result;
          result = ::Windows::UI::Xaml::Media::LoadedImageSurface::StartLoadFromUri(arg0);
          info.GetReturnValue().Set(WrapLoadedImageSurface(result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void StartLoadFromStream(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Storage::Streams::IRandomAccessStream^>(info[0])
        && NodeRT::Utils::IsSize(info[1]))
      {
        try
        {
          ::Windows::Storage::Streams::IRandomAccessStream^ arg0 = dynamic_cast<::Windows::Storage::Streams::IRandomAccessStream^>(NodeRT::Utils::GetObjectInstance(info[0]));
          ::Windows::Foundation::Size arg1 = NodeRT::Utils::SizeFromJs(info[1]);
          
          ::Windows::UI::Xaml::Media::LoadedImageSurface^ result;
          result = ::Windows::UI::Xaml::Media::LoadedImageSurface::StartLoadFromStream(arg0, arg1);
          info.GetReturnValue().Set(WrapLoadedImageSurface(result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Storage::Streams::IRandomAccessStream^>(info[0]))
      {
        try
        {
          ::Windows::Storage::Streams::IRandomAccessStream^ arg0 = dynamic_cast<::Windows::Storage::Streams::IRandomAccessStream^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          ::Windows::UI::Xaml::Media::LoadedImageSurface^ result;
          result = ::Windows::UI::Xaml::Media::LoadedImageSurface::StartLoadFromStream(arg0);
          info.GetReturnValue().Set(WrapLoadedImageSurface(result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void DecodedPhysicalSizeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LoadedImageSurface^>(info.This())) {
        return;
      }

      LoadedImageSurface *wrapper = LoadedImageSurface::Unwrap<LoadedImageSurface>(info.This());

      try  {
        ::Windows::Foundation::Size result = wrapper->_instance->DecodedPhysicalSize;
        info.GetReturnValue().Set(NodeRT::Utils::SizeToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DecodedSizeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LoadedImageSurface^>(info.This())) {
        return;
      }

      LoadedImageSurface *wrapper = LoadedImageSurface::Unwrap<LoadedImageSurface>(info.This());

      try  {
        ::Windows::Foundation::Size result = wrapper->_instance->DecodedSize;
        info.GetReturnValue().Set(NodeRT::Utils::SizeToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void NaturalSizeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LoadedImageSurface^>(info.This())) {
        return;
      }

      LoadedImageSurface *wrapper = LoadedImageSurface::Unwrap<LoadedImageSurface>(info.This());

      try  {
        ::Windows::Foundation::Size result = wrapper->_instance->NaturalSize;
        info.GetReturnValue().Set(NodeRT::Utils::SizeToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void AddListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected arguments are eventName(string),callback(function)")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      Local<Function> callback = info[1].As<Function>();

      ::Windows::Foundation::EventRegistrationToken registrationToken;
      if (NodeRT::Utils::CaseInsenstiveEquals(L"loadCompleted", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LoadedImageSurface^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        LoadedImageSurface *wrapper = LoadedImageSurface::Unwrap<LoadedImageSurface>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->LoadCompleted::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Xaml::Media::LoadedImageSurface^, ::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^>(
            [callbackObjPtr](::Windows::UI::Xaml::Media::LoadedImageSurface^ arg0, ::Windows::UI::Xaml::Media::LoadedImageSourceLoadCompletedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapLoadedImageSurface(arg0);
                  wrappedArg1 = WrapLoadedImageSourceLoadCompletedEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
 else  {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Value> tokenMapVal = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());
      Local<Object> tokenMap;

      if (tokenMapVal.IsEmpty() || Nan::Equals(tokenMapVal, Undefined()).FromMaybe(false)) {
        tokenMap = Nan::New<Object>();
        NodeRT::Utils::SetHiddenValueWithObject(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked(), tokenMap);
      } else {
        tokenMap = Nan::To<Object>(tokenMapVal).ToLocalChecked();
      }

      Nan::Set(tokenMap, info[0], CreateOpaqueWrapper(::Windows::Foundation::PropertyValue::CreateInt64(registrationToken.Value)));
    }

    static void RemoveListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected a string and a callback")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      if ((!NodeRT::Utils::CaseInsenstiveEquals(L"loadCompleted", str))) {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Function> callback = info[1].As<Function>();
      Local<Value> tokenMap = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());

      if (tokenMap.IsEmpty() || Nan::Equals(tokenMap, Undefined()).FromMaybe(false)) {
        return;
      }

      Local<Value> opaqueWrapperObj =  Nan::Get(Nan::To<Object>(tokenMap).ToLocalChecked(), info[0]).ToLocalChecked();

      if (opaqueWrapperObj.IsEmpty() || Nan::Equals(opaqueWrapperObj,Undefined()).FromMaybe(false)) {
        return;
      }

      OpaqueWrapper *opaqueWrapper = OpaqueWrapper::Unwrap<OpaqueWrapper>(opaqueWrapperObj.As<Object>());

      long long tokenValue = (long long) opaqueWrapper->GetObjectInstance();
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      registrationToken.Value = tokenValue;

      try  {
        if (NodeRT::Utils::CaseInsenstiveEquals(L"loadCompleted", str)) {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LoadedImageSurface^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          LoadedImageSurface *wrapper = LoadedImageSurface::Unwrap<LoadedImageSurface>(info.This());
          wrapper->_instance->LoadCompleted::remove(registrationToken);
        }
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }

      Nan::Delete(Nan::To<Object>(tokenMap).ToLocalChecked(), Nan::To<String>(info[0]).ToLocalChecked());
    }
    private:
      ::Windows::UI::Xaml::Media::LoadedImageSurface^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLoadedImageSurface(::Windows::UI::Xaml::Media::LoadedImageSurface^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::LoadedImageSurface^ UnwrapLoadedImageSurface(Local<Value> value);
  };

  Persistent<FunctionTemplate> LoadedImageSurface::s_constructorTemplate;

  v8::Local<v8::Value> WrapLoadedImageSurface(::Windows::UI::Xaml::Media::LoadedImageSurface^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(LoadedImageSurface::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::LoadedImageSurface^ UnwrapLoadedImageSurface(Local<Value> value) {
     return LoadedImageSurface::Unwrap<LoadedImageSurface>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLoadedImageSurface(Local<Object> exports) {
    LoadedImageSurface::Init(exports);
  }

  class PathFigureCollection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("PathFigureCollection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getAt", GetAt);
            Nan::SetPrototypeMethod(localRef, "getView", GetView);
            Nan::SetPrototypeMethod(localRef, "indexOf", IndexOf);
            Nan::SetPrototypeMethod(localRef, "setAt", SetAt);
            Nan::SetPrototypeMethod(localRef, "insertAt", InsertAt);
            Nan::SetPrototypeMethod(localRef, "removeAt", RemoveAt);
            Nan::SetPrototypeMethod(localRef, "append", Append);
            Nan::SetPrototypeMethod(localRef, "removeAtEnd", RemoveAtEnd);
            Nan::SetPrototypeMethod(localRef, "clear", Clear);
            Nan::SetPrototypeMethod(localRef, "getMany", GetMany);
            Nan::SetPrototypeMethod(localRef, "replaceAll", ReplaceAll);
            Nan::SetPrototypeMethod(localRef, "first", First);
          




        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("PathFigureCollection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      PathFigureCollection(::Windows::UI::Xaml::Media::PathFigureCollection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::PathFigureCollection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigureCollection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::PathFigureCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::PathFigureCollection();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      PathFigureCollection *wrapperInstance = new PathFigureCollection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigureCollection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::PathFigureCollection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::PathFigureCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapPathFigureCollection(winRtInstance));
    }


    static void GetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigureCollection^>(info.This())) {
        return;
      }

      PathFigureCollection *wrapper = PathFigureCollection::Unwrap<PathFigureCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          ::Windows::UI::Xaml::Media::PathFigure^ result;
          result = wrapper->_instance->GetAt(arg0);
          info.GetReturnValue().Set(WrapPathFigure(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigureCollection^>(info.This())) {
        return;
      }

      PathFigureCollection *wrapper = PathFigureCollection::Unwrap<PathFigureCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IVectorView<::Windows::UI::Xaml::Media::PathFigure^>^ result;
          result = wrapper->_instance->GetView();
          info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Windows::UI::Xaml::Media::PathFigure^>::CreateVectorViewWrapper(result, 
            [](::Windows::UI::Xaml::Media::PathFigure^ val) -> Local<Value> {
              return WrapPathFigure(val);
            },
            [](Local<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(value);
            },
            [](Local<Value> value) -> ::Windows::UI::Xaml::Media::PathFigure^ {
              return UnwrapPathFigure(value);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void IndexOf(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigureCollection^>(info.This())) {
        return;
      }

      PathFigureCollection *wrapper = PathFigureCollection::Unwrap<PathFigureCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Media::PathFigure^ arg0 = UnwrapPathFigure(info[0]);
          unsigned int arg1;
          
          bool result;
          result = wrapper->_instance->IndexOf(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("boolean").ToLocalChecked(), Nan::New<Boolean>(result));
          Nan::Set(resObj, Nan::New<String>("index").ToLocalChecked(), Nan::New<Integer>(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigureCollection^>(info.This())) {
        return;
      }

      PathFigureCollection *wrapper = PathFigureCollection::Unwrap<PathFigureCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Xaml::Media::PathFigure^ arg1 = UnwrapPathFigure(info[1]);
          
          wrapper->_instance->SetAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigureCollection^>(info.This())) {
        return;
      }

      PathFigureCollection *wrapper = PathFigureCollection::Unwrap<PathFigureCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Xaml::Media::PathFigure^ arg1 = UnwrapPathFigure(info[1]);
          
          wrapper->_instance->InsertAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigureCollection^>(info.This())) {
        return;
      }

      PathFigureCollection *wrapper = PathFigureCollection::Unwrap<PathFigureCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          wrapper->_instance->RemoveAt(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Append(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigureCollection^>(info.This())) {
        return;
      }

      PathFigureCollection *wrapper = PathFigureCollection::Unwrap<PathFigureCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Media::PathFigure^ arg0 = UnwrapPathFigure(info[0]);
          
          wrapper->_instance->Append(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAtEnd(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigureCollection^>(info.This())) {
        return;
      }

      PathFigureCollection *wrapper = PathFigureCollection::Unwrap<PathFigureCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->RemoveAtEnd();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigureCollection^>(info.This())) {
        return;
      }

      PathFigureCollection *wrapper = PathFigureCollection::Unwrap<PathFigureCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Clear();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetMany(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Not implemented")));
    }
    static void ReplaceAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigureCollection^>(info.This())) {
        return;
      }

      PathFigureCollection *wrapper = PathFigureCollection::Unwrap<PathFigureCollection>(info.This());

      if (info.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<::Windows::UI::Xaml::Media::PathFigure^>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Platform::Array<::Windows::UI::Xaml::Media::PathFigure^>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<::Windows::UI::Xaml::Media::PathFigure^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<::Windows::UI::Xaml::Media::PathFigure^>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(value);
                 },
                 [](Local<Value> value) -> ::Windows::UI::Xaml::Media::PathFigure^ {
                   return UnwrapPathFigure(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<::Windows::UI::Xaml::Media::PathFigure^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          wrapper->_instance->ReplaceAll(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigureCollection^>(info.This())) {
        return;
      }

      PathFigureCollection *wrapper = PathFigureCollection::Unwrap<PathFigureCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::UI::Xaml::Media::PathFigure^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::UI::Xaml::Media::PathFigure^>::CreateIteratorWrapper(result, 
            [](::Windows::UI::Xaml::Media::PathFigure^ val) -> Local<Value> {
              return WrapPathFigure(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





    private:
      ::Windows::UI::Xaml::Media::PathFigureCollection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapPathFigureCollection(::Windows::UI::Xaml::Media::PathFigureCollection^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::PathFigureCollection^ UnwrapPathFigureCollection(Local<Value> value);
  };

  Persistent<FunctionTemplate> PathFigureCollection::s_constructorTemplate;

  v8::Local<v8::Value> WrapPathFigureCollection(::Windows::UI::Xaml::Media::PathFigureCollection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(PathFigureCollection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::PathFigureCollection^ UnwrapPathFigureCollection(Local<Value> value) {
     return PathFigureCollection::Unwrap<PathFigureCollection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitPathFigureCollection(Local<Object> exports) {
    PathFigureCollection::Init(exports);
  }

  class PathSegmentCollection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("PathSegmentCollection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getAt", GetAt);
            Nan::SetPrototypeMethod(localRef, "getView", GetView);
            Nan::SetPrototypeMethod(localRef, "indexOf", IndexOf);
            Nan::SetPrototypeMethod(localRef, "setAt", SetAt);
            Nan::SetPrototypeMethod(localRef, "insertAt", InsertAt);
            Nan::SetPrototypeMethod(localRef, "removeAt", RemoveAt);
            Nan::SetPrototypeMethod(localRef, "append", Append);
            Nan::SetPrototypeMethod(localRef, "removeAtEnd", RemoveAtEnd);
            Nan::SetPrototypeMethod(localRef, "clear", Clear);
            Nan::SetPrototypeMethod(localRef, "getMany", GetMany);
            Nan::SetPrototypeMethod(localRef, "replaceAll", ReplaceAll);
            Nan::SetPrototypeMethod(localRef, "first", First);
          




        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("PathSegmentCollection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      PathSegmentCollection(::Windows::UI::Xaml::Media::PathSegmentCollection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::PathSegmentCollection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegmentCollection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::PathSegmentCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::PathSegmentCollection();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      PathSegmentCollection *wrapperInstance = new PathSegmentCollection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegmentCollection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::PathSegmentCollection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::PathSegmentCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapPathSegmentCollection(winRtInstance));
    }


    static void GetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegmentCollection^>(info.This())) {
        return;
      }

      PathSegmentCollection *wrapper = PathSegmentCollection::Unwrap<PathSegmentCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          ::Windows::UI::Xaml::Media::PathSegment^ result;
          result = wrapper->_instance->GetAt(arg0);
          info.GetReturnValue().Set(WrapPathSegment(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegmentCollection^>(info.This())) {
        return;
      }

      PathSegmentCollection *wrapper = PathSegmentCollection::Unwrap<PathSegmentCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IVectorView<::Windows::UI::Xaml::Media::PathSegment^>^ result;
          result = wrapper->_instance->GetView();
          info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Windows::UI::Xaml::Media::PathSegment^>::CreateVectorViewWrapper(result, 
            [](::Windows::UI::Xaml::Media::PathSegment^ val) -> Local<Value> {
              return WrapPathSegment(val);
            },
            [](Local<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegment^>(value);
            },
            [](Local<Value> value) -> ::Windows::UI::Xaml::Media::PathSegment^ {
              return UnwrapPathSegment(value);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void IndexOf(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegmentCollection^>(info.This())) {
        return;
      }

      PathSegmentCollection *wrapper = PathSegmentCollection::Unwrap<PathSegmentCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegment^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Media::PathSegment^ arg0 = UnwrapPathSegment(info[0]);
          unsigned int arg1;
          
          bool result;
          result = wrapper->_instance->IndexOf(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("boolean").ToLocalChecked(), Nan::New<Boolean>(result));
          Nan::Set(resObj, Nan::New<String>("index").ToLocalChecked(), Nan::New<Integer>(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegmentCollection^>(info.This())) {
        return;
      }

      PathSegmentCollection *wrapper = PathSegmentCollection::Unwrap<PathSegmentCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegment^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Xaml::Media::PathSegment^ arg1 = UnwrapPathSegment(info[1]);
          
          wrapper->_instance->SetAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegmentCollection^>(info.This())) {
        return;
      }

      PathSegmentCollection *wrapper = PathSegmentCollection::Unwrap<PathSegmentCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegment^>(info[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Xaml::Media::PathSegment^ arg1 = UnwrapPathSegment(info[1]);
          
          wrapper->_instance->InsertAt(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegmentCollection^>(info.This())) {
        return;
      }

      PathSegmentCollection *wrapper = PathSegmentCollection::Unwrap<PathSegmentCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          wrapper->_instance->RemoveAt(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Append(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegmentCollection^>(info.This())) {
        return;
      }

      PathSegmentCollection *wrapper = PathSegmentCollection::Unwrap<PathSegmentCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegment^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::Media::PathSegment^ arg0 = UnwrapPathSegment(info[0]);
          
          wrapper->_instance->Append(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAtEnd(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegmentCollection^>(info.This())) {
        return;
      }

      PathSegmentCollection *wrapper = PathSegmentCollection::Unwrap<PathSegmentCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->RemoveAtEnd();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegmentCollection^>(info.This())) {
        return;
      }

      PathSegmentCollection *wrapper = PathSegmentCollection::Unwrap<PathSegmentCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Clear();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetMany(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Not implemented")));
    }
    static void ReplaceAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegmentCollection^>(info.This())) {
        return;
      }

      PathSegmentCollection *wrapper = PathSegmentCollection::Unwrap<PathSegmentCollection>(info.This());

      if (info.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<::Windows::UI::Xaml::Media::PathSegment^>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Platform::Array<::Windows::UI::Xaml::Media::PathSegment^>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<::Windows::UI::Xaml::Media::PathSegment^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<::Windows::UI::Xaml::Media::PathSegment^>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegment^>(value);
                 },
                 [](Local<Value> value) -> ::Windows::UI::Xaml::Media::PathSegment^ {
                   return UnwrapPathSegment(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<::Windows::UI::Xaml::Media::PathSegment^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          wrapper->_instance->ReplaceAll(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegmentCollection^>(info.This())) {
        return;
      }

      PathSegmentCollection *wrapper = PathSegmentCollection::Unwrap<PathSegmentCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::UI::Xaml::Media::PathSegment^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::UI::Xaml::Media::PathSegment^>::CreateIteratorWrapper(result, 
            [](::Windows::UI::Xaml::Media::PathSegment^ val) -> Local<Value> {
              return WrapPathSegment(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





    private:
      ::Windows::UI::Xaml::Media::PathSegmentCollection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapPathSegmentCollection(::Windows::UI::Xaml::Media::PathSegmentCollection^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::PathSegmentCollection^ UnwrapPathSegmentCollection(Local<Value> value);
  };

  Persistent<FunctionTemplate> PathSegmentCollection::s_constructorTemplate;

  v8::Local<v8::Value> WrapPathSegmentCollection(::Windows::UI::Xaml::Media::PathSegmentCollection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(PathSegmentCollection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::PathSegmentCollection^ UnwrapPathSegmentCollection(Local<Value> value) {
     return PathSegmentCollection::Unwrap<PathSegmentCollection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitPathSegmentCollection(Local<Object> exports) {
    PathSegmentCollection::Init(exports);
  }

  class GradientStop : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("GradientStop").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("offset").ToLocalChecked(), OffsetGetter, OffsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("color").ToLocalChecked(), ColorGetter, ColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("colorProperty").ToLocalChecked(), ColorPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("offsetProperty").ToLocalChecked(), OffsetPropertyGetter);


        Nan::Set(exports, Nan::New<String>("GradientStop").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      GradientStop(::Windows::UI::Xaml::Media::GradientStop^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::GradientStop^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStop^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::GradientStop^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::GradientStop();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      GradientStop *wrapperInstance = new GradientStop(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStop^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::GradientStop^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::GradientStop^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapGradientStop(winRtInstance));
    }





    static void OffsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStop^>(info.This())) {
        return;
      }

      GradientStop *wrapper = GradientStop::Unwrap<GradientStop>(info.This());

      try  {
        double result = wrapper->_instance->Offset;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStop^>(info.This())) {
        return;
      }

      GradientStop *wrapper = GradientStop::Unwrap<GradientStop>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Offset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStop^>(info.This())) {
        return;
      }

      GradientStop *wrapper = GradientStop::Unwrap<GradientStop>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->Color;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStop^>(info.This())) {
        return;
      }

      GradientStop *wrapper = GradientStop::Unwrap<GradientStop>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->Color = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void ColorPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::GradientStop::ColorProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void OffsetPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::GradientStop::OffsetProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::GradientStop^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapGradientStop(::Windows::UI::Xaml::Media::GradientStop^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::GradientStop^ UnwrapGradientStop(Local<Value> value);
  };

  Persistent<FunctionTemplate> GradientStop::s_constructorTemplate;

  v8::Local<v8::Value> WrapGradientStop(::Windows::UI::Xaml::Media::GradientStop^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(GradientStop::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::GradientStop^ UnwrapGradientStop(Local<Value> value) {
     return GradientStop::Unwrap<GradientStop>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitGradientStop(Local<Object> exports) {
    GradientStop::Init(exports);
  }

  class PathFigure : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("PathFigure").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("startPoint").ToLocalChecked(), StartPointGetter, StartPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("segments").ToLocalChecked(), SegmentsGetter, SegmentsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isFilled").ToLocalChecked(), IsFilledGetter, IsFilledSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isClosed").ToLocalChecked(), IsClosedGetter, IsClosedSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("isClosedProperty").ToLocalChecked(), IsClosedPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("isFilledProperty").ToLocalChecked(), IsFilledPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("segmentsProperty").ToLocalChecked(), SegmentsPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("startPointProperty").ToLocalChecked(), StartPointPropertyGetter);


        Nan::Set(exports, Nan::New<String>("PathFigure").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      PathFigure(::Windows::UI::Xaml::Media::PathFigure^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::PathFigure^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::PathFigure^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::PathFigure();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      PathFigure *wrapperInstance = new PathFigure(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::PathFigure^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::PathFigure^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapPathFigure(winRtInstance));
    }





    static void StartPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(info.This())) {
        return;
      }

      PathFigure *wrapper = PathFigure::Unwrap<PathFigure>(info.This());

      try  {
        ::Windows::Foundation::Point result = wrapper->_instance->StartPoint;
        info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StartPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsPoint(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(info.This())) {
        return;
      }

      PathFigure *wrapper = PathFigure::Unwrap<PathFigure>(info.This());

      try {

        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->StartPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void SegmentsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(info.This())) {
        return;
      }

      PathFigure *wrapper = PathFigure::Unwrap<PathFigure>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::PathSegmentCollection^ result = wrapper->_instance->Segments;
        info.GetReturnValue().Set(WrapPathSegmentCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SegmentsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathSegmentCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(info.This())) {
        return;
      }

      PathFigure *wrapper = PathFigure::Unwrap<PathFigure>(info.This());

      try {

        ::Windows::UI::Xaml::Media::PathSegmentCollection^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::PathSegmentCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Segments = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsFilledGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(info.This())) {
        return;
      }

      PathFigure *wrapper = PathFigure::Unwrap<PathFigure>(info.This());

      try  {
        bool result = wrapper->_instance->IsFilled;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsFilledSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(info.This())) {
        return;
      }

      PathFigure *wrapper = PathFigure::Unwrap<PathFigure>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsFilled = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsClosedGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(info.This())) {
        return;
      }

      PathFigure *wrapper = PathFigure::Unwrap<PathFigure>(info.This());

      try  {
        bool result = wrapper->_instance->IsClosed;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsClosedSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigure^>(info.This())) {
        return;
      }

      PathFigure *wrapper = PathFigure::Unwrap<PathFigure>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsClosed = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void IsClosedPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PathFigure::IsClosedProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void IsFilledPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PathFigure::IsFilledProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void SegmentsPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PathFigure::SegmentsProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void StartPointPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PathFigure::StartPointProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::PathFigure^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapPathFigure(::Windows::UI::Xaml::Media::PathFigure^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::PathFigure^ UnwrapPathFigure(Local<Value> value);
  };

  Persistent<FunctionTemplate> PathFigure::s_constructorTemplate;

  v8::Local<v8::Value> WrapPathFigure(::Windows::UI::Xaml::Media::PathFigure^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(PathFigure::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::PathFigure^ UnwrapPathFigure(Local<Value> value) {
     return PathFigure::Unwrap<PathFigure>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitPathFigure(Local<Object> exports) {
    PathFigure::Init(exports);
  }

  class ArcSegment : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("ArcSegment").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("sweepDirection").ToLocalChecked(), SweepDirectionGetter, SweepDirectionSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("size").ToLocalChecked(), SizeGetter, SizeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngle").ToLocalChecked(), RotationAngleGetter, RotationAngleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("point").ToLocalChecked(), PointGetter, PointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isLargeArc").ToLocalChecked(), IsLargeArcGetter, IsLargeArcSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("isLargeArcProperty").ToLocalChecked(), IsLargeArcPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("pointProperty").ToLocalChecked(), PointPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("rotationAngleProperty").ToLocalChecked(), RotationAnglePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("sizeProperty").ToLocalChecked(), SizePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("sweepDirectionProperty").ToLocalChecked(), SweepDirectionPropertyGetter);


        Nan::Set(exports, Nan::New<String>("ArcSegment").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      ArcSegment(::Windows::UI::Xaml::Media::ArcSegment^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::ArcSegment^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ArcSegment^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::ArcSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::ArcSegment();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      ArcSegment *wrapperInstance = new ArcSegment(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ArcSegment^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::ArcSegment^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::ArcSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapArcSegment(winRtInstance));
    }





    static void SweepDirectionGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ArcSegment^>(info.This())) {
        return;
      }

      ArcSegment *wrapper = ArcSegment::Unwrap<ArcSegment>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::SweepDirection result = wrapper->_instance->SweepDirection;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SweepDirectionSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ArcSegment^>(info.This())) {
        return;
      }

      ArcSegment *wrapper = ArcSegment::Unwrap<ArcSegment>(info.This());

      try {

        ::Windows::UI::Xaml::Media::SweepDirection winRtValue = static_cast<::Windows::UI::Xaml::Media::SweepDirection>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->SweepDirection = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void SizeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ArcSegment^>(info.This())) {
        return;
      }

      ArcSegment *wrapper = ArcSegment::Unwrap<ArcSegment>(info.This());

      try  {
        ::Windows::Foundation::Size result = wrapper->_instance->Size;
        info.GetReturnValue().Set(NodeRT::Utils::SizeToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SizeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsSize(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ArcSegment^>(info.This())) {
        return;
      }

      ArcSegment *wrapper = ArcSegment::Unwrap<ArcSegment>(info.This());

      try {

        ::Windows::Foundation::Size winRtValue = NodeRT::Utils::SizeFromJs(value);

        wrapper->_instance->Size = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ArcSegment^>(info.This())) {
        return;
      }

      ArcSegment *wrapper = ArcSegment::Unwrap<ArcSegment>(info.This());

      try  {
        double result = wrapper->_instance->RotationAngle;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ArcSegment^>(info.This())) {
        return;
      }

      ArcSegment *wrapper = ArcSegment::Unwrap<ArcSegment>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->RotationAngle = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void PointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ArcSegment^>(info.This())) {
        return;
      }

      ArcSegment *wrapper = ArcSegment::Unwrap<ArcSegment>(info.This());

      try  {
        ::Windows::Foundation::Point result = wrapper->_instance->Point;
        info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsPoint(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ArcSegment^>(info.This())) {
        return;
      }

      ArcSegment *wrapper = ArcSegment::Unwrap<ArcSegment>(info.This());

      try {

        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->Point = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsLargeArcGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ArcSegment^>(info.This())) {
        return;
      }

      ArcSegment *wrapper = ArcSegment::Unwrap<ArcSegment>(info.This());

      try  {
        bool result = wrapper->_instance->IsLargeArc;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsLargeArcSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ArcSegment^>(info.This())) {
        return;
      }

      ArcSegment *wrapper = ArcSegment::Unwrap<ArcSegment>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsLargeArc = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void IsLargeArcPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::ArcSegment::IsLargeArcProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void PointPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::ArcSegment::PointProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RotationAnglePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::ArcSegment::RotationAngleProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void SizePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::ArcSegment::SizeProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void SweepDirectionPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::ArcSegment::SweepDirectionProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::ArcSegment^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapArcSegment(::Windows::UI::Xaml::Media::ArcSegment^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::ArcSegment^ UnwrapArcSegment(Local<Value> value);
  };

  Persistent<FunctionTemplate> ArcSegment::s_constructorTemplate;

  v8::Local<v8::Value> WrapArcSegment(::Windows::UI::Xaml::Media::ArcSegment^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(ArcSegment::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::ArcSegment^ UnwrapArcSegment(Local<Value> value) {
     return ArcSegment::Unwrap<ArcSegment>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitArcSegment(Local<Object> exports) {
    ArcSegment::Init(exports);
  }

  class BezierSegment : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("BezierSegment").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("point3").ToLocalChecked(), Point3Getter, Point3Setter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("point2").ToLocalChecked(), Point2Getter, Point2Setter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("point1").ToLocalChecked(), Point1Getter, Point1Setter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("point1Property").ToLocalChecked(), Point1PropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("point2Property").ToLocalChecked(), Point2PropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("point3Property").ToLocalChecked(), Point3PropertyGetter);


        Nan::Set(exports, Nan::New<String>("BezierSegment").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      BezierSegment(::Windows::UI::Xaml::Media::BezierSegment^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::BezierSegment^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BezierSegment^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::BezierSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::BezierSegment();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      BezierSegment *wrapperInstance = new BezierSegment(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BezierSegment^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::BezierSegment^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::BezierSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapBezierSegment(winRtInstance));
    }





    static void Point3Getter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BezierSegment^>(info.This())) {
        return;
      }

      BezierSegment *wrapper = BezierSegment::Unwrap<BezierSegment>(info.This());

      try  {
        ::Windows::Foundation::Point result = wrapper->_instance->Point3;
        info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void Point3Setter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsPoint(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BezierSegment^>(info.This())) {
        return;
      }

      BezierSegment *wrapper = BezierSegment::Unwrap<BezierSegment>(info.This());

      try {

        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->Point3 = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void Point2Getter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BezierSegment^>(info.This())) {
        return;
      }

      BezierSegment *wrapper = BezierSegment::Unwrap<BezierSegment>(info.This());

      try  {
        ::Windows::Foundation::Point result = wrapper->_instance->Point2;
        info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void Point2Setter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsPoint(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BezierSegment^>(info.This())) {
        return;
      }

      BezierSegment *wrapper = BezierSegment::Unwrap<BezierSegment>(info.This());

      try {

        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->Point2 = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void Point1Getter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BezierSegment^>(info.This())) {
        return;
      }

      BezierSegment *wrapper = BezierSegment::Unwrap<BezierSegment>(info.This());

      try  {
        ::Windows::Foundation::Point result = wrapper->_instance->Point1;
        info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void Point1Setter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsPoint(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::BezierSegment^>(info.This())) {
        return;
      }

      BezierSegment *wrapper = BezierSegment::Unwrap<BezierSegment>(info.This());

      try {

        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->Point1 = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void Point1PropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::BezierSegment::Point1Property;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void Point2PropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::BezierSegment::Point2Property;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void Point3PropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::BezierSegment::Point3Property;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::BezierSegment^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapBezierSegment(::Windows::UI::Xaml::Media::BezierSegment^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::BezierSegment^ UnwrapBezierSegment(Local<Value> value);
  };

  Persistent<FunctionTemplate> BezierSegment::s_constructorTemplate;

  v8::Local<v8::Value> WrapBezierSegment(::Windows::UI::Xaml::Media::BezierSegment^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(BezierSegment::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::BezierSegment^ UnwrapBezierSegment(Local<Value> value) {
     return BezierSegment::Unwrap<BezierSegment>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitBezierSegment(Local<Object> exports) {
    BezierSegment::Init(exports);
  }

  class EllipseGeometry : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EllipseGeometry").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("radiusY").ToLocalChecked(), RadiusYGetter, RadiusYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("radiusX").ToLocalChecked(), RadiusXGetter, RadiusXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("center").ToLocalChecked(), CenterGetter, CenterSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("bounds").ToLocalChecked(), BoundsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("centerProperty").ToLocalChecked(), CenterPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("radiusXProperty").ToLocalChecked(), RadiusXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("radiusYProperty").ToLocalChecked(), RadiusYPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("empty").ToLocalChecked(), EmptyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("standardFlatteningTolerance").ToLocalChecked(), StandardFlatteningToleranceGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("EllipseGeometry").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EllipseGeometry(::Windows::UI::Xaml::Media::EllipseGeometry^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::EllipseGeometry^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::EllipseGeometry^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::EllipseGeometry^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::EllipseGeometry();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EllipseGeometry *wrapperInstance = new EllipseGeometry(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::EllipseGeometry^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::EllipseGeometry^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::EllipseGeometry^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEllipseGeometry(winRtInstance));
    }





    static void RadiusYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::EllipseGeometry^>(info.This())) {
        return;
      }

      EllipseGeometry *wrapper = EllipseGeometry::Unwrap<EllipseGeometry>(info.This());

      try  {
        double result = wrapper->_instance->RadiusY;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RadiusYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::EllipseGeometry^>(info.This())) {
        return;
      }

      EllipseGeometry *wrapper = EllipseGeometry::Unwrap<EllipseGeometry>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->RadiusY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RadiusXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::EllipseGeometry^>(info.This())) {
        return;
      }

      EllipseGeometry *wrapper = EllipseGeometry::Unwrap<EllipseGeometry>(info.This());

      try  {
        double result = wrapper->_instance->RadiusX;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RadiusXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::EllipseGeometry^>(info.This())) {
        return;
      }

      EllipseGeometry *wrapper = EllipseGeometry::Unwrap<EllipseGeometry>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->RadiusX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::EllipseGeometry^>(info.This())) {
        return;
      }

      EllipseGeometry *wrapper = EllipseGeometry::Unwrap<EllipseGeometry>(info.This());

      try  {
        ::Windows::Foundation::Point result = wrapper->_instance->Center;
        info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsPoint(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::EllipseGeometry^>(info.This())) {
        return;
      }

      EllipseGeometry *wrapper = EllipseGeometry::Unwrap<EllipseGeometry>(info.This());

      try {

        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->Center = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BoundsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try  {
        ::Windows::Foundation::Rect result = wrapper->_instance->Bounds;
        info.GetReturnValue().Set(NodeRT::Utils::RectToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void CenterPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::EllipseGeometry::CenterProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RadiusXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::EllipseGeometry::RadiusXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RadiusYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::EllipseGeometry::RadiusYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void EmptyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::Media::Geometry^ result = ::Windows::UI::Xaml::Media::Geometry::Empty;
        info.GetReturnValue().Set(WrapGeometry(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void StandardFlatteningToleranceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        double result = ::Windows::UI::Xaml::Media::Geometry::StandardFlatteningTolerance;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Geometry::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::EllipseGeometry^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEllipseGeometry(::Windows::UI::Xaml::Media::EllipseGeometry^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::EllipseGeometry^ UnwrapEllipseGeometry(Local<Value> value);
  };

  Persistent<FunctionTemplate> EllipseGeometry::s_constructorTemplate;

  v8::Local<v8::Value> WrapEllipseGeometry(::Windows::UI::Xaml::Media::EllipseGeometry^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EllipseGeometry::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::EllipseGeometry^ UnwrapEllipseGeometry(Local<Value> value) {
     return EllipseGeometry::Unwrap<EllipseGeometry>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEllipseGeometry(Local<Object> exports) {
    EllipseGeometry::Init(exports);
  }

  class GeometryGroup : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("GeometryGroup").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("fillRule").ToLocalChecked(), FillRuleGetter, FillRuleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("children").ToLocalChecked(), ChildrenGetter, ChildrenSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("bounds").ToLocalChecked(), BoundsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("childrenProperty").ToLocalChecked(), ChildrenPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("fillRuleProperty").ToLocalChecked(), FillRulePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("empty").ToLocalChecked(), EmptyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("standardFlatteningTolerance").ToLocalChecked(), StandardFlatteningToleranceGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("GeometryGroup").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      GeometryGroup(::Windows::UI::Xaml::Media::GeometryGroup^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::GeometryGroup^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryGroup^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::GeometryGroup^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::GeometryGroup();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      GeometryGroup *wrapperInstance = new GeometryGroup(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryGroup^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::GeometryGroup^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::GeometryGroup^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapGeometryGroup(winRtInstance));
    }





    static void FillRuleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryGroup^>(info.This())) {
        return;
      }

      GeometryGroup *wrapper = GeometryGroup::Unwrap<GeometryGroup>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::FillRule result = wrapper->_instance->FillRule;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void FillRuleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryGroup^>(info.This())) {
        return;
      }

      GeometryGroup *wrapper = GeometryGroup::Unwrap<GeometryGroup>(info.This());

      try {

        ::Windows::UI::Xaml::Media::FillRule winRtValue = static_cast<::Windows::UI::Xaml::Media::FillRule>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->FillRule = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ChildrenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryGroup^>(info.This())) {
        return;
      }

      GeometryGroup *wrapper = GeometryGroup::Unwrap<GeometryGroup>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::GeometryCollection^ result = wrapper->_instance->Children;
        info.GetReturnValue().Set(WrapGeometryCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ChildrenSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GeometryGroup^>(info.This())) {
        return;
      }

      GeometryGroup *wrapper = GeometryGroup::Unwrap<GeometryGroup>(info.This());

      try {

        ::Windows::UI::Xaml::Media::GeometryCollection^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::GeometryCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Children = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BoundsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try  {
        ::Windows::Foundation::Rect result = wrapper->_instance->Bounds;
        info.GetReturnValue().Set(NodeRT::Utils::RectToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void ChildrenPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::GeometryGroup::ChildrenProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void FillRulePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::GeometryGroup::FillRuleProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void EmptyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::Media::Geometry^ result = ::Windows::UI::Xaml::Media::Geometry::Empty;
        info.GetReturnValue().Set(WrapGeometry(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void StandardFlatteningToleranceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        double result = ::Windows::UI::Xaml::Media::Geometry::StandardFlatteningTolerance;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Geometry::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::GeometryGroup^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapGeometryGroup(::Windows::UI::Xaml::Media::GeometryGroup^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::GeometryGroup^ UnwrapGeometryGroup(Local<Value> value);
  };

  Persistent<FunctionTemplate> GeometryGroup::s_constructorTemplate;

  v8::Local<v8::Value> WrapGeometryGroup(::Windows::UI::Xaml::Media::GeometryGroup^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(GeometryGroup::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::GeometryGroup^ UnwrapGeometryGroup(Local<Value> value) {
     return GeometryGroup::Unwrap<GeometryGroup>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitGeometryGroup(Local<Object> exports) {
    GeometryGroup::Init(exports);
  }

  class GradientBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("GradientBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("spreadMethod").ToLocalChecked(), SpreadMethodGetter, SpreadMethodSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("mappingMode").ToLocalChecked(), MappingModeGetter, MappingModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("gradientStops").ToLocalChecked(), GradientStopsGetter, GradientStopsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("colorInterpolationMode").ToLocalChecked(), ColorInterpolationModeGetter, ColorInterpolationModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("relativeTransform").ToLocalChecked(), RelativeTransformGetter, RelativeTransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("colorInterpolationModeProperty").ToLocalChecked(), ColorInterpolationModePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("gradientStopsProperty").ToLocalChecked(), GradientStopsPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("mappingModeProperty").ToLocalChecked(), MappingModePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("spreadMethodProperty").ToLocalChecked(), SpreadMethodPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("opacityProperty").ToLocalChecked(), OpacityPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("relativeTransformProperty").ToLocalChecked(), RelativeTransformPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("GradientBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      GradientBrush(::Windows::UI::Xaml::Media::GradientBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::GradientBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::GradientBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      GradientBrush *wrapperInstance = new GradientBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::GradientBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::GradientBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapGradientBrush(winRtInstance));
    }





    static void SpreadMethodGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::GradientSpreadMethod result = wrapper->_instance->SpreadMethod;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SpreadMethodSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::GradientSpreadMethod winRtValue = static_cast<::Windows::UI::Xaml::Media::GradientSpreadMethod>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->SpreadMethod = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void MappingModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::BrushMappingMode result = wrapper->_instance->MappingMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void MappingModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::BrushMappingMode winRtValue = static_cast<::Windows::UI::Xaml::Media::BrushMappingMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->MappingMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void GradientStopsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::GradientStopCollection^ result = wrapper->_instance->GradientStops;
        info.GetReturnValue().Set(WrapGradientStopCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void GradientStopsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::GradientStopCollection^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::GradientStopCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->GradientStops = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ColorInterpolationModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::ColorInterpolationMode result = wrapper->_instance->ColorInterpolationMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorInterpolationModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::ColorInterpolationMode winRtValue = static_cast<::Windows::UI::Xaml::Media::ColorInterpolationMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->ColorInterpolationMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RelativeTransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->RelativeTransform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RelativeTransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->RelativeTransform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        double result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void ColorInterpolationModePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::GradientBrush::ColorInterpolationModeProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void GradientStopsPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::GradientBrush::GradientStopsProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void MappingModePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::GradientBrush::MappingModeProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void SpreadMethodPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::GradientBrush::SpreadMethodProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void OpacityPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::OpacityProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RelativeTransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::RelativeTransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::GradientBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapGradientBrush(::Windows::UI::Xaml::Media::GradientBrush^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::GradientBrush^ UnwrapGradientBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> GradientBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapGradientBrush(::Windows::UI::Xaml::Media::GradientBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(GradientBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::GradientBrush^ UnwrapGradientBrush(Local<Value> value) {
     return GradientBrush::Unwrap<GradientBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitGradientBrush(Local<Object> exports) {
    GradientBrush::Init(exports);
  }

  class LineGeometry : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("LineGeometry").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("startPoint").ToLocalChecked(), StartPointGetter, StartPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("endPoint").ToLocalChecked(), EndPointGetter, EndPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("bounds").ToLocalChecked(), BoundsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("endPointProperty").ToLocalChecked(), EndPointPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("startPointProperty").ToLocalChecked(), StartPointPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("empty").ToLocalChecked(), EmptyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("standardFlatteningTolerance").ToLocalChecked(), StandardFlatteningToleranceGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("LineGeometry").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LineGeometry(::Windows::UI::Xaml::Media::LineGeometry^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::LineGeometry^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LineGeometry^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::LineGeometry^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::LineGeometry();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      LineGeometry *wrapperInstance = new LineGeometry(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LineGeometry^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::LineGeometry^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::LineGeometry^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLineGeometry(winRtInstance));
    }





    static void StartPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LineGeometry^>(info.This())) {
        return;
      }

      LineGeometry *wrapper = LineGeometry::Unwrap<LineGeometry>(info.This());

      try  {
        ::Windows::Foundation::Point result = wrapper->_instance->StartPoint;
        info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StartPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsPoint(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LineGeometry^>(info.This())) {
        return;
      }

      LineGeometry *wrapper = LineGeometry::Unwrap<LineGeometry>(info.This());

      try {

        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->StartPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void EndPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LineGeometry^>(info.This())) {
        return;
      }

      LineGeometry *wrapper = LineGeometry::Unwrap<LineGeometry>(info.This());

      try  {
        ::Windows::Foundation::Point result = wrapper->_instance->EndPoint;
        info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EndPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsPoint(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LineGeometry^>(info.This())) {
        return;
      }

      LineGeometry *wrapper = LineGeometry::Unwrap<LineGeometry>(info.This());

      try {

        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->EndPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BoundsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try  {
        ::Windows::Foundation::Rect result = wrapper->_instance->Bounds;
        info.GetReturnValue().Set(NodeRT::Utils::RectToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void EndPointPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::LineGeometry::EndPointProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void StartPointPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::LineGeometry::StartPointProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void EmptyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::Media::Geometry^ result = ::Windows::UI::Xaml::Media::Geometry::Empty;
        info.GetReturnValue().Set(WrapGeometry(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void StandardFlatteningToleranceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        double result = ::Windows::UI::Xaml::Media::Geometry::StandardFlatteningTolerance;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Geometry::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::LineGeometry^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLineGeometry(::Windows::UI::Xaml::Media::LineGeometry^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::LineGeometry^ UnwrapLineGeometry(Local<Value> value);
  };

  Persistent<FunctionTemplate> LineGeometry::s_constructorTemplate;

  v8::Local<v8::Value> WrapLineGeometry(::Windows::UI::Xaml::Media::LineGeometry^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(LineGeometry::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::LineGeometry^ UnwrapLineGeometry(Local<Value> value) {
     return LineGeometry::Unwrap<LineGeometry>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLineGeometry(Local<Object> exports) {
    LineGeometry::Init(exports);
  }

  class LineSegment : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("LineSegment").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("point").ToLocalChecked(), PointGetter, PointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("pointProperty").ToLocalChecked(), PointPropertyGetter);


        Nan::Set(exports, Nan::New<String>("LineSegment").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LineSegment(::Windows::UI::Xaml::Media::LineSegment^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::LineSegment^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LineSegment^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::LineSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::LineSegment();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      LineSegment *wrapperInstance = new LineSegment(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LineSegment^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::LineSegment^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::LineSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLineSegment(winRtInstance));
    }





    static void PointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LineSegment^>(info.This())) {
        return;
      }

      LineSegment *wrapper = LineSegment::Unwrap<LineSegment>(info.This());

      try  {
        ::Windows::Foundation::Point result = wrapper->_instance->Point;
        info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsPoint(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LineSegment^>(info.This())) {
        return;
      }

      LineSegment *wrapper = LineSegment::Unwrap<LineSegment>(info.This());

      try {

        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->Point = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void PointPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::LineSegment::PointProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::LineSegment^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLineSegment(::Windows::UI::Xaml::Media::LineSegment^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::LineSegment^ UnwrapLineSegment(Local<Value> value);
  };

  Persistent<FunctionTemplate> LineSegment::s_constructorTemplate;

  v8::Local<v8::Value> WrapLineSegment(::Windows::UI::Xaml::Media::LineSegment^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(LineSegment::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::LineSegment^ UnwrapLineSegment(Local<Value> value) {
     return LineSegment::Unwrap<LineSegment>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLineSegment(Local<Object> exports) {
    LineSegment::Init(exports);
  }

  class PathGeometry : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("PathGeometry").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("fillRule").ToLocalChecked(), FillRuleGetter, FillRuleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("figures").ToLocalChecked(), FiguresGetter, FiguresSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("bounds").ToLocalChecked(), BoundsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("figuresProperty").ToLocalChecked(), FiguresPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("fillRuleProperty").ToLocalChecked(), FillRulePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("empty").ToLocalChecked(), EmptyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("standardFlatteningTolerance").ToLocalChecked(), StandardFlatteningToleranceGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("PathGeometry").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      PathGeometry(::Windows::UI::Xaml::Media::PathGeometry^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::PathGeometry^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathGeometry^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::PathGeometry^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::PathGeometry();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      PathGeometry *wrapperInstance = new PathGeometry(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathGeometry^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::PathGeometry^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::PathGeometry^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapPathGeometry(winRtInstance));
    }





    static void FillRuleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathGeometry^>(info.This())) {
        return;
      }

      PathGeometry *wrapper = PathGeometry::Unwrap<PathGeometry>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::FillRule result = wrapper->_instance->FillRule;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void FillRuleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathGeometry^>(info.This())) {
        return;
      }

      PathGeometry *wrapper = PathGeometry::Unwrap<PathGeometry>(info.This());

      try {

        ::Windows::UI::Xaml::Media::FillRule winRtValue = static_cast<::Windows::UI::Xaml::Media::FillRule>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->FillRule = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void FiguresGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathGeometry^>(info.This())) {
        return;
      }

      PathGeometry *wrapper = PathGeometry::Unwrap<PathGeometry>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::PathFigureCollection^ result = wrapper->_instance->Figures;
        info.GetReturnValue().Set(WrapPathFigureCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void FiguresSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathFigureCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PathGeometry^>(info.This())) {
        return;
      }

      PathGeometry *wrapper = PathGeometry::Unwrap<PathGeometry>(info.This());

      try {

        ::Windows::UI::Xaml::Media::PathFigureCollection^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::PathFigureCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Figures = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BoundsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Geometry^>(info.This())) {
        return;
      }

      Geometry *wrapper = Geometry::Unwrap<Geometry>(info.This());

      try  {
        ::Windows::Foundation::Rect result = wrapper->_instance->Bounds;
        info.GetReturnValue().Set(NodeRT::Utils::RectToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void FiguresPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PathGeometry::FiguresProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void FillRulePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PathGeometry::FillRuleProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void EmptyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::Media::Geometry^ result = ::Windows::UI::Xaml::Media::Geometry::Empty;
        info.GetReturnValue().Set(WrapGeometry(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void StandardFlatteningToleranceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        double result = ::Windows::UI::Xaml::Media::Geometry::StandardFlatteningTolerance;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Geometry::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::PathGeometry^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapPathGeometry(::Windows::UI::Xaml::Media::PathGeometry^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::PathGeometry^ UnwrapPathGeometry(Local<Value> value);
  };

  Persistent<FunctionTemplate> PathGeometry::s_constructorTemplate;

  v8::Local<v8::Value> WrapPathGeometry(::Windows::UI::Xaml::Media::PathGeometry^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(PathGeometry::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::PathGeometry^ UnwrapPathGeometry(Local<Value> value) {
     return PathGeometry::Unwrap<PathGeometry>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitPathGeometry(Local<Object> exports) {
    PathGeometry::Init(exports);
  }

  class PolyBezierSegment : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("PolyBezierSegment").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("points").ToLocalChecked(), PointsGetter, PointsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("pointsProperty").ToLocalChecked(), PointsPropertyGetter);


        Nan::Set(exports, Nan::New<String>("PolyBezierSegment").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      PolyBezierSegment(::Windows::UI::Xaml::Media::PolyBezierSegment^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::PolyBezierSegment^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PolyBezierSegment^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::PolyBezierSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::PolyBezierSegment();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      PolyBezierSegment *wrapperInstance = new PolyBezierSegment(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PolyBezierSegment^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::PolyBezierSegment^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::PolyBezierSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapPolyBezierSegment(winRtInstance));
    }





    static void PointsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PolyBezierSegment^>(info.This())) {
        return;
      }

      PolyBezierSegment *wrapper = PolyBezierSegment::Unwrap<PolyBezierSegment>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::PointCollection^ result = wrapper->_instance->Points;
        info.GetReturnValue().Set(WrapPointCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PointsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PolyBezierSegment^>(info.This())) {
        return;
      }

      PolyBezierSegment *wrapper = PolyBezierSegment::Unwrap<PolyBezierSegment>(info.This());

      try {

        ::Windows::UI::Xaml::Media::PointCollection^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::PointCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Points = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void PointsPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PolyBezierSegment::PointsProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::PolyBezierSegment^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapPolyBezierSegment(::Windows::UI::Xaml::Media::PolyBezierSegment^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::PolyBezierSegment^ UnwrapPolyBezierSegment(Local<Value> value);
  };

  Persistent<FunctionTemplate> PolyBezierSegment::s_constructorTemplate;

  v8::Local<v8::Value> WrapPolyBezierSegment(::Windows::UI::Xaml::Media::PolyBezierSegment^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(PolyBezierSegment::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::PolyBezierSegment^ UnwrapPolyBezierSegment(Local<Value> value) {
     return PolyBezierSegment::Unwrap<PolyBezierSegment>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitPolyBezierSegment(Local<Object> exports) {
    PolyBezierSegment::Init(exports);
  }

  class PolyLineSegment : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("PolyLineSegment").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("points").ToLocalChecked(), PointsGetter, PointsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("pointsProperty").ToLocalChecked(), PointsPropertyGetter);


        Nan::Set(exports, Nan::New<String>("PolyLineSegment").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      PolyLineSegment(::Windows::UI::Xaml::Media::PolyLineSegment^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::PolyLineSegment^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PolyLineSegment^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::PolyLineSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::PolyLineSegment();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      PolyLineSegment *wrapperInstance = new PolyLineSegment(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PolyLineSegment^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::PolyLineSegment^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::PolyLineSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapPolyLineSegment(winRtInstance));
    }





    static void PointsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PolyLineSegment^>(info.This())) {
        return;
      }

      PolyLineSegment *wrapper = PolyLineSegment::Unwrap<PolyLineSegment>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::PointCollection^ result = wrapper->_instance->Points;
        info.GetReturnValue().Set(WrapPointCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PointsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PolyLineSegment^>(info.This())) {
        return;
      }

      PolyLineSegment *wrapper = PolyLineSegment::Unwrap<PolyLineSegment>(info.This());

      try {

        ::Windows::UI::Xaml::Media::PointCollection^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::PointCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Points = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void PointsPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PolyLineSegment::PointsProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::PolyLineSegment^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapPolyLineSegment(::Windows::UI::Xaml::Media::PolyLineSegment^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::PolyLineSegment^ UnwrapPolyLineSegment(Local<Value> value);
  };

  Persistent<FunctionTemplate> PolyLineSegment::s_constructorTemplate;

  v8::Local<v8::Value> WrapPolyLineSegment(::Windows::UI::Xaml::Media::PolyLineSegment^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(PolyLineSegment::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::PolyLineSegment^ UnwrapPolyLineSegment(Local<Value> value) {
     return PolyLineSegment::Unwrap<PolyLineSegment>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitPolyLineSegment(Local<Object> exports) {
    PolyLineSegment::Init(exports);
  }

  class PolyQuadraticBezierSegment : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("PolyQuadraticBezierSegment").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("points").ToLocalChecked(), PointsGetter, PointsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("pointsProperty").ToLocalChecked(), PointsPropertyGetter);


        Nan::Set(exports, Nan::New<String>("PolyQuadraticBezierSegment").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      PolyQuadraticBezierSegment(::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      PolyQuadraticBezierSegment *wrapperInstance = new PolyQuadraticBezierSegment(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapPolyQuadraticBezierSegment(winRtInstance));
    }





    static void PointsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^>(info.This())) {
        return;
      }

      PolyQuadraticBezierSegment *wrapper = PolyQuadraticBezierSegment::Unwrap<PolyQuadraticBezierSegment>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::PointCollection^ result = wrapper->_instance->Points;
        info.GetReturnValue().Set(WrapPointCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PointsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PointCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^>(info.This())) {
        return;
      }

      PolyQuadraticBezierSegment *wrapper = PolyQuadraticBezierSegment::Unwrap<PolyQuadraticBezierSegment>(info.This());

      try {

        ::Windows::UI::Xaml::Media::PointCollection^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::PointCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Points = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void PointsPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment::PointsProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapPolyQuadraticBezierSegment(::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^ UnwrapPolyQuadraticBezierSegment(Local<Value> value);
  };

  Persistent<FunctionTemplate> PolyQuadraticBezierSegment::s_constructorTemplate;

  v8::Local<v8::Value> WrapPolyQuadraticBezierSegment(::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(PolyQuadraticBezierSegment::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::PolyQuadraticBezierSegment^ UnwrapPolyQuadraticBezierSegment(Local<Value> value) {
     return PolyQuadraticBezierSegment::Unwrap<PolyQuadraticBezierSegment>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitPolyQuadraticBezierSegment(Local<Object> exports) {
    PolyQuadraticBezierSegment::Init(exports);
  }

  class QuadraticBezierSegment : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("QuadraticBezierSegment").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("point2").ToLocalChecked(), Point2Getter, Point2Setter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("point1").ToLocalChecked(), Point1Getter, Point1Setter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("point1Property").ToLocalChecked(), Point1PropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("point2Property").ToLocalChecked(), Point2PropertyGetter);


        Nan::Set(exports, Nan::New<String>("QuadraticBezierSegment").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      QuadraticBezierSegment(::Windows::UI::Xaml::Media::QuadraticBezierSegment^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::QuadraticBezierSegment^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::QuadraticBezierSegment^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::QuadraticBezierSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::QuadraticBezierSegment();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      QuadraticBezierSegment *wrapperInstance = new QuadraticBezierSegment(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::QuadraticBezierSegment^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::QuadraticBezierSegment^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::QuadraticBezierSegment^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapQuadraticBezierSegment(winRtInstance));
    }





    static void Point2Getter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::QuadraticBezierSegment^>(info.This())) {
        return;
      }

      QuadraticBezierSegment *wrapper = QuadraticBezierSegment::Unwrap<QuadraticBezierSegment>(info.This());

      try  {
        ::Windows::Foundation::Point result = wrapper->_instance->Point2;
        info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void Point2Setter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsPoint(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::QuadraticBezierSegment^>(info.This())) {
        return;
      }

      QuadraticBezierSegment *wrapper = QuadraticBezierSegment::Unwrap<QuadraticBezierSegment>(info.This());

      try {

        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->Point2 = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void Point1Getter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::QuadraticBezierSegment^>(info.This())) {
        return;
      }

      QuadraticBezierSegment *wrapper = QuadraticBezierSegment::Unwrap<QuadraticBezierSegment>(info.This());

      try  {
        ::Windows::Foundation::Point result = wrapper->_instance->Point1;
        info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void Point1Setter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsPoint(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::QuadraticBezierSegment^>(info.This())) {
        return;
      }

      QuadraticBezierSegment *wrapper = QuadraticBezierSegment::Unwrap<QuadraticBezierSegment>(info.This());

      try {

        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->Point1 = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void Point1PropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::QuadraticBezierSegment::Point1Property;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void Point2PropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::QuadraticBezierSegment::Point2Property;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::QuadraticBezierSegment^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapQuadraticBezierSegment(::Windows::UI::Xaml::Media::QuadraticBezierSegment^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::QuadraticBezierSegment^ UnwrapQuadraticBezierSegment(Local<Value> value);
  };

  Persistent<FunctionTemplate> QuadraticBezierSegment::s_constructorTemplate;

  v8::Local<v8::Value> WrapQuadraticBezierSegment(::Windows::UI::Xaml::Media::QuadraticBezierSegment^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(QuadraticBezierSegment::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::QuadraticBezierSegment^ UnwrapQuadraticBezierSegment(Local<Value> value) {
     return QuadraticBezierSegment::Unwrap<QuadraticBezierSegment>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitQuadraticBezierSegment(Local<Object> exports) {
    QuadraticBezierSegment::Init(exports);
  }

  class TileBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("TileBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("stretch").ToLocalChecked(), StretchGetter, StretchSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("alignmentY").ToLocalChecked(), AlignmentYGetter, AlignmentYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("alignmentX").ToLocalChecked(), AlignmentXGetter, AlignmentXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("relativeTransform").ToLocalChecked(), RelativeTransformGetter, RelativeTransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("alignmentXProperty").ToLocalChecked(), AlignmentXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("alignmentYProperty").ToLocalChecked(), AlignmentYPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("stretchProperty").ToLocalChecked(), StretchPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("opacityProperty").ToLocalChecked(), OpacityPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("relativeTransformProperty").ToLocalChecked(), RelativeTransformPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("TileBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      TileBrush(::Windows::UI::Xaml::Media::TileBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::TileBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TileBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::TileBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      TileBrush *wrapperInstance = new TileBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TileBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::TileBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::TileBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapTileBrush(winRtInstance));
    }





    static void StretchGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TileBrush^>(info.This())) {
        return;
      }

      TileBrush *wrapper = TileBrush::Unwrap<TileBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Stretch result = wrapper->_instance->Stretch;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StretchSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TileBrush^>(info.This())) {
        return;
      }

      TileBrush *wrapper = TileBrush::Unwrap<TileBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Stretch winRtValue = static_cast<::Windows::UI::Xaml::Media::Stretch>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->Stretch = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AlignmentYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TileBrush^>(info.This())) {
        return;
      }

      TileBrush *wrapper = TileBrush::Unwrap<TileBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::AlignmentY result = wrapper->_instance->AlignmentY;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AlignmentYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TileBrush^>(info.This())) {
        return;
      }

      TileBrush *wrapper = TileBrush::Unwrap<TileBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::AlignmentY winRtValue = static_cast<::Windows::UI::Xaml::Media::AlignmentY>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->AlignmentY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AlignmentXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TileBrush^>(info.This())) {
        return;
      }

      TileBrush *wrapper = TileBrush::Unwrap<TileBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::AlignmentX result = wrapper->_instance->AlignmentX;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AlignmentXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TileBrush^>(info.This())) {
        return;
      }

      TileBrush *wrapper = TileBrush::Unwrap<TileBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::AlignmentX winRtValue = static_cast<::Windows::UI::Xaml::Media::AlignmentX>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->AlignmentX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RelativeTransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->RelativeTransform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RelativeTransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->RelativeTransform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        double result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void AlignmentXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::TileBrush::AlignmentXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void AlignmentYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::TileBrush::AlignmentYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void StretchPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::TileBrush::StretchProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void OpacityPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::OpacityProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RelativeTransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::RelativeTransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::TileBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapTileBrush(::Windows::UI::Xaml::Media::TileBrush^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::TileBrush^ UnwrapTileBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> TileBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapTileBrush(::Windows::UI::Xaml::Media::TileBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(TileBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::TileBrush^ UnwrapTileBrush(Local<Value> value) {
     return TileBrush::Unwrap<TileBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitTileBrush(Local<Object> exports) {
    TileBrush::Init(exports);
  }

  class XamlCompositionBrushBase : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("XamlCompositionBrushBase").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "onConnected", OnConnected);
            Nan::SetPrototypeMethod(localRef, "onDisconnected", OnDisconnected);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("fallbackColor").ToLocalChecked(), FallbackColorGetter, FallbackColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("relativeTransform").ToLocalChecked(), RelativeTransformGetter, RelativeTransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("fallbackColorProperty").ToLocalChecked(), FallbackColorPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("opacityProperty").ToLocalChecked(), OpacityPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("relativeTransformProperty").ToLocalChecked(), RelativeTransformPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("XamlCompositionBrushBase").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      XamlCompositionBrushBase(::Windows::UI::Xaml::Media::XamlCompositionBrushBase^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::XamlCompositionBrushBase^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlCompositionBrushBase^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::XamlCompositionBrushBase^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      XamlCompositionBrushBase *wrapperInstance = new XamlCompositionBrushBase(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlCompositionBrushBase^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::XamlCompositionBrushBase^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::XamlCompositionBrushBase^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapXamlCompositionBrushBase(winRtInstance));
    }


    static void OnConnected(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlCompositionBrushBase^>(info.This())) {
        return;
      }

      XamlCompositionBrushBase *wrapper = XamlCompositionBrushBase::Unwrap<XamlCompositionBrushBase>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->OnConnected();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void OnDisconnected(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlCompositionBrushBase^>(info.This())) {
        return;
      }

      XamlCompositionBrushBase *wrapper = XamlCompositionBrushBase::Unwrap<XamlCompositionBrushBase>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->OnDisconnected();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void FallbackColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlCompositionBrushBase^>(info.This())) {
        return;
      }

      XamlCompositionBrushBase *wrapper = XamlCompositionBrushBase::Unwrap<XamlCompositionBrushBase>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->FallbackColor;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void FallbackColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlCompositionBrushBase^>(info.This())) {
        return;
      }

      XamlCompositionBrushBase *wrapper = XamlCompositionBrushBase::Unwrap<XamlCompositionBrushBase>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->FallbackColor = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RelativeTransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->RelativeTransform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RelativeTransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->RelativeTransform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        double result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void FallbackColorPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::XamlCompositionBrushBase::FallbackColorProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void OpacityPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::OpacityProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RelativeTransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::RelativeTransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::XamlCompositionBrushBase^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapXamlCompositionBrushBase(::Windows::UI::Xaml::Media::XamlCompositionBrushBase^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::XamlCompositionBrushBase^ UnwrapXamlCompositionBrushBase(Local<Value> value);
  };

  Persistent<FunctionTemplate> XamlCompositionBrushBase::s_constructorTemplate;

  v8::Local<v8::Value> WrapXamlCompositionBrushBase(::Windows::UI::Xaml::Media::XamlCompositionBrushBase^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(XamlCompositionBrushBase::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::XamlCompositionBrushBase^ UnwrapXamlCompositionBrushBase(Local<Value> value) {
     return XamlCompositionBrushBase::Unwrap<XamlCompositionBrushBase>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitXamlCompositionBrushBase(Local<Object> exports) {
    XamlCompositionBrushBase::Init(exports);
  }

  class AcrylicBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("AcrylicBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("tintTransitionDuration").ToLocalChecked(), TintTransitionDurationGetter, TintTransitionDurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("tintOpacity").ToLocalChecked(), TintOpacityGetter, TintOpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("tintColor").ToLocalChecked(), TintColorGetter, TintColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("backgroundSource").ToLocalChecked(), BackgroundSourceGetter, BackgroundSourceSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("alwaysUseFallback").ToLocalChecked(), AlwaysUseFallbackGetter, AlwaysUseFallbackSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("fallbackColor").ToLocalChecked(), FallbackColorGetter, FallbackColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("relativeTransform").ToLocalChecked(), RelativeTransformGetter, RelativeTransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("alwaysUseFallbackProperty").ToLocalChecked(), AlwaysUseFallbackPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("backgroundSourceProperty").ToLocalChecked(), BackgroundSourcePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("tintColorProperty").ToLocalChecked(), TintColorPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("tintOpacityProperty").ToLocalChecked(), TintOpacityPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("tintTransitionDurationProperty").ToLocalChecked(), TintTransitionDurationPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("fallbackColorProperty").ToLocalChecked(), FallbackColorPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("opacityProperty").ToLocalChecked(), OpacityPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("relativeTransformProperty").ToLocalChecked(), RelativeTransformPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("AcrylicBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      AcrylicBrush(::Windows::UI::Xaml::Media::AcrylicBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::AcrylicBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::AcrylicBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::AcrylicBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::AcrylicBrush();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      AcrylicBrush *wrapperInstance = new AcrylicBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::AcrylicBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::AcrylicBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::AcrylicBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapAcrylicBrush(winRtInstance));
    }





    static void TintTransitionDurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::AcrylicBrush^>(info.This())) {
        return;
      }

      AcrylicBrush *wrapper = AcrylicBrush::Unwrap<AcrylicBrush>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->TintTransitionDuration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TintTransitionDurationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::AcrylicBrush^>(info.This())) {
        return;
      }

      AcrylicBrush *wrapper = AcrylicBrush::Unwrap<AcrylicBrush>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->TintTransitionDuration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TintOpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::AcrylicBrush^>(info.This())) {
        return;
      }

      AcrylicBrush *wrapper = AcrylicBrush::Unwrap<AcrylicBrush>(info.This());

      try  {
        double result = wrapper->_instance->TintOpacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TintOpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::AcrylicBrush^>(info.This())) {
        return;
      }

      AcrylicBrush *wrapper = AcrylicBrush::Unwrap<AcrylicBrush>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->TintOpacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TintColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::AcrylicBrush^>(info.This())) {
        return;
      }

      AcrylicBrush *wrapper = AcrylicBrush::Unwrap<AcrylicBrush>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->TintColor;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TintColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::AcrylicBrush^>(info.This())) {
        return;
      }

      AcrylicBrush *wrapper = AcrylicBrush::Unwrap<AcrylicBrush>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->TintColor = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BackgroundSourceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::AcrylicBrush^>(info.This())) {
        return;
      }

      AcrylicBrush *wrapper = AcrylicBrush::Unwrap<AcrylicBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::AcrylicBackgroundSource result = wrapper->_instance->BackgroundSource;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BackgroundSourceSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::AcrylicBrush^>(info.This())) {
        return;
      }

      AcrylicBrush *wrapper = AcrylicBrush::Unwrap<AcrylicBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::AcrylicBackgroundSource winRtValue = static_cast<::Windows::UI::Xaml::Media::AcrylicBackgroundSource>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->BackgroundSource = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AlwaysUseFallbackGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::AcrylicBrush^>(info.This())) {
        return;
      }

      AcrylicBrush *wrapper = AcrylicBrush::Unwrap<AcrylicBrush>(info.This());

      try  {
        bool result = wrapper->_instance->AlwaysUseFallback;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AlwaysUseFallbackSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::AcrylicBrush^>(info.This())) {
        return;
      }

      AcrylicBrush *wrapper = AcrylicBrush::Unwrap<AcrylicBrush>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->AlwaysUseFallback = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void FallbackColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlCompositionBrushBase^>(info.This())) {
        return;
      }

      XamlCompositionBrushBase *wrapper = XamlCompositionBrushBase::Unwrap<XamlCompositionBrushBase>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->FallbackColor;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void FallbackColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlCompositionBrushBase^>(info.This())) {
        return;
      }

      XamlCompositionBrushBase *wrapper = XamlCompositionBrushBase::Unwrap<XamlCompositionBrushBase>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->FallbackColor = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RelativeTransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->RelativeTransform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RelativeTransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->RelativeTransform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        double result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void AlwaysUseFallbackPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::AcrylicBrush::AlwaysUseFallbackProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void BackgroundSourcePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::AcrylicBrush::BackgroundSourceProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TintColorPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::AcrylicBrush::TintColorProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TintOpacityPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::AcrylicBrush::TintOpacityProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TintTransitionDurationPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::AcrylicBrush::TintTransitionDurationProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void FallbackColorPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::XamlCompositionBrushBase::FallbackColorProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void OpacityPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::OpacityProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RelativeTransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::RelativeTransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::AcrylicBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapAcrylicBrush(::Windows::UI::Xaml::Media::AcrylicBrush^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::AcrylicBrush^ UnwrapAcrylicBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> AcrylicBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapAcrylicBrush(::Windows::UI::Xaml::Media::AcrylicBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(AcrylicBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::AcrylicBrush^ UnwrapAcrylicBrush(Local<Value> value) {
     return AcrylicBrush::Unwrap<AcrylicBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitAcrylicBrush(Local<Object> exports) {
    AcrylicBrush::Init(exports);
  }

  class RevealBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("RevealBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("targetTheme").ToLocalChecked(), TargetThemeGetter, TargetThemeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("color").ToLocalChecked(), ColorGetter, ColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("alwaysUseFallback").ToLocalChecked(), AlwaysUseFallbackGetter, AlwaysUseFallbackSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("fallbackColor").ToLocalChecked(), FallbackColorGetter, FallbackColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("relativeTransform").ToLocalChecked(), RelativeTransformGetter, RelativeTransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetMethod(constructor, "setState", SetState);
        Nan::SetMethod(constructor, "getState", GetState);
        Nan::SetAccessor(constructor, Nan::New<String>("alwaysUseFallbackProperty").ToLocalChecked(), AlwaysUseFallbackPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("colorProperty").ToLocalChecked(), ColorPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("stateProperty").ToLocalChecked(), StatePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("targetThemeProperty").ToLocalChecked(), TargetThemePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("fallbackColorProperty").ToLocalChecked(), FallbackColorPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("opacityProperty").ToLocalChecked(), OpacityPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("relativeTransformProperty").ToLocalChecked(), RelativeTransformPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("RevealBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      RevealBrush(::Windows::UI::Xaml::Media::RevealBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::RevealBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::RevealBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      RevealBrush *wrapperInstance = new RevealBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::RevealBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::RevealBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapRevealBrush(winRtInstance));
    }





    static void SetState(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::UIElement^>(info[0])
        && info[1]->IsInt32())
      {
        try
        {
          ::Windows::UI::Xaml::UIElement^ arg0 = dynamic_cast<::Windows::UI::Xaml::UIElement^>(NodeRT::Utils::GetObjectInstance(info[0]));
          ::Windows::UI::Xaml::Media::RevealBrushState arg1 = static_cast<::Windows::UI::Xaml::Media::RevealBrushState>(Nan::To<int32_t>(info[1]).FromMaybe(0));
          
          ::Windows::UI::Xaml::Media::RevealBrush::SetState(arg0, arg1);
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void GetState(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::UIElement^>(info[0]))
      {
        try
        {
          ::Windows::UI::Xaml::UIElement^ arg0 = dynamic_cast<::Windows::UI::Xaml::UIElement^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          ::Windows::UI::Xaml::Media::RevealBrushState result;
          result = ::Windows::UI::Xaml::Media::RevealBrush::GetState(arg0);
          info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void TargetThemeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::ApplicationTheme result = wrapper->_instance->TargetTheme;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TargetThemeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try {

        ::Windows::UI::Xaml::ApplicationTheme winRtValue = static_cast<::Windows::UI::Xaml::ApplicationTheme>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->TargetTheme = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->Color;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->Color = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AlwaysUseFallbackGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try  {
        bool result = wrapper->_instance->AlwaysUseFallback;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AlwaysUseFallbackSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->AlwaysUseFallback = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void FallbackColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlCompositionBrushBase^>(info.This())) {
        return;
      }

      XamlCompositionBrushBase *wrapper = XamlCompositionBrushBase::Unwrap<XamlCompositionBrushBase>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->FallbackColor;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void FallbackColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlCompositionBrushBase^>(info.This())) {
        return;
      }

      XamlCompositionBrushBase *wrapper = XamlCompositionBrushBase::Unwrap<XamlCompositionBrushBase>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->FallbackColor = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RelativeTransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->RelativeTransform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RelativeTransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->RelativeTransform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        double result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void AlwaysUseFallbackPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RevealBrush::AlwaysUseFallbackProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void ColorPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RevealBrush::ColorProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void StatePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RevealBrush::StateProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TargetThemePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RevealBrush::TargetThemeProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void FallbackColorPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::XamlCompositionBrushBase::FallbackColorProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void OpacityPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::OpacityProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RelativeTransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::RelativeTransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::RevealBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapRevealBrush(::Windows::UI::Xaml::Media::RevealBrush^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::RevealBrush^ UnwrapRevealBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> RevealBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapRevealBrush(::Windows::UI::Xaml::Media::RevealBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(RevealBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::RevealBrush^ UnwrapRevealBrush(Local<Value> value) {
     return RevealBrush::Unwrap<RevealBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitRevealBrush(Local<Object> exports) {
    RevealBrush::Init(exports);
  }

  class RevealBorderBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("RevealBorderBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("targetTheme").ToLocalChecked(), TargetThemeGetter, TargetThemeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("color").ToLocalChecked(), ColorGetter, ColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("alwaysUseFallback").ToLocalChecked(), AlwaysUseFallbackGetter, AlwaysUseFallbackSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("fallbackColor").ToLocalChecked(), FallbackColorGetter, FallbackColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("relativeTransform").ToLocalChecked(), RelativeTransformGetter, RelativeTransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("alwaysUseFallbackProperty").ToLocalChecked(), AlwaysUseFallbackPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("colorProperty").ToLocalChecked(), ColorPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("stateProperty").ToLocalChecked(), StatePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("targetThemeProperty").ToLocalChecked(), TargetThemePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("fallbackColorProperty").ToLocalChecked(), FallbackColorPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("opacityProperty").ToLocalChecked(), OpacityPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("relativeTransformProperty").ToLocalChecked(), RelativeTransformPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("RevealBorderBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      RevealBorderBrush(::Windows::UI::Xaml::Media::RevealBorderBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::RevealBorderBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBorderBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::RevealBorderBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::RevealBorderBrush();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      RevealBorderBrush *wrapperInstance = new RevealBorderBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBorderBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::RevealBorderBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::RevealBorderBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapRevealBorderBrush(winRtInstance));
    }





    static void TargetThemeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::ApplicationTheme result = wrapper->_instance->TargetTheme;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TargetThemeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try {

        ::Windows::UI::Xaml::ApplicationTheme winRtValue = static_cast<::Windows::UI::Xaml::ApplicationTheme>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->TargetTheme = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->Color;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->Color = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AlwaysUseFallbackGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try  {
        bool result = wrapper->_instance->AlwaysUseFallback;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AlwaysUseFallbackSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->AlwaysUseFallback = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void FallbackColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlCompositionBrushBase^>(info.This())) {
        return;
      }

      XamlCompositionBrushBase *wrapper = XamlCompositionBrushBase::Unwrap<XamlCompositionBrushBase>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->FallbackColor;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void FallbackColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlCompositionBrushBase^>(info.This())) {
        return;
      }

      XamlCompositionBrushBase *wrapper = XamlCompositionBrushBase::Unwrap<XamlCompositionBrushBase>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->FallbackColor = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RelativeTransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->RelativeTransform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RelativeTransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->RelativeTransform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        double result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void AlwaysUseFallbackPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RevealBrush::AlwaysUseFallbackProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void ColorPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RevealBrush::ColorProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void StatePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RevealBrush::StateProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TargetThemePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RevealBrush::TargetThemeProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void FallbackColorPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::XamlCompositionBrushBase::FallbackColorProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void OpacityPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::OpacityProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RelativeTransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::RelativeTransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::RevealBorderBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapRevealBorderBrush(::Windows::UI::Xaml::Media::RevealBorderBrush^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::RevealBorderBrush^ UnwrapRevealBorderBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> RevealBorderBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapRevealBorderBrush(::Windows::UI::Xaml::Media::RevealBorderBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(RevealBorderBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::RevealBorderBrush^ UnwrapRevealBorderBrush(Local<Value> value) {
     return RevealBorderBrush::Unwrap<RevealBorderBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitRevealBorderBrush(Local<Object> exports) {
    RevealBorderBrush::Init(exports);
  }

  class RevealBackgroundBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("RevealBackgroundBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("targetTheme").ToLocalChecked(), TargetThemeGetter, TargetThemeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("color").ToLocalChecked(), ColorGetter, ColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("alwaysUseFallback").ToLocalChecked(), AlwaysUseFallbackGetter, AlwaysUseFallbackSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("fallbackColor").ToLocalChecked(), FallbackColorGetter, FallbackColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("relativeTransform").ToLocalChecked(), RelativeTransformGetter, RelativeTransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("alwaysUseFallbackProperty").ToLocalChecked(), AlwaysUseFallbackPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("colorProperty").ToLocalChecked(), ColorPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("stateProperty").ToLocalChecked(), StatePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("targetThemeProperty").ToLocalChecked(), TargetThemePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("fallbackColorProperty").ToLocalChecked(), FallbackColorPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("opacityProperty").ToLocalChecked(), OpacityPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("relativeTransformProperty").ToLocalChecked(), RelativeTransformPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("RevealBackgroundBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      RevealBackgroundBrush(::Windows::UI::Xaml::Media::RevealBackgroundBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::RevealBackgroundBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBackgroundBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::RevealBackgroundBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::RevealBackgroundBrush();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      RevealBackgroundBrush *wrapperInstance = new RevealBackgroundBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBackgroundBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::RevealBackgroundBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::RevealBackgroundBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapRevealBackgroundBrush(winRtInstance));
    }





    static void TargetThemeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::ApplicationTheme result = wrapper->_instance->TargetTheme;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TargetThemeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try {

        ::Windows::UI::Xaml::ApplicationTheme winRtValue = static_cast<::Windows::UI::Xaml::ApplicationTheme>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->TargetTheme = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->Color;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->Color = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AlwaysUseFallbackGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try  {
        bool result = wrapper->_instance->AlwaysUseFallback;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AlwaysUseFallbackSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::RevealBrush^>(info.This())) {
        return;
      }

      RevealBrush *wrapper = RevealBrush::Unwrap<RevealBrush>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->AlwaysUseFallback = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void FallbackColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlCompositionBrushBase^>(info.This())) {
        return;
      }

      XamlCompositionBrushBase *wrapper = XamlCompositionBrushBase::Unwrap<XamlCompositionBrushBase>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->FallbackColor;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void FallbackColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::XamlCompositionBrushBase^>(info.This())) {
        return;
      }

      XamlCompositionBrushBase *wrapper = XamlCompositionBrushBase::Unwrap<XamlCompositionBrushBase>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->FallbackColor = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RelativeTransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->RelativeTransform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RelativeTransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->RelativeTransform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        double result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void AlwaysUseFallbackPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RevealBrush::AlwaysUseFallbackProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void ColorPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RevealBrush::ColorProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void StatePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RevealBrush::StateProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TargetThemePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::RevealBrush::TargetThemeProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void FallbackColorPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::XamlCompositionBrushBase::FallbackColorProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void OpacityPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::OpacityProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RelativeTransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::RelativeTransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::RevealBackgroundBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapRevealBackgroundBrush(::Windows::UI::Xaml::Media::RevealBackgroundBrush^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::RevealBackgroundBrush^ UnwrapRevealBackgroundBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> RevealBackgroundBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapRevealBackgroundBrush(::Windows::UI::Xaml::Media::RevealBackgroundBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(RevealBackgroundBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::RevealBackgroundBrush^ UnwrapRevealBackgroundBrush(Local<Value> value) {
     return RevealBackgroundBrush::Unwrap<RevealBackgroundBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitRevealBackgroundBrush(Local<Object> exports) {
    RevealBackgroundBrush::Init(exports);
  }

  class ImageBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("ImageBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);




          
          Nan::SetPrototypeMethod(localRef,"addListener", AddListener);
          Nan::SetPrototypeMethod(localRef,"on", AddListener);
          Nan::SetPrototypeMethod(localRef,"removeListener", RemoveListener);
          Nan::SetPrototypeMethod(localRef, "off", RemoveListener);

          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("imageSource").ToLocalChecked(), ImageSourceGetter, ImageSourceSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("stretch").ToLocalChecked(), StretchGetter, StretchSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("alignmentY").ToLocalChecked(), AlignmentYGetter, AlignmentYSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("alignmentX").ToLocalChecked(), AlignmentXGetter, AlignmentXSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("relativeTransform").ToLocalChecked(), RelativeTransformGetter, RelativeTransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("imageSourceProperty").ToLocalChecked(), ImageSourcePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("alignmentXProperty").ToLocalChecked(), AlignmentXPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("alignmentYProperty").ToLocalChecked(), AlignmentYPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("stretchProperty").ToLocalChecked(), StretchPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("opacityProperty").ToLocalChecked(), OpacityPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("relativeTransformProperty").ToLocalChecked(), RelativeTransformPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("ImageBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      ImageBrush(::Windows::UI::Xaml::Media::ImageBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::ImageBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ImageBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::ImageBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::ImageBrush();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      ImageBrush *wrapperInstance = new ImageBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ImageBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::ImageBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::ImageBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapImageBrush(winRtInstance));
    }





    static void ImageSourceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ImageBrush^>(info.This())) {
        return;
      }

      ImageBrush *wrapper = ImageBrush::Unwrap<ImageBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::ImageSource^ result = wrapper->_instance->ImageSource;
        info.GetReturnValue().Set(WrapImageSource(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImageSourceSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ImageSource^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ImageBrush^>(info.This())) {
        return;
      }

      ImageBrush *wrapper = ImageBrush::Unwrap<ImageBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::ImageSource^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::ImageSource^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImageSource = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void StretchGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TileBrush^>(info.This())) {
        return;
      }

      TileBrush *wrapper = TileBrush::Unwrap<TileBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Stretch result = wrapper->_instance->Stretch;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StretchSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TileBrush^>(info.This())) {
        return;
      }

      TileBrush *wrapper = TileBrush::Unwrap<TileBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Stretch winRtValue = static_cast<::Windows::UI::Xaml::Media::Stretch>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->Stretch = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AlignmentYGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TileBrush^>(info.This())) {
        return;
      }

      TileBrush *wrapper = TileBrush::Unwrap<TileBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::AlignmentY result = wrapper->_instance->AlignmentY;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AlignmentYSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TileBrush^>(info.This())) {
        return;
      }

      TileBrush *wrapper = TileBrush::Unwrap<TileBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::AlignmentY winRtValue = static_cast<::Windows::UI::Xaml::Media::AlignmentY>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->AlignmentY = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AlignmentXGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TileBrush^>(info.This())) {
        return;
      }

      TileBrush *wrapper = TileBrush::Unwrap<TileBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::AlignmentX result = wrapper->_instance->AlignmentX;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AlignmentXSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::TileBrush^>(info.This())) {
        return;
      }

      TileBrush *wrapper = TileBrush::Unwrap<TileBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::AlignmentX winRtValue = static_cast<::Windows::UI::Xaml::Media::AlignmentX>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->AlignmentX = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RelativeTransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->RelativeTransform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RelativeTransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->RelativeTransform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        double result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void ImageSourcePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::ImageBrush::ImageSourceProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void AlignmentXPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::TileBrush::AlignmentXProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void AlignmentYPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::TileBrush::AlignmentYProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void StretchPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::TileBrush::StretchProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void OpacityPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::OpacityProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RelativeTransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::RelativeTransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void AddListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected arguments are eventName(string),callback(function)")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      Local<Function> callback = info[1].As<Function>();

      ::Windows::Foundation::EventRegistrationToken registrationToken;
      if (NodeRT::Utils::CaseInsenstiveEquals(L"imageFailed", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ImageBrush^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        ImageBrush *wrapper = ImageBrush::Unwrap<ImageBrush>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->ImageFailed::add(
            ref new ::Windows::UI::Xaml::ExceptionRoutedEventHandler(
            [callbackObjPtr](::Platform::Object^ arg0, ::Windows::UI::Xaml::ExceptionRoutedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = CreateOpaqueWrapper(arg0);
                  wrappedArg1 = NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "ExceptionRoutedEventArgs", arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"imageOpened", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ImageBrush^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        ImageBrush *wrapper = ImageBrush::Unwrap<ImageBrush>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->ImageOpened::add(
            ref new ::Windows::UI::Xaml::RoutedEventHandler(
            [callbackObjPtr](::Platform::Object^ arg0, ::Windows::UI::Xaml::RoutedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = CreateOpaqueWrapper(arg0);
                  wrappedArg1 = NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "RoutedEventArgs", arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
 else  {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Value> tokenMapVal = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());
      Local<Object> tokenMap;

      if (tokenMapVal.IsEmpty() || Nan::Equals(tokenMapVal, Undefined()).FromMaybe(false)) {
        tokenMap = Nan::New<Object>();
        NodeRT::Utils::SetHiddenValueWithObject(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked(), tokenMap);
      } else {
        tokenMap = Nan::To<Object>(tokenMapVal).ToLocalChecked();
      }

      Nan::Set(tokenMap, info[0], CreateOpaqueWrapper(::Windows::Foundation::PropertyValue::CreateInt64(registrationToken.Value)));
    }

    static void RemoveListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected a string and a callback")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      if ((!NodeRT::Utils::CaseInsenstiveEquals(L"imageFailed", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"imageOpened", str))) {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Function> callback = info[1].As<Function>();
      Local<Value> tokenMap = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());

      if (tokenMap.IsEmpty() || Nan::Equals(tokenMap, Undefined()).FromMaybe(false)) {
        return;
      }

      Local<Value> opaqueWrapperObj =  Nan::Get(Nan::To<Object>(tokenMap).ToLocalChecked(), info[0]).ToLocalChecked();

      if (opaqueWrapperObj.IsEmpty() || Nan::Equals(opaqueWrapperObj,Undefined()).FromMaybe(false)) {
        return;
      }

      OpaqueWrapper *opaqueWrapper = OpaqueWrapper::Unwrap<OpaqueWrapper>(opaqueWrapperObj.As<Object>());

      long long tokenValue = (long long) opaqueWrapper->GetObjectInstance();
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      registrationToken.Value = tokenValue;

      try  {
        if (NodeRT::Utils::CaseInsenstiveEquals(L"imageFailed", str)) {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ImageBrush^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          ImageBrush *wrapper = ImageBrush::Unwrap<ImageBrush>(info.This());
          wrapper->_instance->ImageFailed::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"imageOpened", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::ImageBrush^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          ImageBrush *wrapper = ImageBrush::Unwrap<ImageBrush>(info.This());
          wrapper->_instance->ImageOpened::remove(registrationToken);
        }
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }

      Nan::Delete(Nan::To<Object>(tokenMap).ToLocalChecked(), Nan::To<String>(info[0]).ToLocalChecked());
    }
    private:
      ::Windows::UI::Xaml::Media::ImageBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapImageBrush(::Windows::UI::Xaml::Media::ImageBrush^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::ImageBrush^ UnwrapImageBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> ImageBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapImageBrush(::Windows::UI::Xaml::Media::ImageBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(ImageBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::ImageBrush^ UnwrapImageBrush(Local<Value> value) {
     return ImageBrush::Unwrap<ImageBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitImageBrush(Local<Object> exports) {
    ImageBrush::Init(exports);
  }

  class LinearGradientBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("LinearGradientBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("startPoint").ToLocalChecked(), StartPointGetter, StartPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("endPoint").ToLocalChecked(), EndPointGetter, EndPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("spreadMethod").ToLocalChecked(), SpreadMethodGetter, SpreadMethodSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("mappingMode").ToLocalChecked(), MappingModeGetter, MappingModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("gradientStops").ToLocalChecked(), GradientStopsGetter, GradientStopsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("colorInterpolationMode").ToLocalChecked(), ColorInterpolationModeGetter, ColorInterpolationModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transform").ToLocalChecked(), TransformGetter, TransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("relativeTransform").ToLocalChecked(), RelativeTransformGetter, RelativeTransformSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetAccessor(constructor, Nan::New<String>("endPointProperty").ToLocalChecked(), EndPointPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("startPointProperty").ToLocalChecked(), StartPointPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("colorInterpolationModeProperty").ToLocalChecked(), ColorInterpolationModePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("gradientStopsProperty").ToLocalChecked(), GradientStopsPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("mappingModeProperty").ToLocalChecked(), MappingModePropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("spreadMethodProperty").ToLocalChecked(), SpreadMethodPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("opacityProperty").ToLocalChecked(), OpacityPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("relativeTransformProperty").ToLocalChecked(), RelativeTransformPropertyGetter);
        Nan::SetAccessor(constructor, Nan::New<String>("transformProperty").ToLocalChecked(), TransformPropertyGetter);


        Nan::Set(exports, Nan::New<String>("LinearGradientBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LinearGradientBrush(::Windows::UI::Xaml::Media::LinearGradientBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Xaml::Media::LinearGradientBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LinearGradientBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Xaml::Media::LinearGradientBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(info[0])
        && info[1]->IsNumber())
      {
        try {
          ::Windows::UI::Xaml::Media::GradientStopCollection^ arg0 = UnwrapGradientStopCollection(info[0]);
          double arg1 = Nan::To<double>(info[1]).FromMaybe(0.0);
          
          winRtInstance = ref new ::Windows::UI::Xaml::Media::LinearGradientBrush(arg0,arg1);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Xaml::Media::LinearGradientBrush();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      LinearGradientBrush *wrapperInstance = new LinearGradientBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LinearGradientBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Xaml::Media::LinearGradientBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Xaml::Media::LinearGradientBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLinearGradientBrush(winRtInstance));
    }





    static void StartPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LinearGradientBrush^>(info.This())) {
        return;
      }

      LinearGradientBrush *wrapper = LinearGradientBrush::Unwrap<LinearGradientBrush>(info.This());

      try  {
        ::Windows::Foundation::Point result = wrapper->_instance->StartPoint;
        info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StartPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsPoint(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LinearGradientBrush^>(info.This())) {
        return;
      }

      LinearGradientBrush *wrapper = LinearGradientBrush::Unwrap<LinearGradientBrush>(info.This());

      try {

        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->StartPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void EndPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LinearGradientBrush^>(info.This())) {
        return;
      }

      LinearGradientBrush *wrapper = LinearGradientBrush::Unwrap<LinearGradientBrush>(info.This());

      try  {
        ::Windows::Foundation::Point result = wrapper->_instance->EndPoint;
        info.GetReturnValue().Set(NodeRT::Utils::PointToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EndPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsPoint(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::LinearGradientBrush^>(info.This())) {
        return;
      }

      LinearGradientBrush *wrapper = LinearGradientBrush::Unwrap<LinearGradientBrush>(info.This());

      try {

        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->EndPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void SpreadMethodGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::GradientSpreadMethod result = wrapper->_instance->SpreadMethod;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SpreadMethodSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::GradientSpreadMethod winRtValue = static_cast<::Windows::UI::Xaml::Media::GradientSpreadMethod>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->SpreadMethod = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void MappingModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::BrushMappingMode result = wrapper->_instance->MappingMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void MappingModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::BrushMappingMode winRtValue = static_cast<::Windows::UI::Xaml::Media::BrushMappingMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->MappingMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void GradientStopsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::GradientStopCollection^ result = wrapper->_instance->GradientStops;
        info.GetReturnValue().Set(WrapGradientStopCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void GradientStopsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientStopCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::GradientStopCollection^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::GradientStopCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->GradientStops = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ColorInterpolationModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::ColorInterpolationMode result = wrapper->_instance->ColorInterpolationMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorInterpolationModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::GradientBrush^>(info.This())) {
        return;
      }

      GradientBrush *wrapper = GradientBrush::Unwrap<GradientBrush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::ColorInterpolationMode winRtValue = static_cast<::Windows::UI::Xaml::Media::ColorInterpolationMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->ColorInterpolationMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->Transform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Transform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RelativeTransformGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        ::Windows::UI::Xaml::Media::Transform^ result = wrapper->_instance->RelativeTransform;
        info.GetReturnValue().Set(WrapTransform(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RelativeTransformSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Transform^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        ::Windows::UI::Xaml::Media::Transform^ winRtValue = dynamic_cast<::Windows::UI::Xaml::Media::Transform^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->RelativeTransform = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try  {
        double result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::Media::Brush^>(info.This())) {
        return;
      }

      Brush *wrapper = Brush::Unwrap<Brush>(info.This());

      try {

        double winRtValue = Nan::To<double>(value).FromMaybe(0.0);

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Xaml::DependencyObject^>(info.This())) {
        return;
      }

      DependencyObject *wrapper = DependencyObject::Unwrap<DependencyObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    static void EndPointPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::LinearGradientBrush::EndPointProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void StartPointPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::LinearGradientBrush::StartPointProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void ColorInterpolationModePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::GradientBrush::ColorInterpolationModeProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void GradientStopsPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::GradientBrush::GradientStopsProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void MappingModePropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::GradientBrush::MappingModeProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void SpreadMethodPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::GradientBrush::SpreadMethodProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void OpacityPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::OpacityProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void RelativeTransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::RelativeTransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    static void TransformPropertyGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      try
      {
        ::Windows::UI::Xaml::DependencyProperty^ result = ::Windows::UI::Xaml::Media::Brush::TransformProperty;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Xaml", "DependencyProperty", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      

    private:
      ::Windows::UI::Xaml::Media::LinearGradientBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLinearGradientBrush(::Windows::UI::Xaml::Media::LinearGradientBrush^ wintRtInstance);
      friend ::Windows::UI::Xaml::Media::LinearGradientBrush^ UnwrapLinearGradientBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> LinearGradientBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapLinearGradientBrush(::Windows::UI::Xaml::Media::LinearGradientBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(LinearGradientBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Xaml::Media::LinearGradientBrush^ UnwrapLinearGradientBrush(Local<Value> value) {
     return LinearGradientBrush::Unwrap<LinearGradientBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLinearGradientBrush(Local<Object> exports) {
    LinearGradientBrush::Init(exports);
  }


} } } } } 

NAN_MODULE_INIT(init) {
  // We ignore failures for now since it probably means that
  // the initialization already happened for STA, and that's cool

  CoInitializeEx(nullptr, COINIT_MULTITHREADED);

  /*
  if (FAILED(CoInitializeEx(nullptr, COINIT_MULTITHREADED))) {
    Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"error in CoInitializeEx()")));
    return;
  }
  */

      NodeRT::Windows::UI::Xaml::Media::InitAcrylicBackgroundSourceEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitRevealBrushStateEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitMediaElementStateEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitAudioCategoryEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitAudioDeviceTypeEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitBrushMappingModeEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitColorInterpolationModeEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitElementCompositeModeEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitFastPlayFallbackBehaviourEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitFillRuleEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitGradientSpreadMethodEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitMediaCanPlayResponseEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitPenLineCapEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitPenLineJoinEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitStereo3DVideoPackingModeEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitStereo3DVideoRenderModeEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitStretchEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitStyleSimulationsEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitSweepDirectionEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitAlignmentXEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitAlignmentYEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitLoadedImageSourceLoadStatusEnum(target);
      NodeRT::Windows::UI::Xaml::Media::InitVisualTreeHelper(target);
      NodeRT::Windows::UI::Xaml::Media::InitPartialMediaFailureDetectedEventArgs(target);
      NodeRT::Windows::UI::Xaml::Media::InitBrushCollection(target);
      NodeRT::Windows::UI::Xaml::Media::InitRenderedEventArgs(target);
      NodeRT::Windows::UI::Xaml::Media::InitCompositionTarget(target);
      NodeRT::Windows::UI::Xaml::Media::InitDoubleCollection(target);
      NodeRT::Windows::UI::Xaml::Media::InitFontFamily(target);
      NodeRT::Windows::UI::Xaml::Media::InitMediaTransportControlsThumbnailRequestedEventArgs(target);
      NodeRT::Windows::UI::Xaml::Media::InitPointCollection(target);
      NodeRT::Windows::UI::Xaml::Media::InitRenderingEventArgs(target);
      NodeRT::Windows::UI::Xaml::Media::InitTimelineMarkerCollection(target);
      NodeRT::Windows::UI::Xaml::Media::InitTransformCollection(target);
      NodeRT::Windows::UI::Xaml::Media::InitBrush(target);
      NodeRT::Windows::UI::Xaml::Media::InitCacheMode(target);
      NodeRT::Windows::UI::Xaml::Media::InitGeneralTransform(target);
      NodeRT::Windows::UI::Xaml::Media::InitGeometry(target);
      NodeRT::Windows::UI::Xaml::Media::InitImageSource(target);
      NodeRT::Windows::UI::Xaml::Media::InitPathSegment(target);
      NodeRT::Windows::UI::Xaml::Media::InitProjection(target);
      NodeRT::Windows::UI::Xaml::Media::InitRateChangedRoutedEventArgs(target);
      NodeRT::Windows::UI::Xaml::Media::InitTimelineMarker(target);
      NodeRT::Windows::UI::Xaml::Media::InitTimelineMarkerRoutedEventArgs(target);
      NodeRT::Windows::UI::Xaml::Media::InitXamlLight(target);
      NodeRT::Windows::UI::Xaml::Media::InitBitmapCache(target);
      NodeRT::Windows::UI::Xaml::Media::InitMatrix3DProjection(target);
      NodeRT::Windows::UI::Xaml::Media::InitPlaneProjection(target);
      NodeRT::Windows::UI::Xaml::Media::InitRectangleGeometry(target);
      NodeRT::Windows::UI::Xaml::Media::InitSolidColorBrush(target);
      NodeRT::Windows::UI::Xaml::Media::InitTransform(target);
      NodeRT::Windows::UI::Xaml::Media::InitCompositeTransform(target);
      NodeRT::Windows::UI::Xaml::Media::InitMatrixTransform(target);
      NodeRT::Windows::UI::Xaml::Media::InitRotateTransform(target);
      NodeRT::Windows::UI::Xaml::Media::InitScaleTransform(target);
      NodeRT::Windows::UI::Xaml::Media::InitSkewTransform(target);
      NodeRT::Windows::UI::Xaml::Media::InitTransformGroup(target);
      NodeRT::Windows::UI::Xaml::Media::InitTranslateTransform(target);
      NodeRT::Windows::UI::Xaml::Media::InitGeometryCollection(target);
      NodeRT::Windows::UI::Xaml::Media::InitGradientStopCollection(target);
      NodeRT::Windows::UI::Xaml::Media::InitLoadedImageSourceLoadCompletedEventArgs(target);
      NodeRT::Windows::UI::Xaml::Media::InitLoadedImageSurface(target);
      NodeRT::Windows::UI::Xaml::Media::InitPathFigureCollection(target);
      NodeRT::Windows::UI::Xaml::Media::InitPathSegmentCollection(target);
      NodeRT::Windows::UI::Xaml::Media::InitGradientStop(target);
      NodeRT::Windows::UI::Xaml::Media::InitPathFigure(target);
      NodeRT::Windows::UI::Xaml::Media::InitArcSegment(target);
      NodeRT::Windows::UI::Xaml::Media::InitBezierSegment(target);
      NodeRT::Windows::UI::Xaml::Media::InitEllipseGeometry(target);
      NodeRT::Windows::UI::Xaml::Media::InitGeometryGroup(target);
      NodeRT::Windows::UI::Xaml::Media::InitGradientBrush(target);
      NodeRT::Windows::UI::Xaml::Media::InitLineGeometry(target);
      NodeRT::Windows::UI::Xaml::Media::InitLineSegment(target);
      NodeRT::Windows::UI::Xaml::Media::InitPathGeometry(target);
      NodeRT::Windows::UI::Xaml::Media::InitPolyBezierSegment(target);
      NodeRT::Windows::UI::Xaml::Media::InitPolyLineSegment(target);
      NodeRT::Windows::UI::Xaml::Media::InitPolyQuadraticBezierSegment(target);
      NodeRT::Windows::UI::Xaml::Media::InitQuadraticBezierSegment(target);
      NodeRT::Windows::UI::Xaml::Media::InitTileBrush(target);
      NodeRT::Windows::UI::Xaml::Media::InitXamlCompositionBrushBase(target);
      NodeRT::Windows::UI::Xaml::Media::InitAcrylicBrush(target);
      NodeRT::Windows::UI::Xaml::Media::InitRevealBrush(target);
      NodeRT::Windows::UI::Xaml::Media::InitRevealBorderBrush(target);
      NodeRT::Windows::UI::Xaml::Media::InitRevealBackgroundBrush(target);
      NodeRT::Windows::UI::Xaml::Media::InitImageBrush(target);
      NodeRT::Windows::UI::Xaml::Media::InitLinearGradientBrush(target);


  NodeRT::Utils::RegisterNameSpace("Windows.UI.Xaml.Media", target);
}



NODE_MODULE(binding, init)
