/***********************************************************************
!!!!!! DO NOT MODIFY !!!!!!

GacGen.exe Resource.xml

This file is generated by Workflow compiler
https://github.com/vczh-libraries
***********************************************************************/

#include "Demo.h"
/* CodePack:BeginIgnore() */
#ifndef VCZH_DEBUG_NO_REFLECTION
/* CodePack:ConditionOff(VCZH_DEBUG_NO_REFLECTION, DemoReflection.h) */
#include "DemoReflection.h"
#endif
/* CodePack:EndIgnore() */

#if defined( _MSC_VER)
#pragma warning(push)
#pragma warning(disable:4250)
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wparentheses-equality"
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#endif

#define GLOBAL_SYMBOL ::vl_workflow_global::Demo::
#define GLOBAL_NAME ::vl_workflow_global::Demo::Instance().
#define GLOBAL_OBJ &::vl_workflow_global::Demo::Instance()

/***********************************************************************
Global Variables
***********************************************************************/

BEGIN_GLOBAL_STORAGE_CLASS(vl_workflow_global_Demo)
	vl_workflow_global::Demo instance;
	INITIALIZE_GLOBAL_STORAGE_CLASS
	FINALIZE_GLOBAL_STORAGE_CLASS
END_GLOBAL_STORAGE_CLASS(vl_workflow_global_Demo)

namespace vl_workflow_global
{
/***********************************************************************
Global Functions
***********************************************************************/

	double Demo::F(double x)
	{
		auto y = ((x * x) * static_cast<double>(static_cast<::vl::vint>(2)));
		return y;
	}

	double Demo::G(double x)
	{
		if ((x < static_cast<double>(0.5)))
		{
			return GLOBAL_NAME F(x);
		}
		else
		{
			return (static_cast<double>(static_cast<::vl::vint>(1)) - GLOBAL_NAME F((static_cast<double>(static_cast<::vl::vint>(1)) - x)));
		}
	}

	Demo& Demo::Instance()
	{
		return Getvl_workflow_global_Demo().instance;
	}

/***********************************************************************
Closures
***********************************************************************/

	//-------------------------------------------------------------------

	__vwsnf10_Demo_demo_MainWindow_BallAnimation_::__vwsnf10_Demo_demo_MainWindow_BallAnimation_(::vl::presentation::compositions::GuiBoundsComposition* __vwsnctor_ball, ::vl::presentation::compositions::GuiBoundsComposition* __vwsnctor_container)
		:ball(__vwsnctor_ball)
		, container(__vwsnctor_container)
	{
	}

	void __vwsnf10_Demo_demo_MainWindow_BallAnimation_::operator()(::vl::vuint64_t time) const
	{
		auto circleRatio = GLOBAL_NAME G((static_cast<double>(time) / static_cast<double>(static_cast<::vl::vint>(2000))));
		auto angle = (((circleRatio * ::vl::reflection::description::Math::Pi()) * static_cast<double>(static_cast<::vl::vint>(2))) + (::vl::reflection::description::Math::Pi() * static_cast<double>(1.5)));
		auto sin = ::vl::reflection::description::Math::Sin(angle);
		auto cos = ::vl::reflection::description::Math::Cos(angle);
		auto cx = ((::vl::__vwsn::This(container)->GetCachedBounds().x2 - ::vl::__vwsn::This(container)->GetCachedBounds().x1) / static_cast<::vl::vint>(2));
		auto cy = ((::vl::__vwsn::This(container)->GetCachedBounds().y2 - ::vl::__vwsn::This(container)->GetCachedBounds().y1) / static_cast<::vl::vint>(2));
		auto radiusBall = ((::vl::__vwsn::This(ball)->GetCachedBounds().x2 - ::vl::__vwsn::This(ball)->GetCachedBounds().x1) / static_cast<::vl::vint>(2));
		auto radiusOrbit = (::vl::reflection::description::Math::Min(cx, cy) - radiusBall);
		auto x = static_cast<::vl::vint>(::vl::reflection::description::Math::Round(((cos * static_cast<double>(radiusOrbit)) + static_cast<double>(cx))));
		auto y = static_cast<::vl::vint>(::vl::reflection::description::Math::Round(((sin * static_cast<double>(radiusOrbit)) + static_cast<double>(cx))));
		::vl::__vwsn::This(ball)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = (x - radiusBall); __vwsn_temp__.top = (y - radiusBall); __vwsn_temp__.right = (- static_cast<::vl::vint>(1)); __vwsn_temp__.bottom = (- static_cast<::vl::vint>(1)); return __vwsn_temp__; }());
		auto alpha = static_cast<double>(1.0);
		if ((circleRatio < static_cast<double>(0.05)))
		{
			(alpha = (circleRatio * static_cast<double>(static_cast<::vl::vint>(20))));
		}
		else if ((circleRatio > static_cast<double>(0.95)))
		{
			(alpha = ((static_cast<double>(static_cast<::vl::vint>(1)) - circleRatio) * static_cast<double>(static_cast<::vl::vint>(20))));
		}
		auto element = ::vl::__vwsn::Ensure(::vl::__vwsn::SharedPtrCast<::vl::presentation::elements::GuiSolidBackgroundElement>(::vl::__vwsn::This(ball)->GetOwnedElement().Obj()));
		auto color = ::vl::__vwsn::This(element.Obj())->GetColor();
		::vl::__vwsn::This(element.Obj())->SetColor([&](){ ::vl::presentation::Color __vwsn_temp__; __vwsn_temp__.r = color.r; __vwsn_temp__.g = color.g; __vwsn_temp__.b = color.b; __vwsn_temp__.a = static_cast<::vl::vuint8_t>(::vl::reflection::description::Math::Round((alpha * static_cast<double>(static_cast<::vl::vint>(255))))); return __vwsn_temp__; }());
		if ((! ::vl::__vwsn::This(ball)->GetVisible()))
		{
			::vl::__vwsn::This(ball)->SetVisible(true);
		}
	}

	//-------------------------------------------------------------------

	__vwsnf11_Demo_demo_MainWindow_BallAnimationWithDelay_::__vwsnf11_Demo_demo_MainWindow_BallAnimationWithDelay_(::vl::presentation::compositions::GuiBoundsComposition* __vwsnctor_ball, ::vl::presentation::compositions::GuiBoundsComposition* __vwsnctor_container, ::vl::vint __vwsnctor_delay)
		:ball(__vwsnctor_ball)
		, container(__vwsnctor_container)
		, delay(__vwsnctor_delay)
	{
	}

	::vl::Ptr<::vl::reflection::description::ICoroutine> __vwsnf11_Demo_demo_MainWindow_BallAnimationWithDelay_::operator()(::vl::presentation::controls::IGuiAnimationCoroutine::IImpl* __vwsn_co_impl_) const
	{
		return ::vl::Ptr<::vl::reflection::description::ICoroutine>(new ::vl_workflow_global::__vwsnc5_Demo_demo_MainWindow_BallAnimationWithDelay___vl_reflection_description_ICoroutine(__vwsn_co_impl_, ball, container, delay));
	}

	//-------------------------------------------------------------------

	__vwsnf12_Demo_demo_MainWindow_WaitingAnimation_::__vwsnf12_Demo_demo_MainWindow_WaitingAnimation_(::vl::presentation::compositions::GuiBoundsComposition* __vwsnctor_container)
		:container(__vwsnctor_container)
	{
	}

	::vl::Ptr<::vl::reflection::description::ICoroutine> __vwsnf12_Demo_demo_MainWindow_WaitingAnimation_::operator()(::vl::presentation::controls::IGuiAnimationCoroutine::IImpl* __vwsn_co_impl_) const
	{
		return ::vl::Ptr<::vl::reflection::description::ICoroutine>(new ::vl_workflow_global::__vwsnc6_Demo_demo_MainWindow_WaitingAnimation___vl_reflection_description_ICoroutine(__vwsn_co_impl_, container));
	}

	//-------------------------------------------------------------------

	__vwsnf2_Demo_demo_ColorAnimation_CreateAnimation_::__vwsnf2_Demo_demo_ColorAnimation_CreateAnimation_(::vl::vuint64_t __vwsnctor___vwsn_ani_time, ::demo::ColorAnimation* __vwsnctorthis_0)
		:__vwsn_ani_time(__vwsnctor___vwsn_ani_time)
		, __vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
	{
	}

	void __vwsnf2_Demo_demo_ColorAnimation_CreateAnimation_::operator()(::vl::vuint64_t __vwsn_ani_currentTime) const
	{
		__vwsnthis_0->Interpolate((static_cast<double>(__vwsn_ani_currentTime) / static_cast<double>(__vwsn_ani_time)));
	}

	//-------------------------------------------------------------------

	__vwsnf3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_::__vwsnf3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_(::demo::MainWindowConstructor* __vwsnctorthis_0)
		:__vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
	{
	}

	void __vwsnf3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const
	{
		auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_6.Obj())->GetColor1();
		auto __vwsn_new_ = ::vl::__vwsn::Unbox<::vl::presentation::Color>(__vwsn_value_);
		if ((__vwsn_old_ == __vwsn_new_))
		{
			return;
		}
		::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_6.Obj())->SetColor1(__vwsn_new_);
	}

	//-------------------------------------------------------------------

	__vwsnf4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_::__vwsnf4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_(::demo::MainWindowConstructor* __vwsnctorthis_0)
		:__vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
	{
	}

	void __vwsnf4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const
	{
		auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_6.Obj())->GetColor2();
		auto __vwsn_new_ = ::vl::__vwsn::Unbox<::vl::presentation::Color>(__vwsn_value_);
		if ((__vwsn_old_ == __vwsn_new_))
		{
			return;
		}
		::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_6.Obj())->SetColor2(__vwsn_new_);
	}

	//-------------------------------------------------------------------

	__vwsnf5_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_::__vwsnf5_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_(::demo::MainWindowConstructor* __vwsnctorthis_0)
		:__vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
	{
	}

	void __vwsnf5_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const
	{
		auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_8.Obj())->GetColor();
		auto __vwsn_new_ = ::vl::__vwsn::Unbox<::vl::presentation::Color>(__vwsn_value_);
		if ((__vwsn_old_ == __vwsn_new_))
		{
			return;
		}
		::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_8.Obj())->SetColor(__vwsn_new_);
	}

	//-------------------------------------------------------------------

	__vwsnf6_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_::__vwsnf6_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_(::demo::MainWindowConstructor* __vwsnctorthis_0)
		:__vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
	{
	}

	void __vwsnf6_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_::operator()(const ::vl::reflection::description::Value& __vwsn_value_) const
	{
		auto __vwsn_old_ = ::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_8.Obj())->GetThickness();
		auto __vwsn_new_ = ::vl::__vwsn::Unbox<::vl::vint>(__vwsn_value_);
		if ((__vwsn_old_ == __vwsn_new_))
		{
			return;
		}
		::vl::__vwsn::This(__vwsnthis_0->__vwsn_precompile_8.Obj())->SetThickness(__vwsn_new_);
	}

	//-------------------------------------------------------------------

	__vwsnf7_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_::__vwsnf7_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_(::demo::MainWindowConstructor* __vwsnctorthis_0)
		:__vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
	{
	}

	void __vwsnf7_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_::operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const
	{
		::vl::__vwsn::This(__vwsnthis_0->self)->PerformGradientAnimation(::demo::ColorDef::Dark());
	}

	//-------------------------------------------------------------------

	__vwsnf8_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_::__vwsnf8_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_(::demo::MainWindowConstructor* __vwsnctorthis_0)
		:__vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
	{
	}

	void __vwsnf8_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_::operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const
	{
		::vl::__vwsn::This(__vwsnthis_0->self)->PerformGradientAnimation(::demo::ColorDef::Light());
	}

	//-------------------------------------------------------------------

	__vwsnf9_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_::__vwsnf9_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_(::demo::MainWindowConstructor* __vwsnctorthis_0)
		:__vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
	{
	}

	void __vwsnf9_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_::operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const
	{
		::vl::__vwsn::This(__vwsnthis_0->self)->PerformGradientAnimation(::demo::ColorDef::Sink());
	}

	//-------------------------------------------------------------------

	__vwsno1_Demo_demo_ColorAnimation_::__vwsno1_Demo_demo_ColorAnimation_()
	{
	}

	double __vwsno1_Demo_demo_ColorAnimation_::operator()(double __vwsno_1) const
	{
		return __vwsno_1;
	}

	//-------------------------------------------------------------------

	__vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription(::demo::MainWindowConstructor* __vwsnctorthis_0)
		:__vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
	{
		this->__vwsn_bind_cache_0 = ::vl::Ptr<::demo::ColorAnimation>();
		this->__vwsn_bind_cache_1 = ::vl::Ptr<::demo::ColorDef>();
		this->__vwsn_bind_handler_0_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>();
		this->__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>();
		this->__vwsn_bind_opened_ = false;
		this->__vwsn_bind_closed_ = false;
	}

	void __vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_activator_()
	{
		auto __vwsn_bind_activator_result_ = ::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->GetTop();
		::vl::__vwsn::EventInvoke(this->ValueChanged)(::vl::__vwsn::Box(__vwsn_bind_activator_result_));
	}

	void __vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_0_0()
	{
		if (static_cast<bool>(__vwsn_bind_handler_1_0))
		{
			::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->TopChanged, __vwsn_bind_handler_1_0);
			(__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
		}
		(__vwsn_bind_cache_1 = [&](){ try{ return ::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->GetCurrent(); } catch(...){ return ::vl::Ptr<::demo::ColorDef>(); } }());
		(__vwsn_bind_handler_1_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->TopChanged, ::vl::Func<void()>(this, &__vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_1_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }());
		this->__vwsn_bind_activator_();
	}

	void __vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_1_0()
	{
		this->__vwsn_bind_activator_();
	}

	bool __vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::Open()
	{
		if ((! __vwsn_bind_opened_))
		{
			(__vwsn_bind_opened_ = true);
			(__vwsn_bind_cache_0 = [&](){ try{ return ::vl::__vwsn::This(__vwsnthis_0->self)->gradientColorDef; } catch(...){ return ::vl::Ptr<::demo::ColorAnimation>(); } }());
			(__vwsn_bind_cache_1 = [&](){ try{ return ::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->GetCurrent(); } catch(...){ return ::vl::Ptr<::demo::ColorDef>(); } }());
			(__vwsn_bind_handler_0_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->CurrentChanged, ::vl::Func<void()>(this, &__vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_0_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }());
			(__vwsn_bind_handler_1_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->TopChanged, ::vl::Func<void()>(this, &__vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_1_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }());
			return true;
		}
		return false;
	}

	bool __vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::Update()
	{
		if ((__vwsn_bind_opened_ && (! __vwsn_bind_closed_)))
		{
			this->__vwsn_bind_activator_();
			return true;
		}
		return false;
	}

	bool __vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::Close()
	{
		if ((! __vwsn_bind_closed_))
		{
			(__vwsn_bind_closed_ = true);
			if (static_cast<bool>(__vwsn_bind_handler_0_0))
			{
				::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->CurrentChanged, __vwsn_bind_handler_0_0);
				(__vwsn_bind_handler_0_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			}
			if (static_cast<bool>(__vwsn_bind_handler_1_0))
			{
				::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->TopChanged, __vwsn_bind_handler_1_0);
				(__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			}
			(__vwsn_bind_cache_0 = ::vl::Ptr<::demo::ColorAnimation>());
			(__vwsn_bind_cache_1 = ::vl::Ptr<::demo::ColorDef>());
			(__vwsn_bind_handler_0_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			(__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			return true;
		}
		return false;
	}

	//-------------------------------------------------------------------

	__vwsnc2_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsnc2_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription(::demo::MainWindowConstructor* __vwsnctorthis_0)
		:__vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
	{
		this->__vwsn_bind_cache_0 = ::vl::Ptr<::demo::ColorAnimation>();
		this->__vwsn_bind_cache_1 = ::vl::Ptr<::demo::ColorDef>();
		this->__vwsn_bind_handler_0_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>();
		this->__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>();
		this->__vwsn_bind_opened_ = false;
		this->__vwsn_bind_closed_ = false;
	}

	void __vwsnc2_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_activator_()
	{
		auto __vwsn_bind_activator_result_ = ::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->GetBottom();
		::vl::__vwsn::EventInvoke(this->ValueChanged)(::vl::__vwsn::Box(__vwsn_bind_activator_result_));
	}

	void __vwsnc2_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_0_0()
	{
		if (static_cast<bool>(__vwsn_bind_handler_1_0))
		{
			::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->BottomChanged, __vwsn_bind_handler_1_0);
			(__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
		}
		(__vwsn_bind_cache_1 = [&](){ try{ return ::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->GetCurrent(); } catch(...){ return ::vl::Ptr<::demo::ColorDef>(); } }());
		(__vwsn_bind_handler_1_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->BottomChanged, ::vl::Func<void()>(this, &__vwsnc2_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_1_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }());
		this->__vwsn_bind_activator_();
	}

	void __vwsnc2_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_1_0()
	{
		this->__vwsn_bind_activator_();
	}

	bool __vwsnc2_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::Open()
	{
		if ((! __vwsn_bind_opened_))
		{
			(__vwsn_bind_opened_ = true);
			(__vwsn_bind_cache_0 = [&](){ try{ return ::vl::__vwsn::This(__vwsnthis_0->self)->gradientColorDef; } catch(...){ return ::vl::Ptr<::demo::ColorAnimation>(); } }());
			(__vwsn_bind_cache_1 = [&](){ try{ return ::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->GetCurrent(); } catch(...){ return ::vl::Ptr<::demo::ColorDef>(); } }());
			(__vwsn_bind_handler_0_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->CurrentChanged, ::vl::Func<void()>(this, &__vwsnc2_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_0_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }());
			(__vwsn_bind_handler_1_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->BottomChanged, ::vl::Func<void()>(this, &__vwsnc2_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_1_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }());
			return true;
		}
		return false;
	}

	bool __vwsnc2_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::Update()
	{
		if ((__vwsn_bind_opened_ && (! __vwsn_bind_closed_)))
		{
			this->__vwsn_bind_activator_();
			return true;
		}
		return false;
	}

	bool __vwsnc2_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::Close()
	{
		if ((! __vwsn_bind_closed_))
		{
			(__vwsn_bind_closed_ = true);
			if (static_cast<bool>(__vwsn_bind_handler_0_0))
			{
				::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->CurrentChanged, __vwsn_bind_handler_0_0);
				(__vwsn_bind_handler_0_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			}
			if (static_cast<bool>(__vwsn_bind_handler_1_0))
			{
				::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->BottomChanged, __vwsn_bind_handler_1_0);
				(__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			}
			(__vwsn_bind_cache_0 = ::vl::Ptr<::demo::ColorAnimation>());
			(__vwsn_bind_cache_1 = ::vl::Ptr<::demo::ColorDef>());
			(__vwsn_bind_handler_0_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			(__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			return true;
		}
		return false;
	}

	//-------------------------------------------------------------------

	__vwsnc3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsnc3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription(::demo::MainWindowConstructor* __vwsnctorthis_0)
		:__vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
	{
		this->__vwsn_bind_cache_0 = ::vl::Ptr<::demo::ColorAnimation>();
		this->__vwsn_bind_cache_1 = ::vl::Ptr<::demo::ColorDef>();
		this->__vwsn_bind_handler_0_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>();
		this->__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>();
		this->__vwsn_bind_opened_ = false;
		this->__vwsn_bind_closed_ = false;
	}

	void __vwsnc3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_activator_()
	{
		auto __vwsn_bind_activator_result_ = ::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->GetShadow();
		::vl::__vwsn::EventInvoke(this->ValueChanged)(::vl::__vwsn::Box(__vwsn_bind_activator_result_));
	}

	void __vwsnc3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_0_0()
	{
		if (static_cast<bool>(__vwsn_bind_handler_1_0))
		{
			::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->ShadowChanged, __vwsn_bind_handler_1_0);
			(__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
		}
		(__vwsn_bind_cache_1 = [&](){ try{ return ::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->GetCurrent(); } catch(...){ return ::vl::Ptr<::demo::ColorDef>(); } }());
		(__vwsn_bind_handler_1_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->ShadowChanged, ::vl::Func<void()>(this, &__vwsnc3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_1_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }());
		this->__vwsn_bind_activator_();
	}

	void __vwsnc3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_1_0()
	{
		this->__vwsn_bind_activator_();
	}

	bool __vwsnc3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::Open()
	{
		if ((! __vwsn_bind_opened_))
		{
			(__vwsn_bind_opened_ = true);
			(__vwsn_bind_cache_0 = [&](){ try{ return ::vl::__vwsn::This(__vwsnthis_0->self)->gradientColorDef; } catch(...){ return ::vl::Ptr<::demo::ColorAnimation>(); } }());
			(__vwsn_bind_cache_1 = [&](){ try{ return ::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->GetCurrent(); } catch(...){ return ::vl::Ptr<::demo::ColorDef>(); } }());
			(__vwsn_bind_handler_0_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->CurrentChanged, ::vl::Func<void()>(this, &__vwsnc3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_0_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }());
			(__vwsn_bind_handler_1_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->ShadowChanged, ::vl::Func<void()>(this, &__vwsnc3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_1_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }());
			return true;
		}
		return false;
	}

	bool __vwsnc3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::Update()
	{
		if ((__vwsn_bind_opened_ && (! __vwsn_bind_closed_)))
		{
			this->__vwsn_bind_activator_();
			return true;
		}
		return false;
	}

	bool __vwsnc3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::Close()
	{
		if ((! __vwsn_bind_closed_))
		{
			(__vwsn_bind_closed_ = true);
			if (static_cast<bool>(__vwsn_bind_handler_0_0))
			{
				::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->CurrentChanged, __vwsn_bind_handler_0_0);
				(__vwsn_bind_handler_0_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			}
			if (static_cast<bool>(__vwsn_bind_handler_1_0))
			{
				::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->ShadowChanged, __vwsn_bind_handler_1_0);
				(__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			}
			(__vwsn_bind_cache_0 = ::vl::Ptr<::demo::ColorAnimation>());
			(__vwsn_bind_cache_1 = ::vl::Ptr<::demo::ColorDef>());
			(__vwsn_bind_handler_0_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			(__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			return true;
		}
		return false;
	}

	//-------------------------------------------------------------------

	__vwsnc4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsnc4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription(::demo::MainWindowConstructor* __vwsnctorthis_0)
		:__vwsnthis_0(::vl::__vwsn::This(__vwsnctorthis_0))
	{
		this->__vwsn_bind_cache_0 = ::vl::Ptr<::demo::ColorAnimation>();
		this->__vwsn_bind_cache_1 = ::vl::Ptr<::demo::ColorDef>();
		this->__vwsn_bind_handler_0_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>();
		this->__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>();
		this->__vwsn_bind_opened_ = false;
		this->__vwsn_bind_closed_ = false;
	}

	void __vwsnc4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_activator_()
	{
		auto __vwsn_bind_activator_result_ = ::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->GetThickness();
		::vl::__vwsn::EventInvoke(this->ValueChanged)(::vl::__vwsn::Box(__vwsn_bind_activator_result_));
	}

	void __vwsnc4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_0_0()
	{
		if (static_cast<bool>(__vwsn_bind_handler_1_0))
		{
			::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->ThicknessChanged, __vwsn_bind_handler_1_0);
			(__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
		}
		(__vwsn_bind_cache_1 = [&](){ try{ return ::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->GetCurrent(); } catch(...){ return ::vl::Ptr<::demo::ColorDef>(); } }());
		(__vwsn_bind_handler_1_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->ThicknessChanged, ::vl::Func<void()>(this, &__vwsnc4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_1_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }());
		this->__vwsn_bind_activator_();
	}

	void __vwsnc4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_1_0()
	{
		this->__vwsn_bind_activator_();
	}

	bool __vwsnc4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::Open()
	{
		if ((! __vwsn_bind_opened_))
		{
			(__vwsn_bind_opened_ = true);
			(__vwsn_bind_cache_0 = [&](){ try{ return ::vl::__vwsn::This(__vwsnthis_0->self)->gradientColorDef; } catch(...){ return ::vl::Ptr<::demo::ColorAnimation>(); } }());
			(__vwsn_bind_cache_1 = [&](){ try{ return ::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->GetCurrent(); } catch(...){ return ::vl::Ptr<::demo::ColorDef>(); } }());
			(__vwsn_bind_handler_0_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->CurrentChanged, ::vl::Func<void()>(this, &__vwsnc4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_0_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }());
			(__vwsn_bind_handler_1_0 = [&](){ try{ return ::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->ThicknessChanged, ::vl::Func<void()>(this, &__vwsnc4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::__vwsn_bind_callback_1_0)); } catch(...){ return ::vl::Ptr<::vl::reflection::description::IEventHandler>(); } }());
			return true;
		}
		return false;
	}

	bool __vwsnc4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::Update()
	{
		if ((__vwsn_bind_opened_ && (! __vwsn_bind_closed_)))
		{
			this->__vwsn_bind_activator_();
			return true;
		}
		return false;
	}

	bool __vwsnc4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription::Close()
	{
		if ((! __vwsn_bind_closed_))
		{
			(__vwsn_bind_closed_ = true);
			if (static_cast<bool>(__vwsn_bind_handler_0_0))
			{
				::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_0.Obj())->CurrentChanged, __vwsn_bind_handler_0_0);
				(__vwsn_bind_handler_0_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			}
			if (static_cast<bool>(__vwsn_bind_handler_1_0))
			{
				::vl::__vwsn::EventDetach(::vl::__vwsn::This(__vwsn_bind_cache_1.Obj())->ThicknessChanged, __vwsn_bind_handler_1_0);
				(__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			}
			(__vwsn_bind_cache_0 = ::vl::Ptr<::demo::ColorAnimation>());
			(__vwsn_bind_cache_1 = ::vl::Ptr<::demo::ColorDef>());
			(__vwsn_bind_handler_0_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			(__vwsn_bind_handler_1_0 = ::vl::Ptr<::vl::reflection::description::IEventHandler>());
			return true;
		}
		return false;
	}

	//-------------------------------------------------------------------

	__vwsnc5_Demo_demo_MainWindow_BallAnimationWithDelay___vl_reflection_description_ICoroutine::__vwsnc5_Demo_demo_MainWindow_BallAnimationWithDelay___vl_reflection_description_ICoroutine(::vl::presentation::controls::IGuiAnimationCoroutine::IImpl* __vwsnctor___vwsn_co_impl_, ::vl::presentation::compositions::GuiBoundsComposition* __vwsnctor_ball, ::vl::presentation::compositions::GuiBoundsComposition* __vwsnctor_container, ::vl::vint __vwsnctor_delay)
		:__vwsn_co_impl_(__vwsnctor___vwsn_co_impl_)
		, ball(__vwsnctor_ball)
		, container(__vwsnctor_container)
		, delay(__vwsnctor_delay)
	{
		this->__vwsn_co_state_ = static_cast<::vl::vint>(0);
		this->__vwsn_co_state_before_pause_ = (- static_cast<::vl::vint>(1));
		this->__vwsn_prop_Failure = ::vl::Ptr<::vl::reflection::description::IValueException>();
		this->__vwsn_prop_Status = ::vl::reflection::description::CoroutineStatus::Waiting;
	}

	::vl::Ptr<::vl::reflection::description::IValueException> __vwsnc5_Demo_demo_MainWindow_BallAnimationWithDelay___vl_reflection_description_ICoroutine::GetFailure()
	{
		return __vwsn_prop_Failure;
	}
	void __vwsnc5_Demo_demo_MainWindow_BallAnimationWithDelay___vl_reflection_description_ICoroutine::SetFailure(::vl::Ptr<::vl::reflection::description::IValueException> __vwsn_value_)
	{
		(__vwsn_prop_Failure = __vwsn_value_);
	}

	::vl::reflection::description::CoroutineStatus __vwsnc5_Demo_demo_MainWindow_BallAnimationWithDelay___vl_reflection_description_ICoroutine::GetStatus()
	{
		return __vwsn_prop_Status;
	}
	void __vwsnc5_Demo_demo_MainWindow_BallAnimationWithDelay___vl_reflection_description_ICoroutine::SetStatus(::vl::reflection::description::CoroutineStatus __vwsn_value_)
	{
		(__vwsn_prop_Status = __vwsn_value_);
	}

	void __vwsnc5_Demo_demo_MainWindow_BallAnimationWithDelay___vl_reflection_description_ICoroutine::Resume(bool __vwsn_raise_exception_, ::vl::Ptr<::vl::reflection::description::CoroutineResult> __vwsn_co_result_)
	{
		if ((this->GetStatus() != ::vl::reflection::description::CoroutineStatus::Waiting))
		{
			throw ::vl::Exception(::vl::WString::Unmanaged(L"Resume should be called only when the coroutine is in the waiting status."));
		}
		this->SetStatus(::vl::reflection::description::CoroutineStatus::Executing);
		try
		{
			{
				if ((__vwsn_co_state_before_pause_ != (- static_cast<::vl::vint>(1))))
				{
					if ((! static_cast<bool>(__vwsn_co_result_)))
					{
						(__vwsn_co_state_before_pause_ = (- static_cast<::vl::vint>(1)));
					}
					else if ((! static_cast<bool>(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure())))
					{
						(__vwsn_co_state_before_pause_ = (- static_cast<::vl::vint>(1)));
					}
					else
					{
						{
							(__vwsn_co_state_before_pause_ = (- static_cast<::vl::vint>(1)));
							throw ::vl::Exception(::vl::__vwsn::This(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure().Obj())->GetMessage());
						}
					}
				}
				while (true)
				{
					if ((__vwsn_co_state_ == static_cast<::vl::vint>(0)))
					{
						this->SetStatus(::vl::reflection::description::CoroutineStatus::Waiting);
						(__vwsn_co_state_before_pause_ = __vwsn_co_state_);
						(__vwsn_co_state_ = static_cast<::vl::vint>(2));
						{
							::vl::presentation::controls::IGuiAnimationCoroutine::WaitAndPause(__vwsn_co_impl_, static_cast<::vl::vuint64_t>(delay));
						}
						return;
					}
					if ((__vwsn_co_state_ == static_cast<::vl::vint>(1)))
					{
						if (static_cast<bool>(__vwsn_co_result_))
						{
							if (static_cast<bool>(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure()))
							{
								throw ::vl::Exception(::vl::__vwsn::This(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure().Obj())->GetMessage());
							}
						}
						::vl::__vwsn::This(ball)->SetVisible(false);
						this->SetStatus(::vl::reflection::description::CoroutineStatus::Stopped);
						return;
					}
					if ((__vwsn_co_state_ == static_cast<::vl::vint>(2)))
					{
						if (static_cast<bool>(__vwsn_co_result_))
						{
							if (static_cast<bool>(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure()))
							{
								throw ::vl::Exception(::vl::__vwsn::This(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure().Obj())->GetMessage());
							}
						}
						(__vwsn_co_state_ = static_cast<::vl::vint>(3));
						continue;
					}
					if ((__vwsn_co_state_ == static_cast<::vl::vint>(3)))
					{
						this->SetStatus(::vl::reflection::description::CoroutineStatus::Waiting);
						(__vwsn_co_state_before_pause_ = __vwsn_co_state_);
						(__vwsn_co_state_ = static_cast<::vl::vint>(1));
						{
							::vl::presentation::controls::IGuiAnimationCoroutine::PlayAndWaitAndPause(__vwsn_co_impl_, ::demo::MainWindow::BallAnimation(container, ball));
						}
						return;
					}
				}
			}
		}
		catch(const ::vl::Exception& __vwsne_0)
		{
			auto __vwsn_co_ex_ = ::vl::reflection::description::IValueException::Create(__vwsne_0.Message());
			{
				this->SetFailure(__vwsn_co_ex_);
				this->SetStatus(::vl::reflection::description::CoroutineStatus::Stopped);
				if (__vwsn_raise_exception_)
				{
					throw;
				}
			}
		}
	}

	//-------------------------------------------------------------------

	__vwsnc6_Demo_demo_MainWindow_WaitingAnimation___vl_reflection_description_ICoroutine::__vwsnc6_Demo_demo_MainWindow_WaitingAnimation___vl_reflection_description_ICoroutine(::vl::presentation::controls::IGuiAnimationCoroutine::IImpl* __vwsnctor___vwsn_co_impl_, ::vl::presentation::compositions::GuiBoundsComposition* __vwsnctor_container)
		:__vwsn_co_impl_(__vwsnctor___vwsn_co_impl_)
		, container(__vwsnctor_container)
	{
		this->__vwsn_co0_for_begin_i = static_cast<::vl::vint>(0);
		this->__vwsn_co1_for_end_i = static_cast<::vl::vint>(0);
		this->__vwsn_co2_i = static_cast<::vl::vint>(0);
		this->__vwsn_co3_balls = ::vl::Ptr<::vl::reflection::description::IValueList>();
		this->__vwsn_co_state_ = static_cast<::vl::vint>(0);
		this->__vwsn_co_state_before_pause_ = (- static_cast<::vl::vint>(1));
		this->__vwsn_prop_Failure = ::vl::Ptr<::vl::reflection::description::IValueException>();
		this->__vwsn_prop_Status = ::vl::reflection::description::CoroutineStatus::Waiting;
	}

	::vl::Ptr<::vl::reflection::description::IValueException> __vwsnc6_Demo_demo_MainWindow_WaitingAnimation___vl_reflection_description_ICoroutine::GetFailure()
	{
		return __vwsn_prop_Failure;
	}
	void __vwsnc6_Demo_demo_MainWindow_WaitingAnimation___vl_reflection_description_ICoroutine::SetFailure(::vl::Ptr<::vl::reflection::description::IValueException> __vwsn_value_)
	{
		(__vwsn_prop_Failure = __vwsn_value_);
	}

	::vl::reflection::description::CoroutineStatus __vwsnc6_Demo_demo_MainWindow_WaitingAnimation___vl_reflection_description_ICoroutine::GetStatus()
	{
		return __vwsn_prop_Status;
	}
	void __vwsnc6_Demo_demo_MainWindow_WaitingAnimation___vl_reflection_description_ICoroutine::SetStatus(::vl::reflection::description::CoroutineStatus __vwsn_value_)
	{
		(__vwsn_prop_Status = __vwsn_value_);
	}

	void __vwsnc6_Demo_demo_MainWindow_WaitingAnimation___vl_reflection_description_ICoroutine::Resume(bool __vwsn_raise_exception_, ::vl::Ptr<::vl::reflection::description::CoroutineResult> __vwsn_co_result_)
	{
		if ((this->GetStatus() != ::vl::reflection::description::CoroutineStatus::Waiting))
		{
			throw ::vl::Exception(::vl::WString::Unmanaged(L"Resume should be called only when the coroutine is in the waiting status."));
		}
		this->SetStatus(::vl::reflection::description::CoroutineStatus::Executing);
		try
		{
			{
				if ((__vwsn_co_state_before_pause_ != (- static_cast<::vl::vint>(1))))
				{
					if ((! static_cast<bool>(__vwsn_co_result_)))
					{
						(__vwsn_co_state_before_pause_ = (- static_cast<::vl::vint>(1)));
					}
					else if ((! static_cast<bool>(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure())))
					{
						(__vwsn_co_state_before_pause_ = (- static_cast<::vl::vint>(1)));
					}
					else
					{
						{
							(__vwsn_co_state_before_pause_ = (- static_cast<::vl::vint>(1)));
							throw ::vl::Exception(::vl::__vwsn::This(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure().Obj())->GetMessage());
						}
					}
				}
				while (true)
				{
					if ((__vwsn_co_state_ == static_cast<::vl::vint>(0)))
					{
						(__vwsn_co3_balls = ::vl::reflection::description::IValueList::Create());
						{
							auto __vwsn_for_begin_i = static_cast<::vl::vint>(0);
							auto __vwsn_for_end_i = (static_cast<::vl::vint>(8) - static_cast<::vl::vint>(1));
							auto i = __vwsn_for_begin_i;
							while ((i <= __vwsn_for_end_i))
							{
								{
									auto ball = new ::vl::presentation::compositions::GuiBoundsComposition();
									::vl::__vwsn::This(__vwsn_co3_balls.Obj())->Add(::vl::__vwsn::Box(ball));
									::vl::__vwsn::This(ball)->SetVisible(false);
									::vl::__vwsn::This(ball)->SetPreferredMinSize([&](){ ::vl::presentation::Size __vwsn_temp__; __vwsn_temp__.x = static_cast<::vl::vint>(16); __vwsn_temp__.y = static_cast<::vl::vint>(16); return __vwsn_temp__; }());
									auto element = ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidBackgroundElement>());
									::vl::__vwsn::This(element.Obj())->SetShape([&](){ ::vl::presentation::elements::ElementShape __vwsn_temp__; __vwsn_temp__.shapeType = ::vl::presentation::elements::ElementShapeType::Ellipse; return __vwsn_temp__; }());
									::vl::__vwsn::This(element.Obj())->SetColor(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#3F48CC")));
									::vl::__vwsn::This(ball)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(element));
									::vl::__vwsn::This(container)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(ball));
								}
								(i = (i + static_cast<::vl::vint>(1)));
							}
						}
						if (true)
						{
							(__vwsn_co_state_ = static_cast<::vl::vint>(3));
							continue;
						}
						(__vwsn_co_state_ = static_cast<::vl::vint>(1));
						continue;
					}
					if ((__vwsn_co_state_ == static_cast<::vl::vint>(1)))
					{
						this->SetStatus(::vl::reflection::description::CoroutineStatus::Stopped);
						return;
					}
					if ((__vwsn_co_state_ == static_cast<::vl::vint>(2)))
					{
						if (static_cast<bool>(__vwsn_co_result_))
						{
							if (static_cast<bool>(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure()))
							{
								throw ::vl::Exception(::vl::__vwsn::This(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure().Obj())->GetMessage());
							}
						}
						if (true)
						{
							(__vwsn_co_state_ = static_cast<::vl::vint>(3));
							continue;
						}
						(__vwsn_co_state_ = static_cast<::vl::vint>(1));
						continue;
					}
					if ((__vwsn_co_state_ == static_cast<::vl::vint>(3)))
					{
						this->SetStatus(::vl::reflection::description::CoroutineStatus::Waiting);
						(__vwsn_co_state_before_pause_ = __vwsn_co_state_);
						(__vwsn_co_state_ = static_cast<::vl::vint>(4));
						{
							::vl::presentation::controls::IGuiAnimationCoroutine::WaitAndPause(__vwsn_co_impl_, static_cast<::vl::vuint64_t>(static_cast<::vl::vint>(500)));
						}
						return;
					}
					if ((__vwsn_co_state_ == static_cast<::vl::vint>(4)))
					{
						if (static_cast<bool>(__vwsn_co_result_))
						{
							if (static_cast<bool>(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure()))
							{
								throw ::vl::Exception(::vl::__vwsn::This(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure().Obj())->GetMessage());
							}
						}
						(__vwsn_co0_for_begin_i = static_cast<::vl::vint>(0));
						(__vwsn_co1_for_end_i = (::vl::__vwsn::This(__vwsn_co3_balls.Obj())->GetCount() - static_cast<::vl::vint>(1)));
						(__vwsn_co2_i = __vwsn_co0_for_begin_i);
						if ((__vwsn_co2_i <= __vwsn_co1_for_end_i))
						{
							(__vwsn_co_state_ = static_cast<::vl::vint>(6));
							continue;
						}
						(__vwsn_co_state_ = static_cast<::vl::vint>(7));
						continue;
					}
					if ((__vwsn_co_state_ == static_cast<::vl::vint>(5)))
					{
						if (static_cast<bool>(__vwsn_co_result_))
						{
							if (static_cast<bool>(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure()))
							{
								throw ::vl::Exception(::vl::__vwsn::This(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure().Obj())->GetMessage());
							}
						}
						(__vwsn_co2_i = (__vwsn_co2_i + static_cast<::vl::vint>(1)));
						if ((__vwsn_co2_i <= __vwsn_co1_for_end_i))
						{
							(__vwsn_co_state_ = static_cast<::vl::vint>(6));
							continue;
						}
						(__vwsn_co_state_ = static_cast<::vl::vint>(7));
						continue;
					}
					if ((__vwsn_co_state_ == static_cast<::vl::vint>(6)))
					{
						this->SetStatus(::vl::reflection::description::CoroutineStatus::Waiting);
						(__vwsn_co_state_before_pause_ = __vwsn_co_state_);
						(__vwsn_co_state_ = static_cast<::vl::vint>(5));
						{
							::vl::presentation::controls::IGuiAnimationCoroutine::PlayInGroupAndPause(__vwsn_co_impl_, ::demo::MainWindow::BallAnimationWithDelay(container, ::vl::__vwsn::Unbox<::vl::presentation::compositions::GuiBoundsComposition*>(::vl::__vwsn::This(__vwsn_co3_balls.Obj())->Get(__vwsn_co2_i)), (static_cast<::vl::vint>(150) * __vwsn_co2_i)), static_cast<::vl::vint>(0));
						}
						return;
					}
					if ((__vwsn_co_state_ == static_cast<::vl::vint>(7)))
					{
						this->SetStatus(::vl::reflection::description::CoroutineStatus::Waiting);
						(__vwsn_co_state_before_pause_ = __vwsn_co_state_);
						(__vwsn_co_state_ = static_cast<::vl::vint>(2));
						{
							::vl::presentation::controls::IGuiAnimationCoroutine::WaitForGroupAndPause(__vwsn_co_impl_, static_cast<::vl::vint>(0));
						}
						return;
					}
				}
			}
		}
		catch(const ::vl::Exception& __vwsne_0)
		{
			auto __vwsn_co_ex_ = ::vl::reflection::description::IValueException::Create(__vwsne_0.Message());
			{
				this->SetFailure(__vwsn_co_ex_);
				this->SetStatus(::vl::reflection::description::CoroutineStatus::Stopped);
				if (__vwsn_raise_exception_)
				{
					throw;
				}
			}
		}
	}

}

/***********************************************************************
Class (::demo::ColorAnimation)
***********************************************************************/

namespace demo
{
	::vl::Ptr<::demo::ColorDef> ColorAnimation::GetBegin()
	{
		return this->__vwsn_prop_Begin;
	}
	void ColorAnimation::SetBegin(::vl::Ptr<::demo::ColorDef> __vwsn_value_)
	{
		if ((this->__vwsn_prop_Begin.Obj() != __vwsn_value_.Obj()))
		{
			(this->__vwsn_prop_Begin = __vwsn_value_);
			::vl::__vwsn::EventInvoke(this->BeginChanged)();
		}
	}

	::vl::Ptr<::demo::ColorDef> ColorAnimation::GetEnd()
	{
		return this->__vwsn_prop_End;
	}
	void ColorAnimation::SetEnd(::vl::Ptr<::demo::ColorDef> __vwsn_value_)
	{
		if ((this->__vwsn_prop_End.Obj() != __vwsn_value_.Obj()))
		{
			(this->__vwsn_prop_End = __vwsn_value_);
			::vl::__vwsn::EventInvoke(this->EndChanged)();
		}
	}

	::vl::Ptr<::demo::ColorDef> ColorAnimation::GetCurrent()
	{
		return this->__vwsn_prop_Current;
	}
	void ColorAnimation::SetCurrent(::vl::Ptr<::demo::ColorDef> __vwsn_value_)
	{
		if ((this->__vwsn_prop_Current.Obj() != __vwsn_value_.Obj()))
		{
			(this->__vwsn_prop_Current = __vwsn_value_);
			::vl::__vwsn::EventInvoke(this->CurrentChanged)();
		}
	}

	double ColorAnimation::GetTimeScale(::vl::Ptr<::demo::ColorDef> __vwsn_ani_begin, ::vl::Ptr<::demo::ColorDef> __vwsn_ani_end, ::vl::Ptr<::demo::ColorDef> __vwsn_ani_current)
	{
		auto __vwsn_ani_scale = static_cast<double>(0.0);
		{
			auto __vwsn_ani_ref = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetTop().a) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetTop().a)));
			auto __vwsn_ani_cur = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetTop().a) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetTop().a)));
			(__vwsn_ani_scale = ::vl::reflection::description::Math::Max(__vwsn_ani_scale, (__vwsn_ani_cur / ::vl::reflection::description::Math::Max(__vwsn_ani_ref, static_cast<double>(0.000001)))));
		}
		{
			auto __vwsn_ani_ref = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetTop().b) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetTop().b)));
			auto __vwsn_ani_cur = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetTop().b) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetTop().b)));
			(__vwsn_ani_scale = ::vl::reflection::description::Math::Max(__vwsn_ani_scale, (__vwsn_ani_cur / ::vl::reflection::description::Math::Max(__vwsn_ani_ref, static_cast<double>(0.000001)))));
		}
		{
			auto __vwsn_ani_ref = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetTop().g) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetTop().g)));
			auto __vwsn_ani_cur = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetTop().g) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetTop().g)));
			(__vwsn_ani_scale = ::vl::reflection::description::Math::Max(__vwsn_ani_scale, (__vwsn_ani_cur / ::vl::reflection::description::Math::Max(__vwsn_ani_ref, static_cast<double>(0.000001)))));
		}
		{
			auto __vwsn_ani_ref = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetTop().r) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetTop().r)));
			auto __vwsn_ani_cur = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetTop().r) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetTop().r)));
			(__vwsn_ani_scale = ::vl::reflection::description::Math::Max(__vwsn_ani_scale, (__vwsn_ani_cur / ::vl::reflection::description::Math::Max(__vwsn_ani_ref, static_cast<double>(0.000001)))));
		}
		{
			auto __vwsn_ani_ref = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetBottom().a) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetBottom().a)));
			auto __vwsn_ani_cur = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetBottom().a) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetBottom().a)));
			(__vwsn_ani_scale = ::vl::reflection::description::Math::Max(__vwsn_ani_scale, (__vwsn_ani_cur / ::vl::reflection::description::Math::Max(__vwsn_ani_ref, static_cast<double>(0.000001)))));
		}
		{
			auto __vwsn_ani_ref = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetBottom().b) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetBottom().b)));
			auto __vwsn_ani_cur = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetBottom().b) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetBottom().b)));
			(__vwsn_ani_scale = ::vl::reflection::description::Math::Max(__vwsn_ani_scale, (__vwsn_ani_cur / ::vl::reflection::description::Math::Max(__vwsn_ani_ref, static_cast<double>(0.000001)))));
		}
		{
			auto __vwsn_ani_ref = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetBottom().g) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetBottom().g)));
			auto __vwsn_ani_cur = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetBottom().g) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetBottom().g)));
			(__vwsn_ani_scale = ::vl::reflection::description::Math::Max(__vwsn_ani_scale, (__vwsn_ani_cur / ::vl::reflection::description::Math::Max(__vwsn_ani_ref, static_cast<double>(0.000001)))));
		}
		{
			auto __vwsn_ani_ref = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetBottom().r) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetBottom().r)));
			auto __vwsn_ani_cur = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetBottom().r) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetBottom().r)));
			(__vwsn_ani_scale = ::vl::reflection::description::Math::Max(__vwsn_ani_scale, (__vwsn_ani_cur / ::vl::reflection::description::Math::Max(__vwsn_ani_ref, static_cast<double>(0.000001)))));
		}
		{
			auto __vwsn_ani_ref = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetShadow().a) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetShadow().a)));
			auto __vwsn_ani_cur = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetShadow().a) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetShadow().a)));
			(__vwsn_ani_scale = ::vl::reflection::description::Math::Max(__vwsn_ani_scale, (__vwsn_ani_cur / ::vl::reflection::description::Math::Max(__vwsn_ani_ref, static_cast<double>(0.000001)))));
		}
		{
			auto __vwsn_ani_ref = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetShadow().b) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetShadow().b)));
			auto __vwsn_ani_cur = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetShadow().b) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetShadow().b)));
			(__vwsn_ani_scale = ::vl::reflection::description::Math::Max(__vwsn_ani_scale, (__vwsn_ani_cur / ::vl::reflection::description::Math::Max(__vwsn_ani_ref, static_cast<double>(0.000001)))));
		}
		{
			auto __vwsn_ani_ref = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetShadow().g) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetShadow().g)));
			auto __vwsn_ani_cur = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetShadow().g) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetShadow().g)));
			(__vwsn_ani_scale = ::vl::reflection::description::Math::Max(__vwsn_ani_scale, (__vwsn_ani_cur / ::vl::reflection::description::Math::Max(__vwsn_ani_ref, static_cast<double>(0.000001)))));
		}
		{
			auto __vwsn_ani_ref = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetShadow().r) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetShadow().r)));
			auto __vwsn_ani_cur = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetShadow().r) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetShadow().r)));
			(__vwsn_ani_scale = ::vl::reflection::description::Math::Max(__vwsn_ani_scale, (__vwsn_ani_cur / ::vl::reflection::description::Math::Max(__vwsn_ani_ref, static_cast<double>(0.000001)))));
		}
		{
			auto __vwsn_ani_ref = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetThickness()) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetThickness())));
			auto __vwsn_ani_cur = ::vl::reflection::description::Math::Abs((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetThickness()) - static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetThickness())));
			(__vwsn_ani_scale = ::vl::reflection::description::Math::Max(__vwsn_ani_scale, (__vwsn_ani_cur / ::vl::reflection::description::Math::Max(__vwsn_ani_ref, static_cast<double>(0.000001)))));
		}
		return ::vl::reflection::description::Math::Min(static_cast<double>(1.0), __vwsn_ani_scale);
	}

	void ColorAnimation::Interpolate(::vl::Ptr<::demo::ColorDef> __vwsn_ani_begin, ::vl::Ptr<::demo::ColorDef> __vwsn_ani_end, ::vl::Ptr<::demo::ColorDef> __vwsn_ani_current, double __vwsn_ani_ratio)
	{
		auto __vwsn_ani__Top_a = static_cast<::vl::vuint8_t>(::vl::reflection::description::Math::Round(((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetTop().a) * (static_cast<double>(1.0) - this->__vwsn_ani_int_(__vwsn_ani_ratio))) + (static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetTop().a) * this->__vwsn_ani_int_(__vwsn_ani_ratio)))));
		auto __vwsn_ani__Top_b = static_cast<::vl::vuint8_t>(::vl::reflection::description::Math::Round(((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetTop().b) * (static_cast<double>(1.0) - this->__vwsn_ani_int_(__vwsn_ani_ratio))) + (static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetTop().b) * this->__vwsn_ani_int_(__vwsn_ani_ratio)))));
		auto __vwsn_ani__Top_g = static_cast<::vl::vuint8_t>(::vl::reflection::description::Math::Round(((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetTop().g) * (static_cast<double>(1.0) - this->__vwsn_ani_int_(__vwsn_ani_ratio))) + (static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetTop().g) * this->__vwsn_ani_int_(__vwsn_ani_ratio)))));
		auto __vwsn_ani__Top_r = static_cast<::vl::vuint8_t>(::vl::reflection::description::Math::Round(((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetTop().r) * (static_cast<double>(1.0) - this->__vwsn_ani_int_(__vwsn_ani_ratio))) + (static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetTop().r) * this->__vwsn_ani_int_(__vwsn_ani_ratio)))));
		auto __vwsn_ani__Bottom_a = static_cast<::vl::vuint8_t>(::vl::reflection::description::Math::Round(((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetBottom().a) * (static_cast<double>(1.0) - this->__vwsn_ani_int_(__vwsn_ani_ratio))) + (static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetBottom().a) * this->__vwsn_ani_int_(__vwsn_ani_ratio)))));
		auto __vwsn_ani__Bottom_b = static_cast<::vl::vuint8_t>(::vl::reflection::description::Math::Round(((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetBottom().b) * (static_cast<double>(1.0) - this->__vwsn_ani_int_(__vwsn_ani_ratio))) + (static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetBottom().b) * this->__vwsn_ani_int_(__vwsn_ani_ratio)))));
		auto __vwsn_ani__Bottom_g = static_cast<::vl::vuint8_t>(::vl::reflection::description::Math::Round(((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetBottom().g) * (static_cast<double>(1.0) - this->__vwsn_ani_int_(__vwsn_ani_ratio))) + (static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetBottom().g) * this->__vwsn_ani_int_(__vwsn_ani_ratio)))));
		auto __vwsn_ani__Bottom_r = static_cast<::vl::vuint8_t>(::vl::reflection::description::Math::Round(((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetBottom().r) * (static_cast<double>(1.0) - this->__vwsn_ani_int_(__vwsn_ani_ratio))) + (static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetBottom().r) * this->__vwsn_ani_int_(__vwsn_ani_ratio)))));
		auto __vwsn_ani__Shadow_a = static_cast<::vl::vuint8_t>(::vl::reflection::description::Math::Round(((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetShadow().a) * (static_cast<double>(1.0) - this->__vwsn_ani_int_(__vwsn_ani_ratio))) + (static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetShadow().a) * this->__vwsn_ani_int_(__vwsn_ani_ratio)))));
		auto __vwsn_ani__Shadow_b = static_cast<::vl::vuint8_t>(::vl::reflection::description::Math::Round(((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetShadow().b) * (static_cast<double>(1.0) - this->__vwsn_ani_int_(__vwsn_ani_ratio))) + (static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetShadow().b) * this->__vwsn_ani_int_(__vwsn_ani_ratio)))));
		auto __vwsn_ani__Shadow_g = static_cast<::vl::vuint8_t>(::vl::reflection::description::Math::Round(((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetShadow().g) * (static_cast<double>(1.0) - this->__vwsn_ani_int_(__vwsn_ani_ratio))) + (static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetShadow().g) * this->__vwsn_ani_int_(__vwsn_ani_ratio)))));
		auto __vwsn_ani__Shadow_r = static_cast<::vl::vuint8_t>(::vl::reflection::description::Math::Round(((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetShadow().r) * (static_cast<double>(1.0) - this->__vwsn_ani_int_(__vwsn_ani_ratio))) + (static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetShadow().r) * this->__vwsn_ani_int_(__vwsn_ani_ratio)))));
		auto __vwsn_ani__Thickness = static_cast<::vl::vint>(::vl::reflection::description::Math::Round(((static_cast<double>(::vl::__vwsn::This(__vwsn_ani_begin.Obj())->GetThickness()) * (static_cast<double>(1.0) - this->__vwsn_ani_int_Thickness(__vwsn_ani_ratio))) + (static_cast<double>(::vl::__vwsn::This(__vwsn_ani_end.Obj())->GetThickness()) * this->__vwsn_ani_int_Thickness(__vwsn_ani_ratio)))));
		::vl::__vwsn::This(__vwsn_ani_current.Obj())->SetTop([&](){ ::vl::presentation::Color __vwsn_temp__; __vwsn_temp__.a = __vwsn_ani__Top_a; __vwsn_temp__.b = __vwsn_ani__Top_b; __vwsn_temp__.g = __vwsn_ani__Top_g; __vwsn_temp__.r = __vwsn_ani__Top_r; return __vwsn_temp__; }());
		::vl::__vwsn::This(__vwsn_ani_current.Obj())->SetBottom([&](){ ::vl::presentation::Color __vwsn_temp__; __vwsn_temp__.a = __vwsn_ani__Bottom_a; __vwsn_temp__.b = __vwsn_ani__Bottom_b; __vwsn_temp__.g = __vwsn_ani__Bottom_g; __vwsn_temp__.r = __vwsn_ani__Bottom_r; return __vwsn_temp__; }());
		::vl::__vwsn::This(__vwsn_ani_current.Obj())->SetShadow([&](){ ::vl::presentation::Color __vwsn_temp__; __vwsn_temp__.a = __vwsn_ani__Shadow_a; __vwsn_temp__.b = __vwsn_ani__Shadow_b; __vwsn_temp__.g = __vwsn_ani__Shadow_g; __vwsn_temp__.r = __vwsn_ani__Shadow_r; return __vwsn_temp__; }());
		::vl::__vwsn::This(__vwsn_ani_current.Obj())->SetThickness(__vwsn_ani__Thickness);
	}

	void ColorAnimation::Interpolate(double __vwsn_ani_ratio)
	{
		this->Interpolate(this->GetBegin(), this->GetEnd(), this->GetCurrent(), __vwsn_ani_ratio);
	}

	::vl::Ptr<::vl::presentation::controls::IGuiAnimation> ColorAnimation::CreateAnimation(::vl::Ptr<::demo::ColorDef> __vwsn_ani_target, ::vl::vuint64_t __vwsn_ani_time)
	{
		auto __vwsn_ani_scaledTime = static_cast<::vl::vuint64_t>(::vl::reflection::description::Math::Round((static_cast<double>(__vwsn_ani_time) * this->GetTimeScale(this->GetEnd(), __vwsn_ani_target, this->GetCurrent()))));
		::vl::__vwsn::This(this->GetBegin().Obj())->SetTop(::vl::__vwsn::This(this->GetCurrent().Obj())->GetTop());
		::vl::__vwsn::This(this->GetBegin().Obj())->SetBottom(::vl::__vwsn::This(this->GetCurrent().Obj())->GetBottom());
		::vl::__vwsn::This(this->GetBegin().Obj())->SetShadow(::vl::__vwsn::This(this->GetCurrent().Obj())->GetShadow());
		::vl::__vwsn::This(this->GetBegin().Obj())->SetThickness(::vl::__vwsn::This(this->GetCurrent().Obj())->GetThickness());
		this->SetEnd(__vwsn_ani_target);
		return ::vl::presentation::controls::IGuiAnimation::CreateAnimation(vl::Func(::vl_workflow_global::__vwsnf2_Demo_demo_ColorAnimation_CreateAnimation_(__vwsn_ani_time, this)), __vwsn_ani_time);
	}

	ColorAnimation::ColorAnimation(::vl::Ptr<::demo::ColorDef> __vwsn_ani_current)
		: __vwsn_prop_Begin(::vl::Ptr<::demo::ColorDef>())
		, __vwsn_prop_End(::vl::Ptr<::demo::ColorDef>())
		, __vwsn_prop_Current(::vl::Ptr<::demo::ColorDef>())
		, __vwsn_ani_int_(::vl::Func<double(double)>(GLOBAL_OBJ, &GLOBAL_SYMBOL G))
		, __vwsn_ani_int_Thickness(vl::Func(::vl_workflow_global::__vwsno1_Demo_demo_ColorAnimation_()))
	{
		this->SetBegin(::vl::Ptr<::demo::ColorDef>(new ::demo::ColorDef()));
		::vl::__vwsn::This(this->GetBegin().Obj())->SetTop(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetTop());
		::vl::__vwsn::This(this->GetBegin().Obj())->SetBottom(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetBottom());
		::vl::__vwsn::This(this->GetBegin().Obj())->SetShadow(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetShadow());
		::vl::__vwsn::This(this->GetBegin().Obj())->SetThickness(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetThickness());
		this->SetEnd(::vl::Ptr<::demo::ColorDef>(new ::demo::ColorDef()));
		::vl::__vwsn::This(this->GetEnd().Obj())->SetTop(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetTop());
		::vl::__vwsn::This(this->GetEnd().Obj())->SetBottom(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetBottom());
		::vl::__vwsn::This(this->GetEnd().Obj())->SetShadow(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetShadow());
		::vl::__vwsn::This(this->GetEnd().Obj())->SetThickness(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetThickness());
		this->SetCurrent(::vl::Ptr<::demo::ColorDef>(new ::demo::ColorDef()));
		::vl::__vwsn::This(this->GetCurrent().Obj())->SetTop(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetTop());
		::vl::__vwsn::This(this->GetCurrent().Obj())->SetBottom(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetBottom());
		::vl::__vwsn::This(this->GetCurrent().Obj())->SetShadow(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetShadow());
		::vl::__vwsn::This(this->GetCurrent().Obj())->SetThickness(::vl::__vwsn::This(__vwsn_ani_current.Obj())->GetThickness());
	}

/***********************************************************************
Class (::demo::ColorDef)
***********************************************************************/

	::vl::presentation::Color ColorDef::GetTop()
	{
		return this->__vwsn_prop_Top;
	}

	void ColorDef::SetTop(::vl::presentation::Color __vwsn_value_)
	{
		if ((this->__vwsn_prop_Top != __vwsn_value_))
		{
			(this->__vwsn_prop_Top = __vwsn_value_);
			::vl::__vwsn::EventInvoke(this->TopChanged)();
		}
	}

	::vl::presentation::Color ColorDef::GetBottom()
	{
		return this->__vwsn_prop_Bottom;
	}

	void ColorDef::SetBottom(::vl::presentation::Color __vwsn_value_)
	{
		if ((this->__vwsn_prop_Bottom != __vwsn_value_))
		{
			(this->__vwsn_prop_Bottom = __vwsn_value_);
			::vl::__vwsn::EventInvoke(this->BottomChanged)();
		}
	}

	::vl::presentation::Color ColorDef::GetShadow()
	{
		return this->__vwsn_prop_Shadow;
	}

	void ColorDef::SetShadow(::vl::presentation::Color __vwsn_value_)
	{
		if ((this->__vwsn_prop_Shadow != __vwsn_value_))
		{
			(this->__vwsn_prop_Shadow = __vwsn_value_);
			::vl::__vwsn::EventInvoke(this->ShadowChanged)();
		}
	}

	::vl::vint ColorDef::GetThickness()
	{
		return this->__vwsn_prop_Thickness;
	}

	void ColorDef::SetThickness(::vl::vint __vwsn_value_)
	{
		if ((this->__vwsn_prop_Thickness != __vwsn_value_))
		{
			(this->__vwsn_prop_Thickness = __vwsn_value_);
			::vl::__vwsn::EventInvoke(this->ThicknessChanged)();
		}
	}

	::vl::Ptr<::demo::ColorDef> ColorDef::Dark()
	{
		auto def = ::vl::Ptr<::demo::ColorDef>(new ::demo::ColorDef());
		::vl::__vwsn::This(def.Obj())->SetTop(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#9999FF")));
		::vl::__vwsn::This(def.Obj())->SetBottom(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#5555FF")));
		::vl::__vwsn::This(def.Obj())->SetThickness(static_cast<::vl::vint>(0));
		return def;
	}

	::vl::Ptr<::demo::ColorDef> ColorDef::Light()
	{
		auto def = ::vl::Ptr<::demo::ColorDef>(new ::demo::ColorDef());
		::vl::__vwsn::This(def.Obj())->SetTop(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#DDDDFF")));
		::vl::__vwsn::This(def.Obj())->SetBottom(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#9999FF")));
		::vl::__vwsn::This(def.Obj())->SetThickness(static_cast<::vl::vint>(0));
		return def;
	}

	::vl::Ptr<::demo::ColorDef> ColorDef::Sink()
	{
		auto def = ::vl::Ptr<::demo::ColorDef>(new ::demo::ColorDef());
		::vl::__vwsn::This(def.Obj())->SetTop(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#5555FF")));
		::vl::__vwsn::This(def.Obj())->SetBottom(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#0000FF")));
		::vl::__vwsn::This(def.Obj())->SetThickness(static_cast<::vl::vint>(10));
		return def;
	}

	ColorDef::ColorDef()
		: __vwsn_prop_Top(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#000000")))
		, __vwsn_prop_Bottom(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#000000")))
		, __vwsn_prop_Shadow(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#000000A0")))
		, __vwsn_prop_Thickness(static_cast<::vl::vint>(0))
	{
	}

/***********************************************************************
Class (::demo::MainWindowConstructor)
***********************************************************************/

	void MainWindowConstructor::__vwsn_demo_MainWindow_Initialize(::demo::MainWindow* __vwsn_this_)
	{
		(this->self = __vwsn_this_);
		(this->__vwsn_precompile_20 = ::vl::__vwsn::This(this->self)->GetContainerComposition());
		{
			::vl::__vwsn::This(this->__vwsn_precompile_20)->SetPreferredMinSize([&](){ ::vl::presentation::Size __vwsn_temp__; __vwsn_temp__.x = static_cast<::vl::vint>(640); __vwsn_temp__.y = static_cast<::vl::vint>(480); return __vwsn_temp__; }());
		}
		{
			::vl::__vwsn::This(this->self)->SetClientSize([&](){ ::vl::presentation::Size __vwsn_temp__; __vwsn_temp__.x = static_cast<::vl::vint>(640); __vwsn_temp__.y = static_cast<::vl::vint>(480); return __vwsn_temp__; }());
		}
		{
			::vl::__vwsn::This(this->self)->SetText(::vl::WString::Unmanaged(L"GacUI XML资源临时测试"));
		}
		{
			(this->__vwsn_precompile_0 = new ::vl::presentation::controls::GuiTab(::vl::presentation::theme::ThemeName::Tab));
		}
		{
			(this->__vwsn_precompile_2 = new ::vl::presentation::controls::GuiTabPage(::vl::presentation::theme::ThemeName::CustomControl));
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_2)->SetText(::vl::WString::Unmanaged(L"Gradient Animation"));
		}
		(this->__vwsn_precompile_3 = new ::vl::presentation::compositions::GuiTableComposition());
		{
			::vl::__vwsn::This(this->__vwsn_precompile_3)->SetCellPadding(static_cast<::vl::vint>(5));
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_3)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }());
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_3)->SetRowsAndColumns(static_cast<::vl::vint>(4), static_cast<::vl::vint>(3));
			::vl::__vwsn::This(this->__vwsn_precompile_3)->SetRowOption(static_cast<::vl::vint>(0), [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }());
			::vl::__vwsn::This(this->__vwsn_precompile_3)->SetRowOption(static_cast<::vl::vint>(1), [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }());
			::vl::__vwsn::This(this->__vwsn_precompile_3)->SetRowOption(static_cast<::vl::vint>(2), [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }());
			::vl::__vwsn::This(this->__vwsn_precompile_3)->SetRowOption(static_cast<::vl::vint>(3), [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Percentage; __vwsn_temp__.percentage = static_cast<double>(1.0); return __vwsn_temp__; }());
			::vl::__vwsn::This(this->__vwsn_precompile_3)->SetColumnOption(static_cast<::vl::vint>(0), [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }());
			::vl::__vwsn::This(this->__vwsn_precompile_3)->SetColumnOption(static_cast<::vl::vint>(1), [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Absolute; __vwsn_temp__.absolute = static_cast<::vl::vint>(100); return __vwsn_temp__; }());
			::vl::__vwsn::This(this->__vwsn_precompile_3)->SetColumnOption(static_cast<::vl::vint>(2), [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Percentage; __vwsn_temp__.percentage = static_cast<double>(1.0); return __vwsn_temp__; }());
		}
		(this->__vwsn_precompile_4 = new ::vl::presentation::compositions::GuiCellComposition());
		{
			::vl::__vwsn::This(this->__vwsn_precompile_4)->SetSite(static_cast<::vl::vint>(0), static_cast<::vl::vint>(0), static_cast<::vl::vint>(4), static_cast<::vl::vint>(1));
		}
		(this->__vwsn_precompile_5 = new ::vl::presentation::compositions::GuiBoundsComposition());
		{
			::vl::__vwsn::This(this->__vwsn_precompile_5)->SetPreferredMinSize([&](){ ::vl::presentation::Size __vwsn_temp__; __vwsn_temp__.x = static_cast<::vl::vint>(200); __vwsn_temp__.y = static_cast<::vl::vint>(200); return __vwsn_temp__; }());
		}
		(this->__vwsn_precompile_6 = ::vl::Ptr<::vl::presentation::elements::GuiGradientBackgroundElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiGradientBackgroundElement>()));
		{
			::vl::__vwsn::This(this->__vwsn_precompile_6.Obj())->SetDirection(::vl::presentation::elements::GuiGradientBackgroundElement::Direction::Slash);
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_5)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_6));
		}
		(this->__vwsn_precompile_7 = new ::vl::presentation::compositions::GuiBoundsComposition());
		{
			::vl::__vwsn::This(this->__vwsn_precompile_7)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }());
		}
		(this->__vwsn_precompile_8 = ::vl::Ptr<::vl::presentation::elements::GuiInnerShadowElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiInnerShadowElement>()));
		{
			::vl::__vwsn::This(this->__vwsn_precompile_7)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_8));
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_5)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_7));
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_4)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_5));
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_3)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_4));
		}
		(this->__vwsn_precompile_9 = new ::vl::presentation::compositions::GuiCellComposition());
		{
			::vl::__vwsn::This(this->__vwsn_precompile_9)->SetSite(static_cast<::vl::vint>(0), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1));
		}
		{
			(this->__vwsn_precompile_10 = new ::vl::presentation::controls::GuiButton(::vl::presentation::theme::ThemeName::Button));
		}
		(this->__vwsn_precompile_11 = ::vl::__vwsn::This(this->__vwsn_precompile_10)->GetBoundsComposition());
		{
			::vl::__vwsn::This(this->__vwsn_precompile_11)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }());
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_10)->SetText(::vl::WString::Unmanaged(L"Dark"));
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_9)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this->__vwsn_precompile_10)->GetBoundsComposition()));
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_3)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_9));
		}
		(this->__vwsn_precompile_12 = new ::vl::presentation::compositions::GuiCellComposition());
		{
			::vl::__vwsn::This(this->__vwsn_precompile_12)->SetSite(static_cast<::vl::vint>(1), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1));
		}
		{
			(this->__vwsn_precompile_13 = new ::vl::presentation::controls::GuiButton(::vl::presentation::theme::ThemeName::Button));
		}
		(this->__vwsn_precompile_14 = ::vl::__vwsn::This(this->__vwsn_precompile_13)->GetBoundsComposition());
		{
			::vl::__vwsn::This(this->__vwsn_precompile_14)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }());
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_13)->SetText(::vl::WString::Unmanaged(L"Light"));
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_12)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this->__vwsn_precompile_13)->GetBoundsComposition()));
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_3)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_12));
		}
		(this->__vwsn_precompile_15 = new ::vl::presentation::compositions::GuiCellComposition());
		{
			::vl::__vwsn::This(this->__vwsn_precompile_15)->SetSite(static_cast<::vl::vint>(2), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1), static_cast<::vl::vint>(1));
		}
		{
			(this->__vwsn_precompile_16 = new ::vl::presentation::controls::GuiButton(::vl::presentation::theme::ThemeName::Button));
		}
		(this->__vwsn_precompile_17 = ::vl::__vwsn::This(this->__vwsn_precompile_16)->GetBoundsComposition());
		{
			::vl::__vwsn::This(this->__vwsn_precompile_17)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }());
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_16)->SetText(::vl::WString::Unmanaged(L"Sink"));
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_15)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this->__vwsn_precompile_16)->GetBoundsComposition()));
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_3)->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_15));
		}
		{
			::vl::__vwsn::This(::vl::__vwsn::This(this->__vwsn_precompile_2)->GetContainerComposition())->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->__vwsn_precompile_3));
		}
		{
			auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueObservableList>(::vl::__vwsn::This(this->__vwsn_precompile_0)->GetPages());
			::vl::__vwsn::This(__vwsn_collection_.Obj())->Add(::vl::__vwsn::Box(this->__vwsn_precompile_2));
		}
		{
			(this->__vwsn_precompile_18 = new ::vl::presentation::controls::GuiTabPage(::vl::presentation::theme::ThemeName::CustomControl));
		}
		{
			::vl::__vwsn::This(this->__vwsn_precompile_18)->SetText(::vl::WString::Unmanaged(L"Complex Animation"));
		}
		(this->animationBackground = new ::vl::presentation::compositions::GuiBoundsComposition());
		::vl::__vwsn::This(__vwsn_this_)->SetNamedObject(::vl::WString::Unmanaged(L"animationBackground"), ::vl::__vwsn::Box(this->animationBackground));
		{
			::vl::__vwsn::This(this->animationBackground)->SetPreferredMinSize([&](){ ::vl::presentation::Size __vwsn_temp__; __vwsn_temp__.x = static_cast<::vl::vint>(200); __vwsn_temp__.y = static_cast<::vl::vint>(200); return __vwsn_temp__; }());
		}
		{
			::vl::__vwsn::This(this->animationBackground)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(10); __vwsn_temp__.top = static_cast<::vl::vint>(10); __vwsn_temp__.right = (- static_cast<::vl::vint>(1)); __vwsn_temp__.bottom = (- static_cast<::vl::vint>(1)); return __vwsn_temp__; }());
		}
		(this->__vwsn_precompile_19 = ::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>(::vl::reflection::description::Element_Constructor<::vl::presentation::elements::GuiSolidBackgroundElement>()));
		{
			::vl::__vwsn::This(this->__vwsn_precompile_19.Obj())->SetColor(::vl::__vwsn::Parse<::vl::presentation::Color>(::vl::WString::Unmanaged(L"#FFC929")));
		}
		{
			::vl::__vwsn::This(this->animationBackground)->SetOwnedElement(::vl::Ptr<::vl::presentation::elements::IGuiGraphicsElement>(this->__vwsn_precompile_19));
		}
		{
			::vl::__vwsn::This(::vl::__vwsn::This(this->__vwsn_precompile_18)->GetContainerComposition())->AddChild(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(this->animationBackground));
		}
		{
			auto __vwsn_collection_ = ::vl::__vwsn::UnboxCollection<::vl::reflection::description::IValueObservableList>(::vl::__vwsn::This(this->__vwsn_precompile_0)->GetPages());
			::vl::__vwsn::This(__vwsn_collection_.Obj())->Add(::vl::__vwsn::Box(this->__vwsn_precompile_18));
		}
		(this->__vwsn_precompile_1 = ::vl::__vwsn::This(this->__vwsn_precompile_0)->GetBoundsComposition());
		{
			::vl::__vwsn::This(this->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(5); __vwsn_temp__.top = static_cast<::vl::vint>(5); __vwsn_temp__.right = static_cast<::vl::vint>(5); __vwsn_temp__.bottom = static_cast<::vl::vint>(5); return __vwsn_temp__; }());
		}
		{
			::vl::__vwsn::This(this->self)->AddChild(static_cast<::vl::presentation::controls::GuiControl*>(this->__vwsn_precompile_0));
		}
		{
			auto __vwsn_created_subscription_ = ::vl::Ptr<::vl::reflection::description::IValueSubscription>(new ::vl_workflow_global::__vwsnc1_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription(this));
			::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_created_subscription_.Obj())->ValueChanged, vl::Func(::vl_workflow_global::__vwsnf3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_(this)));
			::vl::__vwsn::This(__vwsn_this_)->AddSubscription(__vwsn_created_subscription_);
		}
		{
			auto __vwsn_created_subscription_ = ::vl::Ptr<::vl::reflection::description::IValueSubscription>(new ::vl_workflow_global::__vwsnc2_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription(this));
			::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_created_subscription_.Obj())->ValueChanged, vl::Func(::vl_workflow_global::__vwsnf4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_(this)));
			::vl::__vwsn::This(__vwsn_this_)->AddSubscription(__vwsn_created_subscription_);
		}
		{
			auto __vwsn_created_subscription_ = ::vl::Ptr<::vl::reflection::description::IValueSubscription>(new ::vl_workflow_global::__vwsnc3_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription(this));
			::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_created_subscription_.Obj())->ValueChanged, vl::Func(::vl_workflow_global::__vwsnf5_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_(this)));
			::vl::__vwsn::This(__vwsn_this_)->AddSubscription(__vwsn_created_subscription_);
		}
		{
			auto __vwsn_created_subscription_ = ::vl::Ptr<::vl::reflection::description::IValueSubscription>(new ::vl_workflow_global::__vwsnc4_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize__vl_reflection_description_IValueSubscription(this));
			::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_created_subscription_.Obj())->ValueChanged, vl::Func(::vl_workflow_global::__vwsnf6_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_(this)));
			::vl::__vwsn::This(__vwsn_this_)->AddSubscription(__vwsn_created_subscription_);
		}
		{
			auto __vwsn_event_handler_ = vl::Func(::vl_workflow_global::__vwsnf7_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_(this));
			::vl::__vwsn::EventAttach(::vl::__vwsn::This(this->__vwsn_precompile_10)->Clicked, __vwsn_event_handler_);
		}
		{
			auto __vwsn_event_handler_ = vl::Func(::vl_workflow_global::__vwsnf8_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_(this));
			::vl::__vwsn::EventAttach(::vl::__vwsn::This(this->__vwsn_precompile_13)->Clicked, __vwsn_event_handler_);
		}
		{
			auto __vwsn_event_handler_ = vl::Func(::vl_workflow_global::__vwsnf9_Demo_demo_MainWindowConstructor___vwsn_demo_MainWindow_Initialize_(this));
			::vl::__vwsn::EventAttach(::vl::__vwsn::This(this->__vwsn_precompile_16)->Clicked, __vwsn_event_handler_);
		}
	}

	MainWindowConstructor::MainWindowConstructor()
		: self(static_cast<::demo::MainWindow*>(nullptr))
		, animationBackground(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr))
		, __vwsn_precompile_0(static_cast<::vl::presentation::controls::GuiTab*>(nullptr))
		, __vwsn_precompile_1(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr))
		, __vwsn_precompile_2(static_cast<::vl::presentation::controls::GuiTabPage*>(nullptr))
		, __vwsn_precompile_3(static_cast<::vl::presentation::compositions::GuiTableComposition*>(nullptr))
		, __vwsn_precompile_4(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr))
		, __vwsn_precompile_5(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr))
		, __vwsn_precompile_6(::vl::Ptr<::vl::presentation::elements::GuiGradientBackgroundElement>())
		, __vwsn_precompile_7(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr))
		, __vwsn_precompile_8(::vl::Ptr<::vl::presentation::elements::GuiInnerShadowElement>())
		, __vwsn_precompile_9(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr))
		, __vwsn_precompile_10(static_cast<::vl::presentation::controls::GuiButton*>(nullptr))
		, __vwsn_precompile_11(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr))
		, __vwsn_precompile_12(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr))
		, __vwsn_precompile_13(static_cast<::vl::presentation::controls::GuiButton*>(nullptr))
		, __vwsn_precompile_14(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr))
		, __vwsn_precompile_15(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr))
		, __vwsn_precompile_16(static_cast<::vl::presentation::controls::GuiButton*>(nullptr))
		, __vwsn_precompile_17(static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr))
		, __vwsn_precompile_18(static_cast<::vl::presentation::controls::GuiTabPage*>(nullptr))
		, __vwsn_precompile_19(::vl::Ptr<::vl::presentation::elements::GuiSolidBackgroundElement>())
		, __vwsn_precompile_20(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(nullptr))
	{
	}

/***********************************************************************
Class (::demo::MainWindow)
***********************************************************************/

	::vl::Ptr<::vl::presentation::controls::IGuiAnimation> MainWindow::BallAnimation(::vl::presentation::compositions::GuiBoundsComposition* container, ::vl::presentation::compositions::GuiBoundsComposition* ball)
	{
		return ::vl::presentation::controls::IGuiAnimation::CreateAnimation(vl::Func(::vl_workflow_global::__vwsnf10_Demo_demo_MainWindow_BallAnimation_(ball, container)), static_cast<::vl::vuint64_t>(static_cast<::vl::vint>(2000)));
	}

	::vl::Ptr<::vl::presentation::controls::IGuiAnimation> MainWindow::BallAnimationWithDelay(::vl::presentation::compositions::GuiBoundsComposition* container, ::vl::presentation::compositions::GuiBoundsComposition* ball, ::vl::vint delay)
	{
		return ::vl::presentation::controls::IGuiAnimationCoroutine::Create(vl::Func(::vl_workflow_global::__vwsnf11_Demo_demo_MainWindow_BallAnimationWithDelay_(ball, container, delay)));
	}

	::vl::Ptr<::vl::presentation::controls::IGuiAnimation> MainWindow::WaitingAnimation(::vl::presentation::compositions::GuiBoundsComposition* container)
	{
		return ::vl::presentation::controls::IGuiAnimationCoroutine::Create(vl::Func(::vl_workflow_global::__vwsnf12_Demo_demo_MainWindow_WaitingAnimation_(container)));
	}

	void MainWindow::PerformGradientAnimation(::vl::Ptr<::demo::ColorDef> target)
	{
		this->KillAnimation(this->lastGradientAnimation);
		(this->lastGradientAnimation = ::vl::__vwsn::This(this->gradientColorDef.Obj())->CreateAnimation(target, static_cast<::vl::vuint64_t>(static_cast<::vl::vint>(500))));
		this->AddAnimation(this->lastGradientAnimation);
	}

	MainWindow::MainWindow()
		: ::vl::presentation::controls::GuiWindow(::vl::presentation::theme::ThemeName::Window)
		, gradientColorDef(::vl::Ptr<::demo::ColorAnimation>(new ::demo::ColorAnimation(::demo::ColorDef::Dark())))
		, lastGradientAnimation(::vl::Ptr<::vl::presentation::controls::IGuiAnimation>())
		, counter(static_cast<::vl::vint>(0))
	{
		auto __vwsn_resource_ = ::vl::__vwsn::This(::vl::presentation::GetResourceManager())->GetResourceFromClassName(::vl::WString::Unmanaged(L"demo::MainWindow"));
		auto __vwsn_resolver_ = ::vl::Ptr<::vl::presentation::GuiResourcePathResolver>(new ::vl::presentation::GuiResourcePathResolver(__vwsn_resource_, ::vl::__vwsn::This(__vwsn_resource_.Obj())->GetWorkingDirectory()));
		::vl::__vwsn::This(this)->SetResourceResolver(__vwsn_resolver_);
		::vl::__vwsn::This(this)->__vwsn_demo_MainWindow_Initialize(this);
		this->__vwsn_instance_ctor_();
	}

	void MainWindow::__vwsn_instance_ctor_()
	{
		::vl::__vwsn::This(this->self)->AddAnimation(::demo::MainWindow::WaitingAnimation(this->animationBackground));
	}

	MainWindow::~MainWindow()
	{
		this->FinalizeInstanceRecursively(static_cast<::vl::presentation::controls::GuiControlHost*>(this));
	}

}
#undef GLOBAL_SYMBOL
#undef GLOBAL_NAME
#undef GLOBAL_OBJ

#if defined( _MSC_VER)
#pragma warning(pop)
#elif defined(__clang__)
#pragma clang diagnostic pop
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
