Exemple #1
0
        /// <summary>
        /// Displays the tag device dialog.
        /// </summary>
        /// <returns>Task object used for tracking method completion.</returns>
        private async Task TagDeviceAsync()
        {
            TagInformation tagInfo = new TagInformation();

            tagInfo.Name = this.Name;

            ContentDialog dialog = new TagDeviceDialog(
                this.deviceMonitor.Address,
                tagInfo);
            ContentDialogResult result = await dialog.ShowAsync().AsTask <ContentDialogResult>();;

            // Primary button == "Ok"
            if (result == ContentDialogResult.Primary)
            {
                this.Name = tagInfo.Name;

                if (tagInfo.DeployNameToDevice)
                {
                    // Set the device name.
                    if (await this.deviceMonitor.SetDeviceNameAsync(this.Name))
                    {
                        // Reboot the device so the name change takes effect.
                        await this.deviceMonitor.RebootAsync();
                    }
                }

                this.deviceMonitorControl.NotifyTagChanged();
            }
        }
Exemple #2
0
        /// <summary>
        /// Displays the tag device dialog.
        /// </summary>
        /// <returns>Task object used for tracking method completion.</returns>
        private async Task TagDeviceAsync()
        {
            TagInformation tagInfo = new TagInformation();

            tagInfo.Name = this.Name;

            ContentDialog dialog = new TagDeviceDialog(
                this.deviceMonitor.Address,
                tagInfo);
            ContentDialogResult result = await dialog.ShowAsync().AsTask <ContentDialogResult>();;

            // Primary button == "Ok"
            if (result == ContentDialogResult.Primary)
            {
                this.Name = tagInfo.Name;
                this.deviceMonitorControl.NotifyTagChanged();
            }
        }