This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(Windows && Windows.ApplicationModel && Windows.ApplicationModel.Appointments) {} | |
// Create an Appointment that should be added the user's appointments provider app. | |
var appointment = new Windows.ApplicationModel.Appointments.Appointment(); | |
// Get the selection rect of the button pressed to add this appointment | |
var boundingRect = e.srcElement.getBoundingClientRect(); | |
var selectionRect = { x: boundingRect.left, y: boundingRect.top, width: boundingRect.width, height: boundingRect.height }; | |
// ShowAddAppointmentAsync returns an appointment id if the appointment given was added to the user's calendar. | |
// This value should be stored in app data and roamed so that the appointment can be replaced or removed in the future. | |
// An empty string return value indicates that the user canceled the operation before the appointment was added. | |
Windows.ApplicationModel.Appointments.AppointmentManager.showAddAppointmentAsync(appointment, selectionRect, Windows.UI.Popups.Placement.default) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(typeof Windows !== 'undefined' && | |
typeof Windows.UI !== 'undefined' && | |
typeof Windows.UI.Popups !== 'undefined' ) { | |
// Create the message dialog and set its content | |
var msg = new Windows.UI.Popups.MessageDialog(message); | |
// Add commands | |
msg.commands.append(new Windows.UI.Popups.UICommand("Okay", systemAlertCommandInvokedHandler)); | |
// Set default command | |
msg.defaultCommandIndex = 0; | |
// Show the message dialog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(Windows !== 'undefined' && | |
Windows.UI !== 'undefined' && | |
Windows.UI.Notifications !== 'undefined') { | |
var notifications = Windows.UI.Notifications; | |
//Get the XML template where the notification content will be suplied | |
var template = notifications.ToastTemplateType.toastImageAndText01; | |
var toastXml = notifications.ToastNotificationManager.getTemplateContent(template); | |
//Supply the text to the XML content | |
var toastTextElements = toastXml.getElementsByTagName("text"); | |
toastTextElements[0].appendChild(toastXml.createTextNode(message)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(typeof Windows != 'undefined') { | |
// Create the picker | |
var picker = new Windows.ApplicationModel.Contacts.ContactPicker(); | |
picker.desiredFieldsWithContactFieldType.append(Windows.ApplicationModel.Contacts.ContactFieldType.email); | |
// Open the picker for the user to select a contact | |
picker.pickContactAsync().done(function (contact) { | |
if (contact !== null) { | |
var output = "Selected contact:\n" + contact.displayName; | |
console.log(output); | |
} else { |
NewerOlder