Exemple #1
0
        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();
            }
        }
Exemple #2
0
    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);
    }
Exemple #3
0
        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;
            }
        }
Exemple #4
0
 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;
     }
 }
Exemple #5
0
        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);
        }
Exemple #6
0
 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);
     // }
 }
Exemple #7
0
        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));
 }
Exemple #10
0
 private void Page_Loaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
 {
     ScheduleSwitch.Toggled += ScheduleSwitch_Toggled;
 }
Exemple #11
0
 private void CustomRadioButton_Unchecked(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
 {
     CustomTimePanel.Visibility = Visibility.Collapsed;
 }
Exemple #12
0
 private void CloseAppInvokerButton_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
 {
     Application.Current.Exit();
 }
Exemple #13
0
 private async void ShellView_Unloaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
 {
     await ViewModel.OnUnloadedAsync();
 }