text: ﻿//------------------------------------------------------------------------------
  //     This code was generated by a tool.
  //
  //     Changes to this file may cause incorrect behavior and will be lost if
  //     the code is regenerated.
  //------------------------------------------------------------------------------
  #include "pch.h"
  
  #pragma warning(push)
  #pragma warning(disable: 4100) // unreferenced formal parameter
  
  #if defined _DEBUG && !defined DISABLE_XAML_GENERATED_BINDING_DEBUG_OUTPUT
  extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
  #endif
  
  #include "MyWaypointControl.xaml.h"
  
  void ::RoutesOverBingMapsApp::MyWaypointControl::InitializeComponent()
  {
      if (_contentLoaded)
      {
          return;
      }
      _contentLoaded = true;
      ::Windows::Foundation::Uri^ resourceLocator = ref new ::Windows::Foundation::Uri(L"ms-appx:///MyWaypointControl.xaml");
      ::Windows::UI::Xaml::Application::LoadComponent(this, resourceLocator, ::Windows::UI::Xaml::Controls::Primitives::ComponentResourceLocation::Application);
  }
  
  
  /// <summary>
  /// Auto generated class for compiled bindings.
  /// </summary>
  class RoutesOverBingMapsApp::MyWaypointControl::MyWaypointControl_obj11_Bindings 
      : public ::XamlBindingInfo::ReferenceTypeXamlBindings<::Windows::Services::Maps::MapLocation>
  {
  public:
      MyWaypointControl_obj11_Bindings()
      {
      }
  
      void Connect(int __connectionId, ::Platform::Object^ __target)
      {
          switch(__connectionId)
          {
              case 11:
                  this->obj11 = safe_cast<::Windows::UI::Xaml::Controls::TextBlock^>(__target);
                  break;
          }
      }
  
      void ResetTemplate()
      {
      }
  
      int ProcessBindings(::Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs^ args)
      {
          int nextPhase = -1;
          switch(args->Phase)
          {
              case 0:
                  nextPhase = -1;
                  this->SetDataRoot(static_cast<::Windows::Services::Maps::MapLocation^>(args->Item));
                  if (this->_dataContextChangedToken.Value != 0)
                  {
                      safe_cast<::Windows::UI::Xaml::FrameworkElement^>(args->ItemContainer->ContentTemplateRoot)->DataContextChanged -= this->_dataContextChangedToken;
                      this->_dataContextChangedToken.Value = 0;
                  }
                  this->_isInitialized = true;
                  break;
          }
          this->Update_((::Windows::Services::Maps::MapLocation^) args->Item, (1 << args->Phase));
          return nextPhase;
      }
  private:
      // Fields for each control that has bindings.
      ::Platform::WeakReference obj11;
  
      // Update methods for each path node used in binding steps.
      void Update_(::Windows::Services::Maps::MapLocation^ obj, int phase)
      {
          if (obj != nullptr)
          {
              if ((phase & (NOT_PHASED | (1 << 0))) != 0)
              {
                  this->Update_Address(obj->Address, phase);
              }
          }
      }
      void Update_Address(::Windows::Services::Maps::MapAddress^ obj, int phase)
      {
          if (obj != nullptr)
          {
              if ((phase & (NOT_PHASED | (1 << 0))) != 0)
              {
                  this->Update_Address_FormattedAddress(obj->FormattedAddress, phase);
              }
          }
      }
      void Update_Address_FormattedAddress(::Platform::String^ obj, int phase)
      {
          if((phase & ((1 << 0) | NOT_PHASED )) != 0)
          {
              if (this->obj11 != nullptr)
              {
                  ::XamlBindingInfo::XamlBindingSetters::Set_Windows_UI_Xaml_Controls_TextBlock_Text(this->obj11.Resolve<::Windows::UI::Xaml::Controls::TextBlock>(), obj, nullptr);
              }
          }
      }
  };
  
  /// <summary>
  /// Auto generated class for compiled bindings.
  /// </summary>
  class RoutesOverBingMapsApp::MyWaypointControl::MyWaypointControl_obj1_Bindings 
      : public ::XamlBindingInfo::ReferenceTypeXamlBindings<::RoutesOverBingMapsApp::MyWaypointControl>
      , public ::XamlBindingInfo::IXamlBindingTracking
  {
              ::Windows::UI::Xaml::ResourceDictionary^ localResources;
              ::Platform::WeakReference converterLookupRoot;
  public:
      MyWaypointControl_obj1_Bindings()
      {
          InitializeTracking(this);
      }
  
      void Connect(int __connectionId, ::Platform::Object^ __target)
      {
          switch(__connectionId)
          {
              case 5:
                  this->obj5 = safe_cast<::Windows::UI::Xaml::Controls::TextBlock^>(__target);
                  break;
              case 6:
                  this->obj6 = safe_cast<::Windows::UI::Xaml::Controls::ComboBox^>(__target);
                  this->obj6->RegisterPropertyChangedCallback(::Windows::UI::Xaml::Controls::Primitives::Selector::SelectedValueProperty,
                      ref new ::Windows::UI::Xaml::DependencyPropertyChangedCallback( 
                          [this] (::Windows::UI::Xaml::DependencyObject^ sender, Windows::UI::Xaml::DependencyProperty^ prop)
                          {
                              if (this->IsInitialized())
                              {
                                  // Update Two Way binding
                                  this->GetDataRoot()->OptionOfInput = safe_cast<::RoutesOverBingMapsApp::WaypointInputOption>(this->obj6->SelectedValue);
                              }
                          }));
                  break;
              case 7:
                  this->obj7 = safe_cast<::Windows::UI::Xaml::Controls::AutoSuggestBox^>(__target);
                  this->obj7->RegisterPropertyChangedCallback(::Windows::UI::Xaml::Controls::AutoSuggestBox::TextProperty,
                      ref new ::Windows::UI::Xaml::DependencyPropertyChangedCallback( 
                          [this] (::Windows::UI::Xaml::DependencyObject^ sender, Windows::UI::Xaml::DependencyProperty^ prop)
                          {
                              if (this->IsInitialized())
                              {
                                  // Update Two Way binding
                                  this->GetDataRoot()->Address = this->obj7->Text;
                              }
                          }));
                  break;
              case 8:
                  this->obj8 = safe_cast<::Windows::UI::Xaml::Controls::TextBox^>(__target);
                  this->obj8->LostFocus += ref new Windows::UI::Xaml::RoutedEventHandler(
                          [this] (::Platform::Object^ sender, ::Windows::UI::Xaml::RoutedEventArgs^ e)
                          {
                              if (this->IsInitialized())
                              {
                                  // Update Two Way binding
                                  this->GetDataRoot()->Latitude = safe_cast<::default::float64>(this->LookupConverter("FromString2Double")->ConvertBack(this->obj8->Text, ::default::float64::typeid, nullptr, nullptr));
                              }
                          });
                  break;
              case 9:
                  this->obj9 = safe_cast<::Windows::UI::Xaml::Controls::TextBox^>(__target);
                  this->obj9->LostFocus += ref new Windows::UI::Xaml::RoutedEventHandler(
                          [this] (::Platform::Object^ sender, ::Windows::UI::Xaml::RoutedEventArgs^ e)
                          {
                              if (this->IsInitialized())
                              {
                                  // Update Two Way binding
                                  this->GetDataRoot()->Longitude = safe_cast<::default::float64>(this->LookupConverter("FromString2Double")->ConvertBack(this->obj9->Text, ::default::float64::typeid, nullptr, nullptr));
                              }
                          });
                  break;
          }
      }
  
      void SetConverterLookupRoot(::Windows::UI::Xaml::FrameworkElement^ rootElement)
      {
          this->converterLookupRoot = rootElement;
      }
  
      ::Windows::UI::Xaml::Data::IValueConverter^ LookupConverter(::Platform::String^ key)
      {
          if (this->localResources == nullptr)
          {
              this->localResources = this->converterLookupRoot.Resolve<::Windows::UI::Xaml::FrameworkElement>()->Resources;
              this->converterLookupRoot = nullptr;
              }
          return safe_cast<::Windows::UI::Xaml::Data::IValueConverter^>(this->localResources->HasKey(key) ? this->localResources->Lookup(key) : ::Windows::UI::Xaml::Application::Current->Resources->Lookup(key));
      }
  
  private:
      // Fields for each control that has bindings.
      ::Windows::UI::Xaml::Controls::TextBlock^ obj5;
      ::Windows::UI::Xaml::Controls::ComboBox^ obj6;
      ::Windows::UI::Xaml::Controls::AutoSuggestBox^ obj7;
      ::Windows::UI::Xaml::Controls::TextBox^ obj8;
      ::Windows::UI::Xaml::Controls::TextBox^ obj9;
      
      // Fields for binding tracking.
      ::Platform::WeakReference cachePC_;
      ::Windows::Foundation::EventRegistrationToken tokenPC_;
  
      // Update methods for each path node used in binding steps.
      void Update_(::RoutesOverBingMapsApp::MyWaypointControl^ obj, int phase)
      {
          this->_bindingsTracking->UpdatePropertyChangedListener(obj, this->cachePC_, &tokenPC_);
          if (obj != nullptr)
          {
              if ((phase & (NOT_PHASED | DATA_CHANGED | (1 << 0))) != 0)
              {
                  this->Update_Order(obj->Order, phase);
              }
              if ((phase & (NOT_PHASED | (1 << 0))) != 0)
              {
                  this->Update_InputOptions(obj->InputOptions, phase);
              }
              if ((phase & (NOT_PHASED | DATA_CHANGED | (1 << 0))) != 0)
              {
                  this->Update_OptionOfInput(obj->OptionOfInput, phase);
                  this->Update_Address(obj->Address, phase);
                  this->Update_Latitude(obj->Latitude, phase);
                  this->Update_Longitude(obj->Longitude, phase);
              }
          }
      }
      void Update_Order(::default::int32 obj, int phase)
      {
          if((phase & ((1 << 0) | NOT_PHASED | DATA_CHANGED)) != 0)
          {
              ::XamlBindingInfo::XamlBindingSetters::Set_Windows_UI_Xaml_Controls_TextBlock_Text(this->obj5, obj.ToString(), nullptr);
          }
      }
      void Update_InputOptions(::Windows::Foundation::Collections::IObservableVector<::RoutesOverBingMapsApp::WayptInputComboOpt^>^ obj, int phase)
      {
          if((phase & ((1 << 0) | NOT_PHASED )) != 0)
          {
              ::XamlBindingInfo::XamlBindingSetters::Set_Windows_UI_Xaml_Controls_ItemsControl_ItemsSource(this->obj6, obj, nullptr);
          }
      }
      void Update_OptionOfInput(::RoutesOverBingMapsApp::WaypointInputOption obj, int phase)
      {
          if((phase & ((1 << 0) | NOT_PHASED | DATA_CHANGED)) != 0)
          {
              ::XamlBindingInfo::XamlBindingSetters::Set_Windows_UI_Xaml_Controls_Primitives_Selector_SelectedValue(this->obj6, obj, nullptr);
          }
      }
      void Update_Address(::Platform::String^ obj, int phase)
      {
          if((phase & ((1 << 0) | NOT_PHASED | DATA_CHANGED)) != 0)
          {
              ::XamlBindingInfo::XamlBindingSetters::Set_Windows_UI_Xaml_Controls_AutoSuggestBox_Text(this->obj7, obj, nullptr);
          }
      }
      void Update_Latitude(::default::float64 obj, int phase)
      {
          if((phase & ((1 << 0) | NOT_PHASED | DATA_CHANGED)) != 0)
          {
              ::XamlBindingInfo::XamlBindingSetters::Set_Windows_UI_Xaml_Controls_TextBox_Text(this->obj8, safe_cast<::Platform::String^>(this->LookupConverter("FromString2Double")->Convert(obj, ::Platform::String::typeid, nullptr, nullptr)), nullptr);
          }
      }
      void Update_Longitude(::default::float64 obj, int phase)
      {
          if((phase & ((1 << 0) | NOT_PHASED | DATA_CHANGED)) != 0)
          {
              ::XamlBindingInfo::XamlBindingSetters::Set_Windows_UI_Xaml_Controls_TextBox_Text(this->obj9, safe_cast<::Platform::String^>(this->LookupConverter("FromString2Double")->Convert(obj, ::Platform::String::typeid, nullptr, nullptr)), nullptr);
          }
      }
  
      virtual void ReleaseAllListeners() override
      {
          this->_bindingsTracking->UpdatePropertyChangedListener(nullptr, this->cachePC_, &tokenPC_);
      }
  
      virtual void PropertyChanged(Platform::Object^ sender, ::Windows::UI::Xaml::Data::PropertyChangedEventArgs^ e) override
      {
          if (this->GetDataRoot() != nullptr && this->GetDataRoot()->Equals(sender))
          {
              ::Platform::String^ propName = e->PropertyName;
              ::RoutesOverBingMapsApp::MyWaypointControl^ obj = safe_cast<::RoutesOverBingMapsApp::MyWaypointControl^>(sender);
              if (propName == nullptr || propName->IsEmpty())
              {
                  if (obj != nullptr)
                  {
                      this->Update_Order(obj->Order, DATA_CHANGED);
                      this->Update_OptionOfInput(obj->OptionOfInput, DATA_CHANGED);
                      this->Update_Address(obj->Address, DATA_CHANGED);
                      this->Update_Latitude(obj->Latitude, DATA_CHANGED);
                      this->Update_Longitude(obj->Longitude, DATA_CHANGED);
                  }
              }
              else if (propName == "Order")
              {
                  if (obj != nullptr)
                  {
                      this->Update_Order(obj->Order, DATA_CHANGED);
                  }
              }
              else if (propName == "OptionOfInput")
              {
                  if (obj != nullptr)
                  {
                      this->Update_OptionOfInput(obj->OptionOfInput, DATA_CHANGED);
                  }
              }
              else if (propName == "Address")
              {
                  if (obj != nullptr)
                  {
                      this->Update_Address(obj->Address, DATA_CHANGED);
                  }
              }
              else if (propName == "Latitude")
              {
                  if (obj != nullptr)
                  {
                      this->Update_Latitude(obj->Latitude, DATA_CHANGED);
                  }
              }
              else if (propName == "Longitude")
              {
                  if (obj != nullptr)
                  {
                      this->Update_Longitude(obj->Longitude, DATA_CHANGED);
                  }
              }
          }
      }
  
      void CollectionChanged(::Platform::Object^ sender, ::Windows::UI::Xaml::Interop::NotifyCollectionChangedEventArgs^ e)
      {
      }
  
      void VectorChanged(::Platform::Object^ sender, ::Windows::Foundation::Collections::IVectorChangedEventArgs^ e)
      {
      }
  
      void MapChanged(::Platform::Object^ sender, ::Windows::Foundation::Collections::IMapChangedEventArgs<::Platform::String^>^ e)
      {
      }
  
      void DependencyPropertyChanged(::Windows::UI::Xaml::DependencyObject^ sender, Windows::UI::Xaml::DependencyProperty^ prop)
      {
          if (sender != nullptr)
          {
          }
      }
  };
  
  void ::RoutesOverBingMapsApp::MyWaypointControl::Connect(int __connectionId, ::Platform::Object^ __target)
  {
      switch (__connectionId)
      {
      case 1:
          {
              ::Windows::UI::Xaml::Controls::UserControl^ element1 = safe_cast<::Windows::UI::Xaml::Controls::UserControl^>(__target);
              (safe_cast<::Windows::UI::Xaml::Controls::UserControl^>(element1))->DataContextChanged += ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Xaml::FrameworkElement^, ::Windows::UI::Xaml::DataContextChangedEventArgs^>(this, (void (::RoutesOverBingMapsApp::MyWaypointControl::*)
                  (::Windows::UI::Xaml::FrameworkElement^, ::Windows::UI::Xaml::DataContextChangedEventArgs^))&MyWaypointControl::OnDataContextChanged);
          }
          break;
      case 2:
          {
              this->wideState = safe_cast<::Windows::UI::Xaml::VisualState^>(__target);
          }
          break;
      case 3:
          {
              this->narrowState = safe_cast<::Windows::UI::Xaml::VisualState^>(__target);
          }
          break;
      case 4:
          {
              this->waitingRing = safe_cast<::Windows::UI::Xaml::Controls::ProgressRing^>(__target);
          }
          break;
      case 6:
          {
              this->wayptInputTypeComboBox = safe_cast<::Windows::UI::Xaml::Controls::ComboBox^>(__target);
              (safe_cast<::Windows::UI::Xaml::Controls::ComboBox^>(this->wayptInputTypeComboBox))->SelectionChanged += ref new ::Windows::UI::Xaml::Controls::SelectionChangedEventHandler(this, (void (::RoutesOverBingMapsApp::MyWaypointControl::*)
                  (::Platform::Object^, ::Windows::UI::Xaml::Controls::SelectionChangedEventArgs^))&MyWaypointControl::OnSelChangedInputOptCBox);
          }
          break;
      case 7:
          {
              this->addressASBox = safe_cast<::Windows::UI::Xaml::Controls::AutoSuggestBox^>(__target);
              (safe_cast<::Windows::UI::Xaml::Controls::AutoSuggestBox^>(this->addressASBox))->TextChanged += ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Xaml::Controls::AutoSuggestBox^, ::Windows::UI::Xaml::Controls::AutoSuggestBoxTextChangedEventArgs^>(this, (void (::RoutesOverBingMapsApp::MyWaypointControl::*)
                  (::Windows::UI::Xaml::Controls::AutoSuggestBox^, ::Windows::UI::Xaml::Controls::AutoSuggestBoxTextChangedEventArgs^))&MyWaypointControl::OnTextChangedAddrASBox);
              (safe_cast<::Windows::UI::Xaml::Controls::AutoSuggestBox^>(this->addressASBox))->SuggestionChosen += ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Xaml::Controls::AutoSuggestBox^, ::Windows::UI::Xaml::Controls::AutoSuggestBoxSuggestionChosenEventArgs^>(this, (void (::RoutesOverBingMapsApp::MyWaypointControl::*)
                  (::Windows::UI::Xaml::Controls::AutoSuggestBox^, ::Windows::UI::Xaml::Controls::AutoSuggestBoxSuggestionChosenEventArgs^))&MyWaypointControl::OnSuggestionChosenAddrASBox);
              (safe_cast<::Windows::UI::Xaml::Controls::AutoSuggestBox^>(this->addressASBox))->QuerySubmitted += ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Xaml::Controls::AutoSuggestBox^, ::Windows::UI::Xaml::Controls::AutoSuggestBoxQuerySubmittedEventArgs^>(this, (void (::RoutesOverBingMapsApp::MyWaypointControl::*)
                  (::Windows::UI::Xaml::Controls::AutoSuggestBox^, ::Windows::UI::Xaml::Controls::AutoSuggestBoxQuerySubmittedEventArgs^))&MyWaypointControl::OnQuerySubmittedAddrASBox);
          }
          break;
      case 8:
          {
              this->latitudeTextBox = safe_cast<::Windows::UI::Xaml::Controls::TextBox^>(__target);
          }
          break;
      case 9:
          {
              this->longitudeTextBox = safe_cast<::Windows::UI::Xaml::Controls::TextBox^>(__target);
          }
          break;
      case 10:
          {
              this->locateButton = safe_cast<::Windows::UI::Xaml::Controls::Button^>(__target);
              (safe_cast<::Windows::UI::Xaml::Controls::Button^>(this->locateButton))->Click += ref new ::Windows::UI::Xaml::RoutedEventHandler(this, (void (::RoutesOverBingMapsApp::MyWaypointControl::*)
                  (::Platform::Object^, ::Windows::UI::Xaml::RoutedEventArgs^))&MyWaypointControl::OnClickLocateButton);
          }
          break;
      }
      _contentLoaded = true;
  }
  
  ::Windows::UI::Xaml::Markup::IComponentConnector^ ::RoutesOverBingMapsApp::MyWaypointControl::GetBindingConnector(int __connectionId, ::Platform::Object^ __target)
  {
      ::XamlBindingInfo::XamlBindings^ bindings = nullptr;
      switch (__connectionId)
      {
          case 1:
              {
                  ::Windows::UI::Xaml::Controls::UserControl^ element1 = safe_cast<::Windows::UI::Xaml::Controls::UserControl^>(__target);
                  MyWaypointControl_obj1_Bindings* objBindings = new MyWaypointControl_obj1_Bindings();
                  objBindings->SetDataRoot(this);
                  objBindings->SetConverterLookupRoot(this);
                  bindings = ref new ::XamlBindingInfo::XamlBindings(objBindings);
                  this->Bindings = bindings;
                  element1->Loading += ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Xaml::FrameworkElement^, ::Platform::Object^>(bindings, &::XamlBindingInfo::XamlBindings::Loading);
              }
              break;
          case 11:
              {
                  ::Windows::UI::Xaml::Controls::TextBlock^ element11 = safe_cast<::Windows::UI::Xaml::Controls::TextBlock^>(__target);
                  MyWaypointControl_obj11_Bindings* objBindings = new MyWaypointControl_obj11_Bindings();
                  objBindings->SetDataRoot(element11->DataContext);
                  bindings = ref new ::XamlBindingInfo::XamlBindings(objBindings);
                  bindings->SubscribeForDataContextChanged(element11);
                  ::Windows::UI::Xaml::DataTemplate::SetExtensionInstance(element11, bindings);
              }
              break;
      }
      return bindings;
  }
  
  #pragma warning(pop)
  
  
  