-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements Carousel control and sample carousel page #712
Merged
Merged
Changes from 13 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
d058391
Implements Carousel control and sample carousel page
Mimetis 4a047f3
adding the carousel header, using build.ps1 powershell script
Mimetis ccc6eb2
Merge branch 'master' of https://github.com/Mimetis/UWPCommunityToolk…
Mimetis 962b5b0
New Carousel Control. Inherits from ItemsControl, Keyboard and mouse …
d924275
XamlStyler pase
ba54cf2
Update Headers
6ccfc24
Modifications from request changes
Mimetis a3d6f63
Deleting unecessary comments :)
Mimetis 1cc74cf
Add focus visual style
Mimetis 9beeb77
Add SelectedItem property
Mimetis b927b4e
merge conflicts
Mimetis 2cf15d5
typos corrections, remove unused using statements, remove this keywor…
Mimetis 1099787
correcting a bug preventing the carousel to show after first load
Mimetis 984ad62
Change depth property type to int
Mimetis 881f46e
Removing Manipulations from the Carousel control and set the Backgrou…
Mimetis 10ee204
Correcting else if
Mimetis 661a277
removing reference to CarouselPanel into Carousel control
Mimetis a44dee5
Trying to make a better description for InvertPositive property
Mimetis 3ab35bd
fixed conflicts
nmetulev 5f062f8
updated directional navigation to work better for xbox
nmetulev 53e9abd
added AutomationProperty.Name
nmetulev 84a8f64
fixed merge conflict yet again
nmetulev 2ed36cc
Merge branch 'dev' into Mimetis-dev
nmetulev 649baef
updated focus management of carousel
nmetulev e2634ec
playing with inertia
nmetulev 2603354
continuing inertia investigation
nmetulev 41938a9
Merge branch 'dev' of https://github.com/Microsoft/UWPCommunityToolki…
Mimetis 41c4fd8
Merge remote-tracking branch 'refs/remotes/upstream/Mimetis-dev'
Mimetis b395692
Adding docs for Carousel control
Mimetis 186e526
Fixing typos
Mimetis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions
36
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Carousel/CarouselCode.bind
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.CarouselPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<Grid Background="{StaticResource Brush-Grey-05}"> | ||
<Border Margin="0"> | ||
<controls:Carousel x:Name="CarouselControl" | ||
InvertPositive="@[InvertPositive:Bool:True]" | ||
ItemDepth="@[ItemDepth:Slider:300:0-400]" | ||
ItemMargin="@[ItemMargin:Slider:0:0-500]" | ||
ItemRotationX="@[ItemRotationX:Slider:0:0-180]" | ||
ItemRotationY="@[ItemRotationY:Slider:45:0-180]" | ||
ItemRotationZ ="@[ItemRotationZ:Slider:0:0-180]" | ||
Orientation="@[Orientation:Enum:Orientation.Horizontal]" | ||
SelectedIndex="@[SelectedIndex:String:4]"> | ||
<controls:Carousel.EasingFunction> | ||
<CubicEase EasingMode="EaseOut" /> | ||
</controls:Carousel.EasingFunction> | ||
<controls:Carousel.ItemTemplate> | ||
<DataTemplate> | ||
<Image Width="200" | ||
Height="200" | ||
VerticalAlignment="Bottom" | ||
Source="{Binding Thumbnail}" | ||
Stretch="Uniform" /> | ||
</DataTemplate> | ||
</controls:Carousel.ItemTemplate> | ||
</controls:Carousel> | ||
</Border> | ||
</Grid> | ||
</Page> |
37 changes: 37 additions & 0 deletions
37
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Carousel/CarouselPage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.CarouselPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<Grid Background="{StaticResource Brush-Grey-05}"> | ||
<Border Margin="0"> | ||
<controls:Carousel x:Name="CarouselControl" | ||
Background="{StaticResource Brush-Grey-05}" | ||
InvertPositive="{Binding InvertPositive.Value, Mode=OneWay}" | ||
ItemDepth="{Binding ItemDepth.Value, Mode=OneWay}" | ||
ItemMargin="{Binding ItemMargin.Value, Mode=OneWay}" | ||
ItemRotationX="{Binding ItemRotationX.Value, Mode=OneWay}" | ||
ItemRotationY="{Binding ItemRotationY.Value, Mode=OneWay}" | ||
ItemRotationZ="{Binding ItemRotationZ.Value, Mode=OneWay}" | ||
Orientation="{Binding Orientation.Value, Mode=OneWay}" | ||
SelectedIndex="{Binding SelectedIndex.Value, Mode=TwoWay}"> | ||
<controls:Carousel.EasingFunction> | ||
<CubicEase EasingMode="EaseOut" /> | ||
</controls:Carousel.EasingFunction> | ||
<controls:Carousel.ItemTemplate> | ||
<DataTemplate> | ||
<Image Width="200" | ||
Height="200" | ||
VerticalAlignment="Bottom" | ||
Source="{Binding Thumbnail}" | ||
Stretch="Uniform" /> | ||
</DataTemplate> | ||
</controls:Carousel.ItemTemplate> | ||
</controls:Carousel> | ||
</Border> | ||
</Grid> | ||
</Page> |
50 changes: 50 additions & 0 deletions
50
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Carousel/CarouselPage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// ****************************************************************** | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// This code is licensed under the MIT License (MIT). | ||
// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH | ||
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE. | ||
// ****************************************************************** | ||
|
||
using Microsoft.Toolkit.Uwp.SampleApp.Models; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages | ||
{ | ||
/// <summary> | ||
/// A page that shows how to use the Carousel control. | ||
/// </summary> | ||
public sealed partial class CarouselPage : Page | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="CarouselPage"/> class. | ||
/// </summary> | ||
public CarouselPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
/// <summary> | ||
/// Invoked when the Page is loaded and becomes the current source of a parent Frame. | ||
/// </summary> | ||
/// <param name="e">Event data that can be examined by overriding code. The event data is representative of the pending navigation that will load the current Page. Usually the most relevant property to examine is Parameter.</param> | ||
protected override async void OnNavigatedTo(NavigationEventArgs e) | ||
{ | ||
base.OnNavigatedTo(e); | ||
|
||
var propertyDesc = e.Parameter as PropertyDescriptor; | ||
|
||
if (propertyDesc != null) | ||
{ | ||
DataContext = propertyDesc.Expando; | ||
} | ||
|
||
CarouselControl.ItemsSource = await new Data.PhotosDataSource().GetItemsAsync(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is not needed anymore after @deltakosh updated the Sample App?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done