www.pudn.com > Proximity-sample.zip > MainPage.xaml.h, change:2012-06-01,size:3274b


//********************************************************* 
// 
// Copyright (c) Microsoft. All rights reserved. 
// This code is licensed under the Microsoft Public License. 
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 
// 
//********************************************************* 
 
// 
// MainPage.xaml.h 
// Declaration of the MainPage.xaml class. 
// 
 
#pragma once 
 
#include "pch.h" 
#include "MainPage.g.h" 
#include "Common\LayoutAwarePage.h" // Required by generated header 
#include "Constants.h" 
 
namespace ProximityCPP 
{ 
    public enum class NotifyType 
    { 
        StatusMessage, 
        ErrorMessage 
    }; 
 
    public ref class MainPageSizeChangedEventArgs sealed 
    { 
    public: 
        property Windows::UI::ViewManagement::ApplicationViewState ViewState 
        { 
            Windows::UI::ViewManagement::ApplicationViewState get() 
            { 
                return viewState; 
            } 
 
            void set(Windows::UI::ViewManagement::ApplicationViewState value) 
            { 
                viewState = value; 
            } 
        } 
 
    private: 
        Windows::UI::ViewManagement::ApplicationViewState viewState; 
    }; 
 
    public ref class MainPage sealed 
    { 
    public: 
        MainPage(); 
        ~MainPage(); 
 
        property bool AutoSizeInputSectionWhenSnapped 
        { 
            bool get() 
            { 
                return autoSizeInputSectionWhenSnapped; 
            } 
 
            void set(bool value) 
            { 
                autoSizeInputSectionWhenSnapped = value; 
            } 
        } 
 
        property Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ LaunchArgs; 
 
        void NotifyUser(Platform::String^ strMessage, NotifyType type); 
        void LoadScenario(Platform::String^ scenarioName); 
        void ClearLog(Windows::UI::Xaml::Controls::TextBlock^ textBlock); 
        void LogInfo(Platform::String^ strMessage, Windows::UI::Xaml::Controls::TextBlock^ textBlock); 
        bool IsLaunchedByTap(); 
        event Windows::Foundation::EventHandler<Platform::Object^>^ ScenarioLoaded; 
        event Windows::Foundation::EventHandler<MainPageSizeChangedEventArgs^>^ MainPageResized; 
 
    private: 
        void SetFeatureName(Platform::String^ strFeature); 
        void PopulateScenarios(); 
        void InvalidateSize(); 
        void InvalidateViewState(); 
 
        Platform::Collections::Vector<Object^>^ ScenarioList; 
        Windows::UI::Xaml::Controls::Frame^ HiddenFrame; 
        void Footer_Click(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); 
        bool autoSizeInputSectionWhenSnapped; 
 
 
    protected: 
        virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override; 
        void MainPage_SizeChanged(Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e); 
        void Scenarios_SelectionChanged(Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e); 
 
    internal: 
        static MainPage^ Current; 
        bool   m_IsLaunchedByTap; 
 
    }; 
}