-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #702 from samoteph/dev
Add a MosaicControl to repeat an image
- Loading branch information
Showing
15 changed files
with
1,381 additions
and
0 deletions.
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
Binary file added
BIN
+328 Bytes
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/MosaicControl/Animations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions
71
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/MosaicControl/MosaicControl.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,71 @@ | ||
<Page | ||
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.FlipTilePage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" | ||
mc:Ignorable="d"> | ||
|
||
<Page.Resources> | ||
<Style x:Name="TextBlockStyle" TargetType="TextBlock"> | ||
<Setter Property="FontSize" Value="40"/> | ||
<Setter Property="FontFamily" Value="Segoe UI"/> | ||
<Setter Property="FontWeight" Value="Light"/> | ||
<Setter Property="Foreground" Value="White"/> | ||
<Setter Property="Margin" Value="48"/> | ||
</Style> | ||
<Style x:Name="BorderStyle" TargetType="Border"> | ||
<Setter Property="HorizontalAlignment" Value="Center"/> | ||
<Setter Property="VerticalAlignment" Value="Center"/> | ||
<Setter Property="Background" Value="#40000000"/> | ||
</Style> | ||
</Page.Resources> | ||
|
||
<Grid Background="{StaticResource Brush-Grey-01}"> | ||
|
||
<Grid.RowDefinitions> | ||
<RowDefinition></RowDefinition> | ||
<RowDefinition Height="6"></RowDefinition> | ||
<RowDefinition></RowDefinition> | ||
</Grid.RowDefinitions> | ||
|
||
<controls:MosaicControl | ||
ImageSource ="ms-appx:///SamplePages/MosaicControl/Animations.png" | ||
OffsetX ="@[OffsetX:Slider:0:0-150]" | ||
OffsetY ="@[OffsetY:Slider:0:0-150]" | ||
|
||
IsAnimated ="@[IsAnimated:Bool:False]" | ||
AnimationStepX ="@[AnimationStepX:Slider:1:0-3]" | ||
AnimationStepY ="@[AnimationStepY:Slider:1:0-3]" | ||
AnimationDuration ="@[AnimationDuration:Slider:30:0-100]" | ||
|
||
ScrollOrientation ="@[ScrollOrientation:Enum:ScrollOrientation.Both]" | ||
ImageAlignment ="@[ImageAlignment:Enum:ImageAlignment.None]" | ||
|
||
ParallaxSpeedRatio ="@[ParallaxSpeedRatio:DoubleSlider:1.2:1-3]" | ||
|
||
Grid.Row="0" | ||
Background="{StaticResource Brush-Grey-04}" | ||
> | ||
<Border Style="{StaticResource BorderStyle}"> | ||
<TextBlock Style="{StaticResource TextBlockStyle}" Text="Simple Content"></TextBlock> | ||
</Border> | ||
</controls:MosaicControl> | ||
|
||
<controls:MosaicControl Grid.Row="2" Background="{StaticResource Brush-Grey-04}" ImageSource="ms-appx:///SamplePages/MosaicControl/Animations.png" ScrollViewerContainer="{x:Bind FlipView, Mode=OneTime}"> | ||
<FlipView x:Name="FlipView"> | ||
|
||
<Border Style="{StaticResource BorderStyle}"> | ||
<TextBlock Style="{StaticResource TextBlockStyle}" Text="Synchronized with FlipView >"></TextBlock> | ||
</Border> | ||
|
||
<Border Style="{StaticResource BorderStyle}"> | ||
<TextBlock Style="{StaticResource TextBlockStyle}" Text="< Synchronized with FlipView"></TextBlock> | ||
</Border> | ||
|
||
</FlipView> | ||
</controls:MosaicControl> | ||
|
||
</Grid> | ||
</Page> |
Binary file added
BIN
+28.6 KB
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/MosaicControl/MosaicControl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions
77
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/MosaicControl/MosaicControlPage.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,77 @@ | ||
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.MosaicControlPage" | ||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<Page.Resources> | ||
<Style x:Name="TextBlockStyle" TargetType="TextBlock"> | ||
<Setter Property="FontSize" Value="40"/> | ||
<Setter Property="FontFamily" Value="Segoe UI"/> | ||
<Setter Property="FontWeight" Value="Light"/> | ||
<Setter Property="Foreground" Value="White"/> | ||
<Setter Property="Margin" Value="48"/> | ||
</Style> | ||
<Style x:Name="BorderStyle" TargetType="Border"> | ||
<Setter Property="HorizontalAlignment" Value="Center"/> | ||
<Setter Property="VerticalAlignment" Value="Center"/> | ||
<Setter Property="Background" Value="#40000000"/> | ||
</Style> | ||
</Page.Resources> | ||
|
||
<Grid Background="{StaticResource Brush-Grey-01}"> | ||
|
||
<Grid.RowDefinitions> | ||
<RowDefinition></RowDefinition> | ||
<RowDefinition Height="6"></RowDefinition> | ||
<RowDefinition></RowDefinition> | ||
</Grid.RowDefinitions> | ||
|
||
<controls:MosaicControl | ||
|
||
ImageSource="ms-appx:///SamplePages/MosaicControl/Animations.png" | ||
OffsetX ="{Binding OffsetX.Value,Mode=OneWay}" | ||
OffsetY ="{Binding OffsetY.Value,Mode=OneWay}" | ||
|
||
IsAnimated ="{Binding IsAnimated.Value,Mode=TwoWay}" | ||
AnimationStepX ="{Binding AnimationStepX.Value,Mode=OneWay}" | ||
AnimationStepY ="{Binding AnimationStepY.Value,Mode=OneWay}" | ||
AnimationDuration ="{Binding AnimationDuration.Value,Mode=OneWay}" | ||
|
||
ScrollOrientation ="{Binding ScrollOrientation.Value, Mode=TwoWay}" | ||
ImageAlignment ="{Binding ImageAlignment.Value,Mode=TwoWay}" | ||
|
||
Grid.Row="0" | ||
Background="{StaticResource Brush-Grey-04}" | ||
> | ||
<Border Style="{StaticResource BorderStyle}"> | ||
<TextBlock Style="{StaticResource TextBlockStyle}" Text="Simple Content"></TextBlock> | ||
</Border> | ||
</controls:MosaicControl> | ||
|
||
<controls:MosaicControl | ||
|
||
ImageSource="ms-appx:///SamplePages/MosaicControl/Animations.png" | ||
ScrollViewerContainer ="{x:Bind FlipView, Mode=OneTime}" | ||
ParallaxSpeedRatio ="{Binding ParallaxSpeedRatio.Value, Mode=OneWay}" | ||
|
||
Grid.Row="2" | ||
Background="{StaticResource Brush-Grey-04}" | ||
> | ||
<FlipView x:Name="FlipView"> | ||
|
||
<Border Style="{StaticResource BorderStyle}"> | ||
<TextBlock Style="{StaticResource TextBlockStyle}" Text="Parallax with FlipView >"></TextBlock> | ||
</Border> | ||
|
||
<Border Style="{StaticResource BorderStyle}"> | ||
<TextBlock Style="{StaticResource TextBlockStyle}" Text="< Parallax with FlipView"></TextBlock> | ||
</Border> | ||
|
||
</FlipView> | ||
</controls:MosaicControl> | ||
|
||
</Grid> | ||
</Page> |
37 changes: 37 additions & 0 deletions
37
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/MosaicControl/MosaicControlPage.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,37 @@ | ||
// ****************************************************************** | ||
// 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.Navigation; | ||
|
||
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages | ||
{ | ||
public sealed partial class MosaicControlPage | ||
{ | ||
public MosaicControlPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
protected override async void OnNavigatedTo(NavigationEventArgs e) | ||
{ | ||
base.OnNavigatedTo(e); | ||
|
||
var propertyDesc = e.Parameter as PropertyDescriptor; | ||
|
||
if (propertyDesc != null) | ||
{ | ||
DataContext = propertyDesc.Expando; | ||
} | ||
} | ||
} | ||
} |
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
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.