Carousel UWP Microsoft Toolkit disable swipe










0















I use Carousel control from Microsoft.UWP.Toolkir.Controls
https://docs.microsoft.com/en-us/windows/communitytoolkit/controls/carousel



When we're clicking and holding left mouse button, we can swipe item like in tablet, phohe. It's just like "panoramic" scroll.



So, it's work normaly, but when we're holding and moving pointer (or finger in the tablet) on the first and last item we get white "background" (mb offset) of left (first item), right (last item) sides.



When we're moving and item get some (I don't how to check) horizontal offset -> it come back to previous state.



start position carousel view



we hold and move first item, left of it we get some offset



Can we get and change this offset or disable this option on first and last item?










share|improve this question


























    0















    I use Carousel control from Microsoft.UWP.Toolkir.Controls
    https://docs.microsoft.com/en-us/windows/communitytoolkit/controls/carousel



    When we're clicking and holding left mouse button, we can swipe item like in tablet, phohe. It's just like "panoramic" scroll.



    So, it's work normaly, but when we're holding and moving pointer (or finger in the tablet) on the first and last item we get white "background" (mb offset) of left (first item), right (last item) sides.



    When we're moving and item get some (I don't how to check) horizontal offset -> it come back to previous state.



    start position carousel view



    we hold and move first item, left of it we get some offset



    Can we get and change this offset or disable this option on first and last item?










    share|improve this question
























      0












      0








      0








      I use Carousel control from Microsoft.UWP.Toolkir.Controls
      https://docs.microsoft.com/en-us/windows/communitytoolkit/controls/carousel



      When we're clicking and holding left mouse button, we can swipe item like in tablet, phohe. It's just like "panoramic" scroll.



      So, it's work normaly, but when we're holding and moving pointer (or finger in the tablet) on the first and last item we get white "background" (mb offset) of left (first item), right (last item) sides.



      When we're moving and item get some (I don't how to check) horizontal offset -> it come back to previous state.



      start position carousel view



      we hold and move first item, left of it we get some offset



      Can we get and change this offset or disable this option on first and last item?










      share|improve this question














      I use Carousel control from Microsoft.UWP.Toolkir.Controls
      https://docs.microsoft.com/en-us/windows/communitytoolkit/controls/carousel



      When we're clicking and holding left mouse button, we can swipe item like in tablet, phohe. It's just like "panoramic" scroll.



      So, it's work normaly, but when we're holding and moving pointer (or finger in the tablet) on the first and last item we get white "background" (mb offset) of left (first item), right (last item) sides.



      When we're moving and item get some (I don't how to check) horizontal offset -> it come back to previous state.



      start position carousel view



      we hold and move first item, left of it we get some offset



      Can we get and change this offset or disable this option on first and last item?







      uwp carousel swipe offset toolkit






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 13 '18 at 8:58









      Stanislav ZinovievStanislav Zinoviev

      52




      52






















          1 Answer
          1






          active

          oldest

          votes


















          0















          Can we get and change this offset or disable this option on first and last item?




          Windows Community Toolkit is open source, you could check the Carousel source code.



          What you said 'when we're holding and moving pointer (or finger in the tablet) on the first and last item we get white "background" (mb offset) of left (first item), right (last item) sides.' just is normal Manipulation operation. You could see these operations in CarouselPanel.cs.



          To achieve your target, you need to do judgement in OnManipulationDelta, if the selecteditem is first or last item, you could terminate Manipulation like the following:



          internal void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)

          var previousIndex = Carousel.SelectedIndex;
          var delta = Carousel.Orientation == Orientation.Horizontal ? e.Delta.Translation.X : e.Delta.Translation.Y;
          if ((previousIndex == 0 && delta>0)


          The above code just is my simple implementation, if you think it's not good for you, you could change it by yourself.



          Then, when you change the source code in Windows Community Toolkit, you would have to compile your custom version for it and add reference to it in your project.






          share|improve this answer























          • Thank you very much.

            – Stanislav Zinoviev
            Nov 14 '18 at 17:08











          • I solved my main task, created own Panel and changed behavior for last and first. I use this panel like: <Setter.Value> <ItemsPanelTemplate> <carouselViewPanel:CarouselViewPanel></carouselViewPanel:CarouselViewPanel> </ItemsPanelTemplate> </Setter.Value>' After that scrolling from first item to 5 item (for example) is disabled. Can you please explain me "what's heppend?". May be I don't correct use ItemsPanel?

            – Stanislav Zinoviev
            Nov 15 '18 at 12:19












          • I'm sorry, As I could understand I can't inheritence CarouselPanel and override method?

            – Stanislav Zinoviev
            Nov 16 '18 at 8:26











          • @StanislavZinoviev You could inheritence and override its methods, if there're methods for you to override.

            – Bite
            Nov 16 '18 at 8:30











          • @Bite I've researched source and these methods aren't overidde (They don't have overidde mod) and they're have internal mod so I can't use in my own class if I even inherit CarouselPanel.

            – Stanislav Zinoviev
            Nov 16 '18 at 8:50










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53277208%2fcarousel-uwp-microsoft-toolkit-disable-swipe%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0















          Can we get and change this offset or disable this option on first and last item?




          Windows Community Toolkit is open source, you could check the Carousel source code.



          What you said 'when we're holding and moving pointer (or finger in the tablet) on the first and last item we get white "background" (mb offset) of left (first item), right (last item) sides.' just is normal Manipulation operation. You could see these operations in CarouselPanel.cs.



          To achieve your target, you need to do judgement in OnManipulationDelta, if the selecteditem is first or last item, you could terminate Manipulation like the following:



          internal void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)

          var previousIndex = Carousel.SelectedIndex;
          var delta = Carousel.Orientation == Orientation.Horizontal ? e.Delta.Translation.X : e.Delta.Translation.Y;
          if ((previousIndex == 0 && delta>0)


          The above code just is my simple implementation, if you think it's not good for you, you could change it by yourself.



          Then, when you change the source code in Windows Community Toolkit, you would have to compile your custom version for it and add reference to it in your project.






          share|improve this answer























          • Thank you very much.

            – Stanislav Zinoviev
            Nov 14 '18 at 17:08











          • I solved my main task, created own Panel and changed behavior for last and first. I use this panel like: <Setter.Value> <ItemsPanelTemplate> <carouselViewPanel:CarouselViewPanel></carouselViewPanel:CarouselViewPanel> </ItemsPanelTemplate> </Setter.Value>' After that scrolling from first item to 5 item (for example) is disabled. Can you please explain me "what's heppend?". May be I don't correct use ItemsPanel?

            – Stanislav Zinoviev
            Nov 15 '18 at 12:19












          • I'm sorry, As I could understand I can't inheritence CarouselPanel and override method?

            – Stanislav Zinoviev
            Nov 16 '18 at 8:26











          • @StanislavZinoviev You could inheritence and override its methods, if there're methods for you to override.

            – Bite
            Nov 16 '18 at 8:30











          • @Bite I've researched source and these methods aren't overidde (They don't have overidde mod) and they're have internal mod so I can't use in my own class if I even inherit CarouselPanel.

            – Stanislav Zinoviev
            Nov 16 '18 at 8:50















          0















          Can we get and change this offset or disable this option on first and last item?




          Windows Community Toolkit is open source, you could check the Carousel source code.



          What you said 'when we're holding and moving pointer (or finger in the tablet) on the first and last item we get white "background" (mb offset) of left (first item), right (last item) sides.' just is normal Manipulation operation. You could see these operations in CarouselPanel.cs.



          To achieve your target, you need to do judgement in OnManipulationDelta, if the selecteditem is first or last item, you could terminate Manipulation like the following:



          internal void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)

          var previousIndex = Carousel.SelectedIndex;
          var delta = Carousel.Orientation == Orientation.Horizontal ? e.Delta.Translation.X : e.Delta.Translation.Y;
          if ((previousIndex == 0 && delta>0)


          The above code just is my simple implementation, if you think it's not good for you, you could change it by yourself.



          Then, when you change the source code in Windows Community Toolkit, you would have to compile your custom version for it and add reference to it in your project.






          share|improve this answer























          • Thank you very much.

            – Stanislav Zinoviev
            Nov 14 '18 at 17:08











          • I solved my main task, created own Panel and changed behavior for last and first. I use this panel like: <Setter.Value> <ItemsPanelTemplate> <carouselViewPanel:CarouselViewPanel></carouselViewPanel:CarouselViewPanel> </ItemsPanelTemplate> </Setter.Value>' After that scrolling from first item to 5 item (for example) is disabled. Can you please explain me "what's heppend?". May be I don't correct use ItemsPanel?

            – Stanislav Zinoviev
            Nov 15 '18 at 12:19












          • I'm sorry, As I could understand I can't inheritence CarouselPanel and override method?

            – Stanislav Zinoviev
            Nov 16 '18 at 8:26











          • @StanislavZinoviev You could inheritence and override its methods, if there're methods for you to override.

            – Bite
            Nov 16 '18 at 8:30











          • @Bite I've researched source and these methods aren't overidde (They don't have overidde mod) and they're have internal mod so I can't use in my own class if I even inherit CarouselPanel.

            – Stanislav Zinoviev
            Nov 16 '18 at 8:50













          0












          0








          0








          Can we get and change this offset or disable this option on first and last item?




          Windows Community Toolkit is open source, you could check the Carousel source code.



          What you said 'when we're holding and moving pointer (or finger in the tablet) on the first and last item we get white "background" (mb offset) of left (first item), right (last item) sides.' just is normal Manipulation operation. You could see these operations in CarouselPanel.cs.



          To achieve your target, you need to do judgement in OnManipulationDelta, if the selecteditem is first or last item, you could terminate Manipulation like the following:



          internal void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)

          var previousIndex = Carousel.SelectedIndex;
          var delta = Carousel.Orientation == Orientation.Horizontal ? e.Delta.Translation.X : e.Delta.Translation.Y;
          if ((previousIndex == 0 && delta>0)


          The above code just is my simple implementation, if you think it's not good for you, you could change it by yourself.



          Then, when you change the source code in Windows Community Toolkit, you would have to compile your custom version for it and add reference to it in your project.






          share|improve this answer














          Can we get and change this offset or disable this option on first and last item?




          Windows Community Toolkit is open source, you could check the Carousel source code.



          What you said 'when we're holding and moving pointer (or finger in the tablet) on the first and last item we get white "background" (mb offset) of left (first item), right (last item) sides.' just is normal Manipulation operation. You could see these operations in CarouselPanel.cs.



          To achieve your target, you need to do judgement in OnManipulationDelta, if the selecteditem is first or last item, you could terminate Manipulation like the following:



          internal void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)

          var previousIndex = Carousel.SelectedIndex;
          var delta = Carousel.Orientation == Orientation.Horizontal ? e.Delta.Translation.X : e.Delta.Translation.Y;
          if ((previousIndex == 0 && delta>0)


          The above code just is my simple implementation, if you think it's not good for you, you could change it by yourself.



          Then, when you change the source code in Windows Community Toolkit, you would have to compile your custom version for it and add reference to it in your project.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 14 '18 at 7:18









          Xavier Xie - MSFTXavier Xie - MSFT

          5,1811315




          5,1811315












          • Thank you very much.

            – Stanislav Zinoviev
            Nov 14 '18 at 17:08











          • I solved my main task, created own Panel and changed behavior for last and first. I use this panel like: <Setter.Value> <ItemsPanelTemplate> <carouselViewPanel:CarouselViewPanel></carouselViewPanel:CarouselViewPanel> </ItemsPanelTemplate> </Setter.Value>' After that scrolling from first item to 5 item (for example) is disabled. Can you please explain me "what's heppend?". May be I don't correct use ItemsPanel?

            – Stanislav Zinoviev
            Nov 15 '18 at 12:19












          • I'm sorry, As I could understand I can't inheritence CarouselPanel and override method?

            – Stanislav Zinoviev
            Nov 16 '18 at 8:26











          • @StanislavZinoviev You could inheritence and override its methods, if there're methods for you to override.

            – Bite
            Nov 16 '18 at 8:30











          • @Bite I've researched source and these methods aren't overidde (They don't have overidde mod) and they're have internal mod so I can't use in my own class if I even inherit CarouselPanel.

            – Stanislav Zinoviev
            Nov 16 '18 at 8:50

















          • Thank you very much.

            – Stanislav Zinoviev
            Nov 14 '18 at 17:08











          • I solved my main task, created own Panel and changed behavior for last and first. I use this panel like: <Setter.Value> <ItemsPanelTemplate> <carouselViewPanel:CarouselViewPanel></carouselViewPanel:CarouselViewPanel> </ItemsPanelTemplate> </Setter.Value>' After that scrolling from first item to 5 item (for example) is disabled. Can you please explain me "what's heppend?". May be I don't correct use ItemsPanel?

            – Stanislav Zinoviev
            Nov 15 '18 at 12:19












          • I'm sorry, As I could understand I can't inheritence CarouselPanel and override method?

            – Stanislav Zinoviev
            Nov 16 '18 at 8:26











          • @StanislavZinoviev You could inheritence and override its methods, if there're methods for you to override.

            – Bite
            Nov 16 '18 at 8:30











          • @Bite I've researched source and these methods aren't overidde (They don't have overidde mod) and they're have internal mod so I can't use in my own class if I even inherit CarouselPanel.

            – Stanislav Zinoviev
            Nov 16 '18 at 8:50
















          Thank you very much.

          – Stanislav Zinoviev
          Nov 14 '18 at 17:08





          Thank you very much.

          – Stanislav Zinoviev
          Nov 14 '18 at 17:08













          I solved my main task, created own Panel and changed behavior for last and first. I use this panel like: <Setter.Value> <ItemsPanelTemplate> <carouselViewPanel:CarouselViewPanel></carouselViewPanel:CarouselViewPanel> </ItemsPanelTemplate> </Setter.Value>' After that scrolling from first item to 5 item (for example) is disabled. Can you please explain me "what's heppend?". May be I don't correct use ItemsPanel?

          – Stanislav Zinoviev
          Nov 15 '18 at 12:19






          I solved my main task, created own Panel and changed behavior for last and first. I use this panel like: <Setter.Value> <ItemsPanelTemplate> <carouselViewPanel:CarouselViewPanel></carouselViewPanel:CarouselViewPanel> </ItemsPanelTemplate> </Setter.Value>' After that scrolling from first item to 5 item (for example) is disabled. Can you please explain me "what's heppend?". May be I don't correct use ItemsPanel?

          – Stanislav Zinoviev
          Nov 15 '18 at 12:19














          I'm sorry, As I could understand I can't inheritence CarouselPanel and override method?

          – Stanislav Zinoviev
          Nov 16 '18 at 8:26





          I'm sorry, As I could understand I can't inheritence CarouselPanel and override method?

          – Stanislav Zinoviev
          Nov 16 '18 at 8:26













          @StanislavZinoviev You could inheritence and override its methods, if there're methods for you to override.

          – Bite
          Nov 16 '18 at 8:30





          @StanislavZinoviev You could inheritence and override its methods, if there're methods for you to override.

          – Bite
          Nov 16 '18 at 8:30













          @Bite I've researched source and these methods aren't overidde (They don't have overidde mod) and they're have internal mod so I can't use in my own class if I even inherit CarouselPanel.

          – Stanislav Zinoviev
          Nov 16 '18 at 8:50





          @Bite I've researched source and these methods aren't overidde (They don't have overidde mod) and they're have internal mod so I can't use in my own class if I even inherit CarouselPanel.

          – Stanislav Zinoviev
          Nov 16 '18 at 8:50

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53277208%2fcarousel-uwp-microsoft-toolkit-disable-swipe%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Use pre created SQLite database for Android project in kotlin

          Darth Vader #20

          Ondo