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));
}
}