1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ViewModel のひな型

Last updated at Posted at 2013-12-01
ViewModel.h
# pragma once

# include "Common/RelayCommand.h"

namespace テキトーな名前空間 {

    namespace cx {
      namespace xaml  = Windows::UI::Xaml;
      namespace data  = Windows::UI::Xaml::Data;
      namespace input = Windows::UI::Xaml::Input;
    }

    [Windows::UI::Xaml::Data::Bindable]
    public ref class ViewModel sealed : cx::data::INotifyPropertyChanged{
    public:
        ViewModel();
        virtual event cx::data::PropertyChangedEventHandler^ PropertyChanged;

    private:
        void RaisePropertyChanged(Platform::String^ propertyName);
    };

}
ViewModel.cpp
# include "pch.h"
# include "ViewModel.h"

using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Data;

namespace テキトーな名前空間 {

    ViewModel::ViewModel() { }

    void ViewModel::RaisePropertyChanged(String^ propertyName) {
        PropertyChanged(this, ref new PropertyChangedEventArgs(propertyName));
    }
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?