-
Notifications
You must be signed in to change notification settings - Fork 746
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix iOS items dependency property propagation
- Loading branch information
1 parent
780c43e
commit e7951bb
Showing
4 changed files
with
95 additions
and
1 deletion.
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
48 changes: 48 additions & 0 deletions
48
...pp/UITests.Shared/Windows_UI_Xaml_Controls/ListView/ListView_DataContext_Propagation.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,48 @@ | ||
<UserControl | ||
x:Class="UITests.Shared.Windows_UI_Xaml_Controls.ListView.ListView_DataContext_Propagation" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Shared.Windows_UI_Xaml_Controls.ListView" | ||
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 x:Name="topGrid" DataContext="This is the datacontext"> | ||
<TextBlock x:Name="Title" Text="{Binding}"/> | ||
|
||
<ListView | ||
Margin="0,20,0,0" | ||
HorizontalContentAlignment="Stretch" | ||
SelectionMode="None" | ||
IsItemClickEnabled="False"> | ||
<ListView.ItemContainerStyle> | ||
<Style TargetType="ListViewItem"> | ||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> | ||
<Setter Property="Padding" Value="0" /> | ||
<Setter Property="Margin" Value="0" /> | ||
</Style> | ||
</ListView.ItemContainerStyle> | ||
<ListView.ItemTemplate> | ||
<DataTemplate> | ||
<RelativePanel Margin="0,20,0,0"> | ||
<Button FontSize="12" Click="Button_Click"> | ||
<Button.Content> | ||
<TextBlock> | ||
<Run Text="Should be 'this is the DataContext': " /> | ||
<Run Text="{Binding Text,ElementName=Title}" /> | ||
</TextBlock> | ||
</Button.Content> | ||
</Button> | ||
</RelativePanel> | ||
|
||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
|
||
<x:String>Item 01</x:String> | ||
<x:String>Item 02</x:String> | ||
</ListView> | ||
|
||
</Grid> | ||
</UserControl> |
34 changes: 34 additions & 0 deletions
34
...UITests.Shared/Windows_UI_Xaml_Controls/ListView/ListView_DataContext_Propagation.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,34 @@ | ||
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.Shared.Windows_UI_Xaml_Controls.ListView | ||
{ | ||
[SampleControlInfo("ListView", "ListView_DataContext_Propagation")] | ||
public sealed partial class ListView_DataContext_Propagation : UserControl | ||
{ | ||
public ListView_DataContext_Propagation() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void Button_Click(object sender, RoutedEventArgs e) | ||
{ | ||
topGrid.DataContext = "Button Clicked " + sender.ToString(); | ||
} | ||
} | ||
} |
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