private async void BtnCountFeaturesClick(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { // Get the current visible extent. Geometry currentExtent = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry; // Create the query parameters. QueryParameters queryCityCount = new QueryParameters { Geometry = currentExtent, // Specify the interpretation of the Geometry query parameters. SpatialRelationship = SpatialRelationship.Intersects }; try { // Get the count of matching features. long count = await _featureTable.QueryFeatureCountAsync(queryCityCount); // Update the UI. ResultView.Text = $"{count} features in extent"; ResultView.Visibility = Visibility.Visible; } catch (Exception ex) { await new MessageDialog2(ex.ToString(), "Error").ShowAsync(); } }
private async void ShellView_Loaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { LoginDialog = new LoginDialog(OnLoginCompleted) { XamlRoot = App.CurrentWindow.Content.XamlRoot }; var refreshToken = StorageHelpers.Instance.LoadToken("refresh_token"); // We have a refresh token from a previous session if (!string.IsNullOrEmpty(refreshToken)) { // Use the refresh token to get a new access token var authorizationHeader = await LoginDialog.RequestAuthorizationAsync(refreshToken); // If the bearer token was returned, login if (!string.IsNullOrEmpty(authorizationHeader)) { await LoginDialog.InitializeMvpApiAsync(authorizationHeader); await ViewModel.OnLoadedAsync(); return; } } // all other cases fall down to needing the user to sign back in await LoginDialog.SignInAsync(); await ViewModel.OnLoadedAsync(); SelectTab(ViewType.Home); }
private void OnThemeRadioButtonChecked(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { string selectedTheme = ((RadioButton)sender).Tag.ToString(); if (!string.IsNullOrEmpty(selectedTheme)) { Enum.TryParse(typeof(ElementTheme), selectedTheme, out object theme); ThemeHelper.RootTheme = mainViewModel.CurrentTheme = (ElementTheme)theme; } }
private void ScheduleSwitch_Toggled(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { if ((sender as ToggleSwitch).IsOn) { TimePanel.Visibility = Visibility.Visible; } else { TimePanel.Visibility = Visibility.Collapsed; } }
private async void TabViewWindowingButton_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { CoreApplicationView newView = CoreApplication.CreateNewView(); int newViewId = 0; await newView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { Frame frame = new Frame(); frame.Navigate(typeof(TabViewWindowingSamplePage), null); Window.Current.Content = frame; // You have to activate the window in order to show it later. Window.Current.Activate(); newViewId = ApplicationView.GetForCurrentView().Id; }); bool viewShown = await ApplicationViewSwitcher.TryShowAsStandaloneAsync(newViewId); }
private async void MenuFlyoutItem_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { // var flyoutItem = (MenuFlyoutItem)sender; // // var option = flyoutItem.Tag.ToString(); // if (option == "split") // { // SelectedViewIcon.Glyph = "\uF57C"; // SelectedViewText.Text = "Split"; // // await SetDiffViewModel(_splitDiffViewModel); // } // else if (option == "unified") // { // SelectedViewIcon.Glyph = "\uF57D"; // SelectedViewText.Text = "Unified"; // // await SetDiffViewModel(_unifiedDiffViewModel); // } }
private void SfDataGrid_Loaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { // populate the totalSales by summary value. foreach (GridColumn column in this.sfDataGrid.Columns) { totalSales[column.MappingName] = GetSummaryValue(column.MappingName); } // Refresh the UnboundRows. this.sfDataGrid.InValidateUnboundRow(this.sfDataGrid.UnboundRows[0]); var visualContainer = this.sfDataGrid.GetType().GetProperty("VisualContainer", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(this.sfDataGrid) as VisualContainer; if (visualContainer != null) { visualContainer.InvalidateMeasureInfo(); } var collection = this.sfDataGrid.DataContext as SalesViewModel; foreach (Sales sales in collection.YearlySales.Skip(3).Take(3)) { this.sfDataGrid.SelectedItems.Add(sales); } }
private void OnBackClick(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { On_BackRequested(); }
private void OnOptionsClick(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { Frame.Navigate(typeof(OptionsPage)); }
private void Page_Loaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { ScheduleSwitch.Toggled += ScheduleSwitch_Toggled; }
private void CustomRadioButton_Unchecked(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { CustomTimePanel.Visibility = Visibility.Collapsed; }
private void CloseAppInvokerButton_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { Application.Current.Exit(); }
private async void ShellView_Unloaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) { await ViewModel.OnUnloadedAsync(); }