Carousel UWP Microsoft Toolkit disable swipe
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
add a comment |
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
add a comment |
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
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
uwp carousel swipe offset toolkit
asked Nov 13 '18 at 8:58
Stanislav ZinovievStanislav Zinoviev
52
52
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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