示例#1
0
        private void InitializeComponent()
        {
            AvaloniaXamlLoader.Load(this);

            _img = this.Get <Control>("img");
            _img.PointerMoved   += Image_PointerMoved;
            _img.PointerPressed += Img_PointerPressed;

            // Delegate is called from bg thread, use synchronous call to avoid concurrency issues within Avalonia.
            _viewModel = new SnowViewModel();
        }
示例#2
0
        private void InitializeComponent()
        {
            AvaloniaXamlLoaderPortableXaml.Load(this);

            _img = ((Grid)Content).Children.First();
            _img.PointerMoved   += Image_PointerMoved;
            _img.PointerPressed += Img_PointerPressed;

            // Delegate is called from bg thread, use synchronous call to avoid concurrency issues within Avalonia.
            _viewModel = new SnowViewModel(() =>
                                           Dispatcher.UIThread.InvokeAsync(() => _img.InvalidateVisual()).Wait());
        }