Movatterモバイル変換


[0]ホーム

URL:


Skip to main contentSkip to in-page navigation

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

ApplicationData.DataChanged Event

Definition

Namespace:
Windows.Storage

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Occurs when roaming application data is synchronized.

// Registerevent_token DataChanged(TypedEventHandler<ApplicationData, IInspectable const&> const& handler) const;// Revoke with event_tokenvoid DataChanged(event_token const* cookie) const;// Revoke with event_revokerApplicationData::DataChanged_revoker DataChanged(auto_revoke_t, TypedEventHandler<ApplicationData, IInspectable const&> const& handler) const;
public event TypedEventHandler<ApplicationData,object> DataChanged;
function onDataChanged(eventArgs) { /* Your code */ }applicationData.addEventListener("datachanged", onDataChanged);applicationData.removeEventListener("datachanged", onDataChanged);- or -applicationData.ondatachanged = onDataChanged;
Public Custom Event DataChanged As TypedEventHandler(Of ApplicationData, Object)

Event Type

Examples

This example registers for the DataChanged event.

void InitHandlers(){   Windows.Storage.ApplicationData.Current.DataChanged +=       new TypedEventHandler<ApplicationData, object>(DataChangeHandler);}void DataChangeHandler(Windows.Storage.ApplicationData appData, object o){   // TODO: Refresh your data}
void MainPage::InitHandlers(){    Windows::Storage::ApplicationData::Current().DataChanged({ this, &MainPage::DataChangeHandler });}void MainPage::DataChangeHandler(Windows::Storage::ApplicationData const& /* appData */, Windows::Foundation::IInspectable const& /* object */){    // TODO: Refresh your data.}
void MainPage::InitHandlers(){   Windows::Storage::ApplicationData::Current->DataChanged +=       ref new TypedEventHandler<Windows::Storage::ApplicationData^, Object^>      (this, &MainPage::DataChangeHandler);}void MainPage::DataChangeHandler(Windows::Storage::ApplicationData^ appData, Object^){   // TODO: Refresh your data}
Private Sub InitHandlers()    AddHandler Windows.Storage.ApplicationData.Current.DataChanged, AddressOf DataChangeHandlerEnd SubPrivate Sub DataChangeHandler(ByVal appData As Windows.Storage.ApplicationData, ByVal o As Object)    ' TODO: Refresh your dataEnd Sub

Remarks

The event handler receives anApplicationData object that provides access to the changed roaming data containers. For more information, seeRoaming data.

Applies to

See also


Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?