-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(xLoad): Add xLoad binding capabilities
- Loading branch information
1 parent
017cdce
commit e2868b0
Showing
32 changed files
with
844 additions
and
123 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
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
19 changes: 19 additions & 0 deletions
19
src/SamplesApp/UITests.Shared/Windows_UI_Xaml/xLoadTests/xLoad_FindName.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,19 @@ | ||
<UserControl | ||
x:Class="UITests.Windows_UI_Xaml.xLoadTests.xLoad_FindName" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Windows_UI_Xaml.xLoadTests" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<StackPanel> | ||
<TextBlock Text="Clicking on the Load button should make a Green box appear in the Red border"/> | ||
<Button Content="Load" x:Name="LoadButton"/> | ||
<Border BorderBrush="Red" BorderThickness="1" Width="60" Height="60"> | ||
<Border x:Name="LoadBorder" Width="50" Height="50" Background="Green" x:Load="False"/> | ||
</Border> | ||
</StackPanel> | ||
</UserControl> |
35 changes: 35 additions & 0 deletions
35
src/SamplesApp/UITests.Shared/Windows_UI_Xaml/xLoadTests/xLoad_FindName.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,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Uno.UI.Samples.Controls; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 | ||
|
||
namespace UITests.Windows_UI_Xaml.xLoadTests | ||
{ | ||
[Sample("xLoad", Name = "xLoad_FindName")] | ||
public sealed partial class xLoad_FindName : UserControl | ||
{ | ||
public xLoad_FindName() | ||
{ | ||
this.InitializeComponent(); | ||
LoadButton.Click += LoadButton_Click; | ||
} | ||
|
||
private void LoadButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
FindName("LoadBorder"); | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/SamplesApp/UITests.Shared/Windows_UI_Xaml/xLoadTests/xLoad_Literal.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,23 @@ | ||
<UserControl | ||
x:Class="UITests.Windows_UI_Xaml.xLoadTests.xLoad_Literal" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Windows_UI_Xaml.xLoadTests" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<StackPanel> | ||
<TextBlock Text="Should see two Red borders, the top one should be empty, the bottom one should contain a Green box"/> | ||
<TextBlock Margin="0, 10, 0, 0" Text="Load = False" HorizontalAlignment="Center"/> | ||
<Border BorderBrush="Red" BorderThickness="1" Width="60" Height="60"> | ||
<Border x:Name="LoadBorderFalse" Width="50" Height="50" Background="Green" x:Load="False"/> | ||
</Border> | ||
<TextBlock Margin="0, 10, 0, 0" Text="Load = True" HorizontalAlignment="Center"/> | ||
<Border BorderBrush="Red" BorderThickness="1" Width="60" Height="60"> | ||
<Border x:Name="LoadBorderTrue" Width="50" Height="50" Background="Green" x:Load="True"/> | ||
</Border> | ||
</StackPanel> | ||
</UserControl> |
29 changes: 29 additions & 0 deletions
29
src/SamplesApp/UITests.Shared/Windows_UI_Xaml/xLoadTests/xLoad_Literal.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,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Uno.UI.Samples.Controls; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 | ||
|
||
namespace UITests.Windows_UI_Xaml.xLoadTests | ||
{ | ||
[Sample("xLoad", Name = "xLoad_Literal")] | ||
public sealed partial class xLoad_Literal : UserControl | ||
{ | ||
public xLoad_Literal() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/SamplesApp/UITests.Shared/Windows_UI_Xaml/xLoadTests/xLoad_Test_For_Leak.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,17 @@ | ||
<UserControl | ||
x:Class="UITests.Windows_UI_Xaml.xLoadTests.xLoad_Test_For_Leak" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Windows_UI_Xaml.xLoadTests" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<Grid> | ||
<Border x:Name="outerBorder" BorderBrush="Red" BorderThickness="1" Width="60" Height="60"> | ||
<Border x:Name="LoadBorder" Width="50" Height="50" Background="Green" x:Load="{x:Bind IsLoad, Mode=OneWay}" /> | ||
</Border> | ||
</Grid> | ||
</UserControl> |
41 changes: 41 additions & 0 deletions
41
src/SamplesApp/UITests.Shared/Windows_UI_Xaml/xLoadTests/xLoad_Test_For_Leak.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,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Uno.UI.Samples.Controls; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 | ||
|
||
namespace UITests.Windows_UI_Xaml.xLoadTests | ||
{ | ||
[Sample("xLoad", Name = "xLoad_Test_For_Leak")] | ||
public sealed partial class xLoad_Test_For_Leak : UserControl | ||
{ | ||
public bool IsLoad | ||
{ | ||
get { return (bool)GetValue(IsLoadProperty); } | ||
set { SetValue(IsLoadProperty, value); } | ||
} | ||
|
||
// Using a DependencyProperty as the backing store for IsLoad. This enables animation, styling, binding, etc... | ||
public static readonly DependencyProperty IsLoadProperty = | ||
DependencyProperty.Register("IsLoad", typeof(bool), typeof(xLoad_Test_For_Leak), new PropertyMetadata(false)); | ||
|
||
public xLoad_Test_For_Leak() | ||
{ | ||
this.InitializeComponent(); | ||
|
||
IsLoad = true; | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/SamplesApp/UITests.Shared/Windows_UI_Xaml/xLoadTests/xLoad_xBind.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,18 @@ | ||
<UserControl | ||
x:Class="UITests.Windows_UI_Xaml.xLoadTests.xLoad_xBind" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Windows_UI_Xaml.xLoadTests" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<StackPanel> | ||
<CheckBox Content="Is Loaded" x:Name="LoadCheckBox" Margin="30" IsChecked="{x:Bind IsLoad, Mode=TwoWay}" /> | ||
<Border BorderBrush="Red" BorderThickness="1" Width="60" Height="60"> | ||
<Border x:Name="LoadBorder" Width="50" Height="50" Background="Green" x:Load="{x:Bind IsLoad, Mode=OneWay}" /> | ||
</Border> | ||
</StackPanel> | ||
</UserControl> |
39 changes: 39 additions & 0 deletions
39
src/SamplesApp/UITests.Shared/Windows_UI_Xaml/xLoadTests/xLoad_xBind.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,39 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Uno.UI.Samples.Controls; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 | ||
|
||
namespace UITests.Windows_UI_Xaml.xLoadTests | ||
{ | ||
[Sample("xLoad", Name = "xLoad_xBind")] | ||
public sealed partial class xLoad_xBind : UserControl | ||
{ | ||
public bool IsLoad | ||
{ | ||
get { return (bool)GetValue(IsLoadProperty); } | ||
set { SetValue(IsLoadProperty, value); } | ||
} | ||
|
||
// Using a DependencyProperty as the backing store for IsLoad. This enables animation, styling, binding, etc... | ||
public static readonly DependencyProperty IsLoadProperty = | ||
DependencyProperty.Register("IsLoad", typeof(bool), typeof(xLoad_xBind), new PropertyMetadata(false)); | ||
|
||
public xLoad_xBind() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
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.