text: ﻿#include "pch.h"
  
  using namespace ClipboardManager::Base::Components;
  
  using namespace Platform;
  using namespace Windows::UI::Xaml;
  using namespace Windows::UI::Xaml::Controls;
  using namespace Windows::UI::Xaml::Documents;
  using namespace Windows::UI::Xaml::Media;
  
  #pragma region Constructor
  
  ClipboardManager::Base::Components::PopupFlyout::PopupFlyout()
  {
  	PopupMinHeight = 180.0;
  	PopupMaxHeight = 180.0;
  	PopupMinWidth = 280.0;
  	PopupMaxWidth = 280.0;
  	InitializeComponent();
  }
  
  #pragma endregion
  
  #pragma region Properties
  
  #pragma region PopupIcon
  
  String^ ClipboardManager::Base::Components::PopupFlyout::PopupIcon::get()
  {
  	return tbIcon->Text;
  }
  
  void ClipboardManager::Base::Components::PopupFlyout::PopupIcon::set(String^ value)
  {
  	tbIcon->Text = value;
  }
  
  #pragma endregion
  
  #pragma region PopupTitle
  
  String^ ClipboardManager::Base::Components::PopupFlyout::PopupTitle::get()
  {
  	return tbTitle->Text;
  }
  
  void ClipboardManager::Base::Components::PopupFlyout::PopupTitle::set(String^ value)
  {
  	tbTitle->Text = value;
  }
  
  #pragma endregion
  
  #pragma region PopupMessage
  
  String^ ClipboardManager::Base::Components::PopupFlyout::PopupMessage::get()
  {
  	return tbFlyoutMessage->Text;
  }
  
  void ClipboardManager::Base::Components::PopupFlyout::PopupMessage::set(String^ value)
  {
  	tbFlyoutMessage->Text = value;
  }
  
  #pragma endregion
  
  #pragma region PopupButtonCaption
  
  String^ ClipboardManager::Base::Components::PopupFlyout::PopupButtonCaption::get()
  {
  	return tbFlyoutButtonCaption->Text;
  }
  
  void ClipboardManager::Base::Components::PopupFlyout::PopupButtonCaption::set(String^ value)
  {
  	tbFlyoutButtonCaption->Text = value;
  }
  
  #pragma endregion
  
  #pragma region PopupButtonClickHandler
  
  RoutedEventHandler^ ClipboardManager::Base::Components::PopupFlyout::PopupButtonClickHandler::get()
  {
  	return _popupButtonClickHandler;
  }
  
  void ClipboardManager::Base::Components::PopupFlyout::PopupButtonClickHandler::set(RoutedEventHandler^ value)
  {
  	_popupButtonClickHandler = value;
  }
  
  #pragma endregion
  
  #pragma region PopupMinHeight
  
  double ClipboardManager::Base::Components::PopupFlyout::PopupMinHeight::get()
  {
  	return _popupMinHeight;
  }
  
  void ClipboardManager::Base::Components::PopupFlyout::PopupMinHeight::set(double value)
  {
  	_popupMinHeight = value;
  }
  
  #pragma endregion
  
  #pragma region PopupMaxHeight
  
  double ClipboardManager::Base::Components::PopupFlyout::PopupMaxHeight::get()
  {
  	return _popupMaxHeight;
  }
  
  void ClipboardManager::Base::Components::PopupFlyout::PopupMaxHeight::set(double value)
  {
  	_popupMaxHeight = value;
  }
  
  #pragma endregion
  
  #pragma region PopupMinWidth
  
  double ClipboardManager::Base::Components::PopupFlyout::PopupMinWidth::get()
  {
  	return _popupMinWidth;
  }
  
  void ClipboardManager::Base::Components::PopupFlyout::PopupMinWidth::set(double value)
  {
  	_popupMinWidth = value;
  }
  
  #pragma endregion
  
  #pragma region PopupMaxWidth
  
  double ClipboardManager::Base::Components::PopupFlyout::PopupMaxWidth::get()
  {
  	return _popupMaxWidth;
  }
  
  void ClipboardManager::Base::Components::PopupFlyout::PopupMaxWidth::set(double value)
  {
  	_popupMaxWidth = value;
  }
  
  #pragma endregion
  
  #pragma endregion
  
  #pragma region Methods
  
  #pragma region Public Methods
  
  Flyout^ ClipboardManager::Base::Components::PopupFlyout::CreateMessageFlyout(ElementTheme theme, String^ icon, String^ Message, String^ title)
  {
  	PopupFlyout^ flyout = ref new PopupFlyout();
  	flyout->PopupRequestedTheme = theme;
  	flyout->PopupIcon = icon;
  	flyout->PopupTitle = title;
  	flyout->PopupMessage = Message;
  	flyout->PopupButtonCaption = "OK";
  	return flyout;
  }
  
  Flyout^ ClipboardManager::Base::Components::PopupFlyout::CreateConfirmFlyout(ElementTheme theme, String^ Message, String^ ButtonCaption, RoutedEventHandler^ ButtonClick)
  {
  	PopupFlyout^ flyout = ref new PopupFlyout();
  	flyout->PopupRequestedTheme = theme;
  	flyout->PopupIcon = L"\xE11B";
  	flyout->PopupMessage = Message;
  	flyout->PopupButtonCaption = ButtonCaption;
  	flyout->PopupButtonClickHandler = ButtonClick;
  	return flyout;
  }
  
  #pragma endregion
  
  #pragma region Protected Methods
  
  Control^ ClipboardManager::Base::Components::PopupFlyout::CreatePresenter()
  {
  	Control^ result = ClipboardManagerFlyout::CreatePresenter();
  	result->MinHeight = PopupMinHeight;
  	result->MaxHeight = PopupMaxHeight;
  	result->MinWidth = PopupMinWidth;
  	result->MaxWidth = _popupMaxWidth;
  	return result;
  }
  
  #pragma endregion
  
  #pragma region Private Methods
  
  void ClipboardManager::Base::Components::PopupFlyout::btnClose_Click(Object^ sender, RoutedEventArgs^ e)
  {
  	Hide();
  }
  
  void ClipboardManager::Base::Components::PopupFlyout::btnAction_Click(Object^ sender, RoutedEventArgs^ e)
  {
  	if (PopupButtonClickHandler != nullptr)
  		PopupButtonClickHandler->Invoke(sender, e);
  	Hide();
  }
  
  #pragma endregion
  
  #pragma endregion