MainPage.xaml.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. //*********************************************************
  2. //
  3. // Copyright (c) Microsoft. All rights reserved.
  4. // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
  5. // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
  6. // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
  7. // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
  8. //
  9. //*********************************************************
  10. //
  11. // MainPage.xaml.h
  12. // Declaration of the MainPage.xaml class.
  13. //
  14. #pragma once
  15. #include "pch.h"
  16. #include "MainPage.g.h"
  17. #include "Common\LayoutAwarePage.h" // Required by generated header
  18. #include "Constants.h"
  19. namespace SDKSample
  20. {
  21. public enum class NotifyType
  22. {
  23. StatusMessage,
  24. ErrorMessage
  25. };
  26. public ref class MainPageSizeChangedEventArgs sealed
  27. {
  28. public:
  29. property Windows::UI::ViewManagement::ApplicationViewState ViewState
  30. {
  31. Windows::UI::ViewManagement::ApplicationViewState get()
  32. {
  33. return viewState;
  34. }
  35. void set(Windows::UI::ViewManagement::ApplicationViewState value)
  36. {
  37. viewState = value;
  38. }
  39. }
  40. private:
  41. Windows::UI::ViewManagement::ApplicationViewState viewState;
  42. };
  43. public ref class MainPage sealed
  44. {
  45. public:
  46. MainPage();
  47. protected:
  48. virtual void LoadState(Platform::Object^ navigationParameter,
  49. Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^ pageState) override;
  50. virtual void SaveState(Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^ pageState) override;
  51. internal:
  52. property bool AutoSizeInputSectionWhenSnapped
  53. {
  54. bool get()
  55. {
  56. return autoSizeInputSectionWhenSnapped;
  57. }
  58. void set(bool value)
  59. {
  60. autoSizeInputSectionWhenSnapped = value;
  61. }
  62. }
  63. property Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ LaunchArgs
  64. {
  65. Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ get()
  66. {
  67. return safe_cast<App^>(App::Current)->LaunchArgs;
  68. }
  69. }
  70. void NotifyUser(Platform::String^ strMessage, NotifyType type);
  71. void LoadScenario(Platform::String^ scenarioName);
  72. event Windows::Foundation::EventHandler<Platform::Object^>^ ScenarioLoaded;
  73. event Windows::Foundation::EventHandler<MainPageSizeChangedEventArgs^>^ MainPageResized;
  74. private:
  75. void PopulateScenarios();
  76. void InvalidateSize();
  77. void InvalidateViewState();
  78. Platform::Collections::Vector<Object^>^ ScenarioList;
  79. Windows::UI::Xaml::Controls::Frame^ HiddenFrame;
  80. void Footer_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
  81. bool autoSizeInputSectionWhenSnapped;
  82. void MainPage_SizeChanged(Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
  83. void Scenarios_SelectionChanged(Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
  84. internal:
  85. static MainPage^ Current;
  86. };
  87. }