wasteam / waslibs

Windows App Studio WinRT XAML & UWP Libraries
MIT License
313 stars 133 forks source link

Make Carousel.AnimateNext and AnimatePrev public #37

Closed Nukepayload2 closed 8 years ago

Nukepayload2 commented 8 years ago

I want to add two buttons to scroll the Carousel control by modifying the SelectedIndex property. But the translation animation can't be played unless I use reflection to call Carousel.AnimateNext() and Carousel.AnimatePrev() .

javitosanchez commented 8 years ago

In DEV branch we have implemented 2 new buttons in the Carousel control in order to let the user moving between the items in the collection. Is it what you need?

Nukepayload2 commented 8 years ago

The two new buttons can solve my problem if I don't want to move between the items in the collection programmatically.

Please add the following methods :

partial class Carousel { // Click the left button programmatically public void MoveBack() { if (_isBusy) return; _panel.TranslateDeltaX(0.01); AnimatePrev(); } // Click the right button programmatically public void MoveForward() { if (_isBusy) return; _panel.TranslateDeltaX(-0.01); AnimateNext(); } }

javitosanchez commented 8 years ago

Why don't you fork the master branch and create a pull request with those 2 new methods? We will be glad to accept it :-)