Exemplo n.º 1
0
 public void LoadVisibleItems()
 {
     if (_isActive)
     {
         _handler.LoadVisibleItems(false);
     }
 }
Exemplo n.º 2
0
        public InlineBotResultsView()
        {
            InitializeComponent();

            _handler = new AnimatedRepeaterHandler <InlineQueryResult>(Repeater, ScrollingHost);
            _handler.DownloadFile = (id, result) =>
            {
                DownloadFile(_files, id, result);
            };

            _throttler          = new DispatcherTimer();
            _throttler.Interval = TimeSpan.FromMilliseconds(Constants.AnimatedThrottle);
            _throttler.Tick    += (s, args) =>
            {
                _throttler.Stop();
                _handler.LoadVisibleItems(false);
            };
        }
Exemplo n.º 3
0
        public AnimationDrawer()
        {
            InitializeComponent();

            _handler = new AnimatedRepeaterHandler <Animation>(Repeater, ScrollingHost);
            _handler.DownloadFile = DownloadFile;

            _throttler          = new DispatcherTimer();
            _throttler.Interval = TimeSpan.FromMilliseconds(Constants.AnimatedThrottle);
            _throttler.Tick    += (s, args) =>
            {
                _throttler.Stop();
                _handler.LoadVisibleItems(false);
            };

            ElementCompositionPreview.GetElementVisual(this).Clip = Window.Current.Compositor.CreateInsetClip();

            var shadow = DropShadowEx.Attach(Separator, 20, 0.25f);

            Separator.SizeChanged += (s, args) =>
            {
                shadow.Size = args.NewSize.ToVector2();
            };

            var observable = Observable.FromEventPattern <TextChangedEventArgs>(FieldAnimations, "TextChanged");
            var throttled  = observable.Throttle(TimeSpan.FromMilliseconds(Constants.TypingTimeout)).ObserveOnDispatcher().Subscribe(x =>
            {
                ViewModel.FindAnimations(FieldAnimations.Text);
                //var items = ViewModel.Stickers.SearchStickers;
                //if (items != null && string.Equals(FieldStickers.Text, items.Query))
                //{
                //    await items.LoadMoreItemsAsync(1);
                //    await items.LoadMoreItemsAsync(2);
                //}
            });
        }