Esempio n. 1
0
        private void GridScaleNormal(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var element = sender as UIElement;
            var visual  = ElementCompositionPreview.GetElementVisual(element);

            visual.Scale = new Vector3(1);
        }
Esempio n. 2
0
        private void GridScaleUp(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            // Source for the scaling: https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Implicit%20Animations/ImplicitAnimationsPage.xaml.cs
            // Search for "Scale Element".
            var element = sender as UIElement;
            var visual  = ElementCompositionPreview.GetElementVisual(element);

            visual.Scale = new Vector3(1.02f, 1.02f, 1);
        }
Esempio n. 3
0
 private void RelativePanel_PointerPressed(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e)
 {
     if (sender is RelativePanel)
     {
         relativePanel             = sender as RelativePanel;
         relativePanel.Background  = (Microsoft.UI.Xaml.Media.SolidColorBrush) this.Resources["SyncfusionControInfoPressedBackground"];
         relativePanel.BorderBrush = (Microsoft.UI.Xaml.Media.SolidColorBrush) this.Resources["SyncfusionControlInfoBorderBrush"];
     }
 }
Esempio n. 4
0
        private async void Button_PointerPressed(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var vm = (ViewModel)DataContext;

            _isStreaming = _isStreaming is null ? true : !_isStreaming;

            while (_isStreaming.Value)
            {
                vm.RemoveFirstItem();
                vm.AddItem();
                await Task.Delay(1000);
            }
        }
Esempio n. 5
0
    private void Chart_PointerPressed(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e)
    {
        var viewModel = (ViewModel)DataContext;

        // gets the point in the UI coordinates.
        var p = e.GetCurrentPoint(chart);

        // scales the UI coordintaes to the corresponging data in the chart.
        // ScaleUIPoint retuns an array of double
        var scaledPoint = chart.ScaleUIPoint(new LvcPoint((float)p.Position.X, (float)p.Position.Y));

        // where the X coordinate is in the first position
        var x = scaledPoint[0];

        // and the Y coordinate in the second position
        var y = scaledPoint[1];

        // finally add the new point to the data in our chart.
        viewModel.Data.Add(new ObservablePoint(x, y));
    }
 private void OnCustomizationViewPanelPointerPressed(object sender, Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e)
 {
     // To restrict the focus on first control when clicking on empty area.
     e.Handled = true;
 }