generated from unoplatform/template
-
Notifications
You must be signed in to change notification settings - Fork 26
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 #757 from unoplatform/dev/ramr/issue740-EllipseInn…
…erShadow
- Loading branch information
Showing
12 changed files
with
610 additions
and
61 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
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
73 changes: 73 additions & 0 deletions
73
.../Uno.Toolkit.Samples.Shared/Content/TestPages/ShadowContainerRectangleTestPage.WinUI.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,73 @@ | ||
<Page x:Class="Uno.Toolkit.Samples.Content.TestPages.ShadowContainerRectangleTestPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Uno.Toolkit.Samples.Content.TestPages" | ||
xmlns:utu="using:Uno.Toolkit.UI" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<Grid Background="Yellow" | ||
RowSpacing="10"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="Auto" /> | ||
</Grid.RowDefinitions> | ||
|
||
<StackPanel HorizontalAlignment="Center" | ||
VerticalAlignment="Center"> | ||
<Border x:Name="outerBorder" | ||
Background="Blue" | ||
Padding="10" | ||
Height="220" | ||
Width="220"> | ||
<utu:ShadowContainer x:Name="shadowContainer"> | ||
<Rectangle Width="200" | ||
Height="200" | ||
x:Name="border" | ||
Fill="Green" /> | ||
</utu:ShadowContainer> | ||
</Border> | ||
</StackPanel> | ||
|
||
<StackPanel Spacing="10" | ||
Grid.Row="1" | ||
Orientation="Horizontal" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center"> | ||
|
||
<StackPanel HorizontalAlignment="Center" | ||
VerticalAlignment="Center"> | ||
<TextBlock Text="Current Case" | ||
FontWeight="Bold" | ||
FontSize="20" /> | ||
<StackPanel Orientation="Horizontal" | ||
VerticalAlignment="Center"> | ||
<TextBlock Text="X Offset:" /> | ||
<TextBox x:Name="xOffsetText" /> | ||
</StackPanel> | ||
<StackPanel Orientation="Horizontal" | ||
VerticalAlignment="Center"> | ||
<TextBlock Text="Y Offset:" /> | ||
<TextBox x:Name="yOffsetText" /> | ||
</StackPanel> | ||
<StackPanel Orientation="Horizontal"> | ||
<CheckBox Content="Inner" | ||
x:Name="inner" /> | ||
</StackPanel> | ||
</StackPanel> | ||
|
||
<Button Content="Run Test Case" | ||
x:Name="runButton" | ||
Click="runButton_Click" /> | ||
<Button Content="Reset" | ||
x:Name="resetButton" | ||
Click="reset_Click" /> | ||
<TextBlock x:Name="statusText" | ||
VerticalAlignment="Center" /> | ||
|
||
|
||
</StackPanel> | ||
</Grid> | ||
</Page> |
75 changes: 75 additions & 0 deletions
75
...o.Toolkit.Samples.Shared/Content/TestPages/ShadowContainerRectangleTestPage.WinUI.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,75 @@ | ||
#if IS_WINUI | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Uno.Toolkit.Samples.Entities; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
|
||
using Microsoft.UI; | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
using Microsoft.UI.Xaml.Controls.Primitives; | ||
using Microsoft.UI.Xaml.Data; | ||
using Microsoft.UI.Xaml.Input; | ||
using Microsoft.UI.Xaml.Media; | ||
using Microsoft.UI.Xaml.Navigation; | ||
|
||
namespace Uno.Toolkit.Samples.Content.TestPages | ||
{ | ||
/// <summary> | ||
/// An empty page that can be used on its own or navigated to within a Frame. | ||
/// </summary> | ||
|
||
[SamplePage(SampleCategory.Tests, "ShadowContainerRectangleTest")] | ||
public sealed partial class ShadowContainerRectangleTestPage : Page | ||
{ | ||
public ShadowContainerRectangleTestPage() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void runButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
statusText.Text = "Running"; | ||
shadowContainer.Shadows.Clear(); | ||
|
||
if (!int.TryParse(xOffsetText.Text, out var xOffset)) | ||
{ | ||
xOffset = 0; | ||
} | ||
|
||
if (!int.TryParse(yOffsetText.Text, out var yOffset)) | ||
{ | ||
yOffset = 0; | ||
} | ||
|
||
var isInner = inner.IsChecked ?? false; | ||
|
||
shadowContainer.Shadows.Add(new UI.Shadow | ||
{ | ||
OffsetX = xOffset, | ||
OffsetY = yOffset, | ||
IsInner = isInner, | ||
Opacity = 1, | ||
Color = Colors.Red, | ||
}); | ||
|
||
statusText.Text = "Verify"; | ||
} | ||
|
||
private void reset_Click(object sender, RoutedEventArgs e) | ||
{ | ||
statusText.Text = string.Empty; | ||
|
||
xOffsetText.Text = string.Empty; | ||
yOffsetText.Text = string.Empty; | ||
inner.IsChecked = false; | ||
|
||
shadowContainer.Shadows.Clear(); | ||
} | ||
} | ||
} | ||
#endif |
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.