Exemplo n.º 1
0
 private void ContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     Text_Channel.Text    = _channel.Name;
     Text_Source.Text     = _source.StationName;
     StartDatePicker.Date = DateTimeOffset.Now;
     EndDatePicker.Date   = DateTimeOffset.Now.Add(TimeSpan.FromMinutes(5));
 }
Exemplo n.º 2
0
 private void OnDialogOpened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     username.ClearValue(TextBox.TextProperty);
     pwd.ClearValue(PasswordBox.PasswordProperty);
     pwd2.ClearValue(PasswordBox.PasswordProperty);
     msg.ClearValue(TextBlock.TextProperty);
 }
Exemplo n.º 3
0
 private void AddDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     AddDialog.PrimaryButtonText = "保存";
     TitleBox.Text       = currentNote.Title;
     TitleBox.IsReadOnly = false;
     WarnText.Text       = "";
 }
Exemplo n.º 4
0
 private async void OnOpened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     if (Presenter.Children.Count > 0)
     {
         await TranslateTokenAsync(Presenter.Children[0] as LoadingTextBlock);
     }
 }
Exemplo n.º 5
0
        private void ActionDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            // HACK: Tweak the ContentDialog to show expanded content.
            //
            // I'm really not a fan of hacks like this. They're brittle and if done wrong
            // they can actually crash apps. But unfortunately the inner template for
            // ContentDialog is not easily changed and having the "don't remind me again"
            // check box floating up near the content looks really bad.
            //
            // Though the implementation below is brittle, at least it should not crash
            // if the default template changes and is not likely to break existing content.
            // JB - 2016-03-29


            // Try to find a parent Grid control
            FrameworkElement parent = VisualTreeHelper.GetParent(LayoutRoot) as FrameworkElement;
            var parentGrid          = parent as Grid;

            while ((parent != null) && (parentGrid == null))
            {
                parent     = VisualTreeHelper.GetParent(parent) as FrameworkElement;
                parentGrid = parent as Grid;
            }

            // If found
            if (parentGrid != null)
            {
                // And it has exactly two rows
                if (parentGrid.RowDefinitions.Count == 2)
                {
                    // Assume it's the right one and expand the content area (second row)
                    parentGrid.RowDefinitions[1].Height = new GridLength(1, GridUnitType.Star);
                }
            }
        }
Exemplo n.º 6
0
        private async void LoadContent(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            // If we are not logged in, close the dialog
            if (!SoundByteService.Instance.IsSoundCloudAccountConnected)
            {
                Hide();
                await new MessageDialog("You need to be logged in to perform this task :/").ShowAsync();
                return;
            }

            // We are loading content
            LoadingRing.IsActive = true;

            _blockItemsLoading = true;

            // Get a list of the user playlists
            var userPlaylists = await SoundByteService.Instance.GetAsync <List <Playlist> >("/me/playlists");

            Playlist.Clear();

            // Loop though all the playlists
            foreach (var playlist in userPlaylists)
            {
                // Check if the track in in the playlist
                playlist.IsTrackInInternalSet = playlist.Tracks?.FirstOrDefault(x => x.Id == Track.Id) != null;

                // Add the track to the UI
                Playlist.Add(playlist);
            }

            _blockItemsLoading = false;

            // We are done loading content
            LoadingRing.IsActive = false;
        }
Exemplo n.º 7
0
 private void DialogOnOpened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     this.ViewModel.Closed += OnClosed;
     this.PrimaryButtonText = !this.ViewModel.Award.IsGranted
         ? this.ViewModel.InstallText
         : string.Empty;
 }
Exemplo n.º 8
0
 private void BinaryDetailsInputDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     // Reset the state
     BinaryDetailsInputDialog.IsPrimaryButtonEnabled = false;
     BinaryDetailsWidthTextBox.Text  = "0";
     BinaryDetailsHeightTextBox.Text = "0";
 }
Exemplo n.º 9
0
        private async void InkRecoDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            // Insert the M2_OnRecognize snippet here
            var currentStrokes =
                NotesInkCanvas.InkPresenter.StrokeContainer.GetStrokes();

            if (currentStrokes.Count > 0)
            {
                var recognitionResults = await _inkRecognizerContainer.RecognizeAsync(
                    NotesInkCanvas.InkPresenter.StrokeContainer,
                    InkRecognitionTarget.All);

                if (recognitionResults.Count > 0)
                {
                    // Display recognition result
                    var str = string.Empty;
                    foreach (var r in recognitionResults)
                    {
                        str += $"{r.GetTextCandidates()[0]} ";
                    }
                    Status.Text = str;
                    InkRecoDialog.IsPrimaryButtonEnabled = true;
                }
                else
                {
                    Status.Text = "No text recognized.";
                }
            }
            else
            {
                Status.Text = "Must first write something.";
            }
        }
        private void AdditionalTechnologyAreasPicker_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            if (_cvs == null)
            {
                BusyIndicator.IsActive = true;

                _cvs = new CollectionViewSource
                {
                    Source          = Context.CategoryAreas,
                    IsSourceGrouped = true,
                    ItemsPath       = new PropertyPath("ContributionAreas")
                };

                TechnologyAreasListView.ItemsSource = _cvs.View;

                BusyIndicator.IsActive = false;
            }

            foreach (var contributionTechnologyModel in Context.SelectedContribution.AdditionalTechnologies)
            {
                Debug.WriteLine($"Item Added");

                TechnologyAreasListView.SelectedItems.Add(contributionTechnologyModel);
            }
        }
Exemplo n.º 11
0
 private void OnOpened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     if (Window.Current.Content is RootPage root)
     {
         root.PopupOpened();
     }
 }
Exemplo n.º 12
0
        private async void WhatsNewDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            App.Telemetry.TrackPage("What's New Dialog");

            ProgressRing.IsActive = true;

            try
            {
                // Get the changelog string from the azure api
                using (var httpClient = new HttpClient())
                {
                    var changelog =
                        await httpClient.GetStringAsync(
                            new Uri(
                                $"https://soundbytemedia.com/api/v1/app/changelog?platform=uwp&version={Package.Current.Id.Version.Major}.{Package.Current.Id.Version.Minor}.{Package.Current.Id.Version.Build}"));

                    ChangelogView.Text = changelog;
                }
            }
            catch (Exception)
            {
                ChangelogView.Text = "*Error:* An error occured while getting the changelog.";
            }
            finally
            {
                ProgressRing.IsActive = false;
            }
        }
Exemplo n.º 13
0
 private void ContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     _profilesService = ProfilesService.Instance;
     if (_profilesService.ExistProfile(Ssid))
     {
         ReplaceWarningTextBlock.Visibility = Visibility.Visible;
     }
 }
Exemplo n.º 14
0
 private void ContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     //Reset value
     DialogResult = DialogResult.None;
     //
     SaveDialogYes.Focus(FocusState.Keyboard);
     IsOpen = true;
 }
Exemplo n.º 15
0
        private async void ContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            var pbStation = TelevisionService.Instance.TelevisionStations.First(station => station is IPlaybackStation) as ITelevisionStation;

            ChannelPicker.ItemsSource   = (await pbStation.GetChannelList()).Select(program => program.ProgramInfo.Channel).Distinct();
            ChannelPicker.SelectedIndex = 0;
            StartDatePicker.Date        = EndDatePicker.Date = DateTimeOffset.Now;
        }
 private void BleDeviceSelectorDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     Result = null;
     BluetoothManager.LEScanner.Added   += LEScanner_Added;
     BluetoothManager.LEScanner.Removed += LEScanner_Removed;
     BluetoothManager.LEScanner.EnumerationCompleted += LEScanner_EnumerationCompleted;
     BluetoothManager.LEScanner.Stopped += LEScanner_Stopped;
     BluetoothManager.LEScanner.Start();
 }
        private void ContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            var dc = DataContext as CreateRelationDialogViewModel;

            if (dc != null)
            {
                dc.Init();
            }
        }
Exemplo n.º 18
0
        private void ContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            var dc = DataContext as SelectEntityDialogViewModel;

            if (dc != null)
            {
                dc.Init();
            }
        }
Exemplo n.º 19
0
        private void TLContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            var button = GetTemplateChild("PrimaryButton") as Button;

            if (button != null)
            {
                button.Focus(FocusState.Keyboard);
            }
        }
Exemplo n.º 20
0
        private void AddPlayerDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            // Ensure that the OK button is disabled and player name field empty each time the dialog opens.
            playerName.Text = "";
            IsPrimaryButtonEnabled = false;

            // try to put the cursor to the name field (does not necessarily work every time)
            playerName.Focus(Windows.UI.Xaml.FocusState.Programmatic);
        }
 /// <summary>
 /// Content Dialog setting values on open
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void ContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     // Get the selected user
     imgPerson.Source   = selSubject.imageObj;
     txtName.Text       = selSubject.first_name + " " + selSubject.last_name;
     txtRecordings.Text = selSubject.recording_count.ToString();
     txtUserRating.Text = selSubject.user_rating.ToString();
     // load user image
 }
Exemplo n.º 22
0
 private void Clear(object s, ContentDialogOpenedEventArgs e)
 {
     Nombre.Text              = string.Empty;
     FInicio.Date             = FFin.Date = DateTime.UtcNow;
     Esfuerzo.Text            = string.Empty;
     Requisitos.SelectionMode = default;
     Requisitos.SelectionMode = ListViewSelectionMode.Multiple;
     Recursos.SelectionMode   = default;
     Recursos.SelectionMode   = ListViewSelectionMode.Multiple;
 }
        private async void OnOpened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            var response = await _protoService.SendAsync(new GetVideoChatRtmpUrl(_chatId));

            if (response is RtmpUrl rtmp)
            {
                ServerField.Text    = rtmp.Url;
                StreamKeyField.Text = rtmp.StreamKey;
            }
        }
Exemplo n.º 24
0
        private void ContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            if (nfcDevice == null)
            {
                return;
            }

            nfcNDEFSubscriptionId    = nfcDevice.SubscribeForMessage("NDEF", messageReceivedHandler);
            nfcDevice.DeviceArrived += nfcDevice_DeviceArrived;
        }
Exemplo n.º 25
0
        private async void OslNoticeDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            string notice = null;

            using (var reader = new StreamReader("OSL"))
            {
                notice = await reader.ReadToEndAsync();
            }
            LicenseNoticeTextBox.Text = notice;
        }
        void SignInContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args) {
            this.Result = SignInResult.Nothing;

            // If the user name is saved, get it and populate the user name field.
            Windows.Storage.ApplicationDataContainer roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings;
            if (roamingSettings.Values.ContainsKey("userName")) {
                userNameTextBox.Text = roamingSettings.Values["userName"].ToString();
                saveUserNameCheckBox.IsChecked = true;
            }
        }
Exemplo n.º 27
0
 private void ContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     // If the user name is saved, get it and populate the user name field.
     Windows.Storage.ApplicationDataContainer roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings;
     if (roamingSettings.Values.ContainsKey(this.userNameKey))
     {
         this.userNameTextBox.Text           = roamingSettings.Values[this.userNameKey].ToString();
         this.saveUserNameCheckBox.IsChecked = true;
     }
 }
Exemplo n.º 28
0
        void SettingsDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            this.Result = ContentDialogResult.None;

            // If the user name is saved, get it and populate the user name field.
            Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            if (localSettings.Values.ContainsKey("ipAddress"))
            {
                ipAddress.Text = localSettings.Values["ipAddress"].ToString();
            }
        }
Exemplo n.º 29
0
 private void TLContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     if (string.IsNullOrWhiteSpace(TextField.Text))
     {
         TextField.Focus(FocusState.Programmatic);
     }
     else
     {
         LinkField.Focus(FocusState.Programmatic);
     }
 }
Exemplo n.º 30
0
 private async void Open_Event(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     timer2.Interval        = new TimeSpan(0, 0, 1);
     timer2.Tick           += timer2_Tick_Event;
     secondscount           = 0;
     HoursTextBlock1.Text   = "00";
     MinutesTextBlock1.Text = "00";
     SecondsTextBlock1.Text = "00";
     await SetupUiAsync();
     await InitializeCameraAsync();
     await StartRecordingAsync();
 }
 private void ContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     _socketBackup     = socketTextBox.Text;
     _liftSetupBackup  = liftSetupTextBox.Text;
     _propSetupBackup  = propSetupTextBox.Text;
     _servoSetupBackup = servoSetupTextBox.Text;
     _controlIntervalMillisecondsBackup = controlIntervalMillisecondsTextBox.Text;
     _liftPulseRatiosBackup             = liftPulsesRatiosTextBox.Text;
     _propPulseRatiosBackup             = propPulsesRatiosTextBox.Text;
     _servoPulseCorrectionBackup        = servoPulseCorrectionTextBox.Text;
     _boostBackup = boostSetupTextBox.Text;
 }
        private void TermsOfUseContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            for (int i = 0; i < 50; i++)
            {
                AttendList.Items.Add(i);
                HeldList.Items.Add(i);
            }

            for (int i = 0; i < 100; i++)
            {
                PercentReq.Items.Add(i);
            }
        }
Exemplo n.º 33
0
        public async void Clear(object sender, ContentDialogOpenedEventArgs e)
        {
            box.Items.Clear();

            foreach (Windows.Storage.StorageFile json in await DataHelper.Folder.GetFilesAsync())
            {
                box.Items.Add(json.DisplayName);
            }

            box.SelectedIndex = -1;
            box.IsEnabled     = box.Items.Count > 0;
            pName.Text        = string.Empty;
        }
        private void OnDialogOpened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            this.ViewModel   = ServiceRegistry.ViewModelFactory.CreateLoginViewModel();
            this.DataContext = this.ViewModel;

            this.LoginWebView.Visibility     = Visibility.Collapsed;
            this.LoadingContainer.Visibility = Visibility.Visible;

            this.LoginWebView.LoadCompleted      += OnWebViewLoadCompleted;
            this.LoginWebView.NavigationStarting += OnWebViewNavigationStarting;

            this.LoginWebView.Navigate(new Uri(this.ViewModel.LoginUri));
        }
    private async void ContentDialog_Opened (ContentDialog sender, ContentDialogOpenedEventArgs args) {

      var cancellationToken = cancellationTokenSource.Token;

      var filter = GattDeviceService.GetDeviceSelectorFromUuid(DeviceInformationServiceUuid);
      var devices = await DeviceInformation.FindAllAsync(filter, new[] { ContainerIdProperty });
      if (devices.Count > 0) {
        foreach (var device in devices) {
          try {
            deviceList.Add(device);
            var decodedDeviceName = await device.GetDeviceName(cancellationToken);
            deviceCollection.Add(decodedDeviceName);
          } catch (NullReferenceException) {
            //デバイス見つからんかったら多分こっち来るねんな
            MessageTextBlock.Text = loader.GetString("NotFoundDevices");
            CollapseStoryboard.Begin();
          }
        }
      }
    }
 private void RenameDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     renameTextBox.Text = (ModuleList.SelectedItem as Module).Name;
 }
		private void TemperatureEditControl_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
		{
		}
 private void TermsOfUseContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     // Ensure that the check box is unchecked each time the dialog opens.
    ConfirmAgeCheckBox.IsChecked = false;
 }
Exemplo n.º 39
0
        private void LoginDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            this.Result = LoginResult.Nothing;

            UserNameTextBox.Text = Credentials.GetUsernameFromLocker();
            if (!string.IsNullOrWhiteSpace(UserNameTextBox.Text))
                PasswordTextBox.Focus(FocusState.Programmatic);
        }
Exemplo n.º 40
0
        private void loginDialog_opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {

        }
 private void ContentDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
 {
     txtValue.Focus(Windows.UI.Xaml.FocusState.Keyboard);
 }
Exemplo n.º 42
0
        private void ActionDialog_Opened(ContentDialog sender, ContentDialogOpenedEventArgs args)
        {
            // HACK: Tweak the ContentDialog to show expanded content.
            //
            // I'm really not a fan of hacks like this. They're brittle and if done wrong
            // they can actually crash apps. But unfortunately the inner template for
            // ContentDialog is not easily changed and having the "don't remind me again"
            // check box floating up near the content looks really bad.
            //
            // Though the implementation below is brittle, at least it should not crash
            // if the default template changes and is not likely to break existing content.
            // JB - 2016-03-29

            // Try to find a parent Grid control
            FrameworkElement parent = VisualTreeHelper.GetParent(LayoutRoot) as FrameworkElement;
            var parentGrid = parent as Grid;
            while ((parent != null) && (parentGrid == null))
            {
                parent = VisualTreeHelper.GetParent(parent) as FrameworkElement;
                parentGrid = parent as Grid;
            }

            // If found
            if (parentGrid != null)
            {
                // And it has exactly two rows
                if (parentGrid.RowDefinitions.Count == 2)
                {
                    // Assume it's the right one and expand the content area (second row)
                    parentGrid.RowDefinitions[1].Height = new GridLength(1, GridUnitType.Star);
                }
            }
        }