-
Notifications
You must be signed in to change notification settings - Fork 747
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 #5925 from unoplatform/dev/jela/xbind-default-data…
…template Propagate x:DefaultBindMode to DataTemplate definitions
- Loading branch information
Showing
6 changed files
with
321 additions
and
29 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
76 changes: 76 additions & 0 deletions
76
....Tests/Windows_UI_Xaml_Data/xBindTests/Controls/Binding_DefaultBindMode_DataTemplate.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,76 @@ | ||
<Page x:Class="Uno.UI.Tests.Windows_UI_Xaml_Data.xBindTests.Controls.Binding_DefaultBindMode_DataTemplate" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:Uno.UI.Tests.Windows_UI_Xaml_Data.xBindTests.Controls" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
x:DefaultBindMode="OneWay" | ||
mc:Ignorable="d"> | ||
|
||
<Page.Resources> | ||
<DataTemplate x:Key="myTemplate" x:DataType="local:Binding_DefaultBindMode_DataTemplate_Model"> | ||
<Grid> | ||
<StackPanel> | ||
<TextBlock x:Name="Default_undefined" | ||
x:FieldModifier="public" | ||
Text="{x:Bind Default_undefined_Property}" /> | ||
<TextBlock x:Name="Default_undefined_OneWay" | ||
x:FieldModifier="public" | ||
Text="{x:Bind Default_undefined_OneWay_Property, Mode=OneWay}" /> | ||
<TextBlock x:Name="Default_undefined_TwoWay" | ||
x:FieldModifier="public" | ||
Text="{x:Bind Default_undefined_TwoWay_Property, Mode=TwoWay}" /> | ||
</StackPanel> | ||
|
||
<StackPanel x:DefaultBindMode="OneWay"> | ||
<TextBlock x:Name="Default_OneWay" | ||
x:FieldModifier="public" | ||
Text="{x:Bind Default_OneWay_Property}" /> | ||
<TextBlock x:Name="Default_OneWay_OneWay" | ||
x:FieldModifier="public" | ||
Text="{x:Bind Default_OneWay_OneWay_Property, Mode=OneWay}" /> | ||
<TextBlock x:Name="Default_OneWay_TwoWay" | ||
x:FieldModifier="public" | ||
Text="{x:Bind Default_OneWay_TwoWay_Property, Mode=TwoWay}" /> | ||
</StackPanel> | ||
|
||
<StackPanel x:DefaultBindMode="TwoWay"> | ||
<TextBlock x:Name="Default_TwoWay" | ||
x:FieldModifier="public" | ||
Text="{x:Bind Default_TwoWay_Property}" /> | ||
<TextBlock x:Name="Default_TwoWay_OneWay" | ||
x:FieldModifier="public" | ||
Text="{x:Bind Default_TwoWay_OneWay_Property, Mode=OneWay}" /> | ||
<TextBlock x:Name="Default_TwoWay_TwoWay" | ||
x:FieldModifier="public" | ||
Text="{x:Bind Default_TwoWay_TwoWay_Property, Mode=TwoWay}" /> | ||
</StackPanel> | ||
|
||
<StackPanel x:DefaultBindMode="TwoWay"> | ||
<TextBlock x:Name="Nested_Default_1" | ||
x:FieldModifier="public" | ||
Text="{x:Bind Nested_Default_1_Property}" /> | ||
<StackPanel x:DefaultBindMode="OneWay"> | ||
<TextBlock x:Name="Nested_Default_2" | ||
x:FieldModifier="public" | ||
Text="{x:Bind Nested_Default_2_Property}" /> | ||
<TextBlock x:Name="Nested_Default_OneWay_OneTime" | ||
x:FieldModifier="public" | ||
Text="{x:Bind Nested_Default_OneWay_OneTime_Property, Mode=OneTime}" /> | ||
<TextBlock x:Name="Nested_Default_OneWay_OneWay" | ||
x:FieldModifier="public" | ||
Text="{x:Bind Nested_Default_OneWay_OneWay_Property, Mode=OneWay}" /> | ||
<TextBlock x:Name="Nested_Default_OneWay_TwoWay" | ||
x:FieldModifier="public" | ||
Text="{x:Bind Nested_Default_OneWay_TwoWay_Property, Mode=TwoWay}" /> | ||
</StackPanel> | ||
</StackPanel> | ||
</Grid> | ||
|
||
</DataTemplate> | ||
</Page.Resources> | ||
|
||
<ContentControl ContentTemplate="{StaticResource myTemplate}" | ||
Content="{Binding}" /> | ||
|
||
</Page> |
161 changes: 161 additions & 0 deletions
161
...sts/Windows_UI_Xaml_Data/xBindTests/Controls/Binding_DefaultBindMode_DataTemplate.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,161 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
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 Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 | ||
|
||
namespace Uno.UI.Tests.Windows_UI_Xaml_Data.xBindTests.Controls | ||
{ | ||
/// <summary> | ||
/// An empty page that can be used on its own or navigated to within a Frame. | ||
/// </summary> | ||
public sealed partial class Binding_DefaultBindMode_DataTemplate : Page | ||
{ | ||
public Binding_DefaultBindMode_DataTemplate() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
|
||
public partial class Binding_DefaultBindMode_DataTemplate_Model : DependencyObject | ||
{ | ||
public string Default_undefined_Property | ||
{ | ||
get { return (string)GetValue(Default_undefined_PropertyProperty); } | ||
set { SetValue(Default_undefined_PropertyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty Default_undefined_PropertyProperty = | ||
DependencyProperty.Register("Default_undefined_Property", typeof(string), typeof(Binding_DefaultBindMode_DataTemplate_Model), new FrameworkPropertyMetadata(null)); | ||
|
||
public string Default_undefined_OneWay_Property | ||
{ | ||
get { return (string)GetValue(Default_undefined_OneWay_PropertyProperty); } | ||
set { SetValue(Default_undefined_OneWay_PropertyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty Default_undefined_OneWay_PropertyProperty = | ||
DependencyProperty.Register("Default_undefined_OneWay_Property", typeof(string), typeof(Binding_DefaultBindMode_DataTemplate_Model), new FrameworkPropertyMetadata(null)); | ||
|
||
public string Default_undefined_TwoWay_Property | ||
{ | ||
get { return (string)GetValue(Default_undefined_TwoWay_PropertyProperty); } | ||
set { SetValue(Default_undefined_TwoWay_PropertyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty Default_undefined_TwoWay_PropertyProperty = | ||
DependencyProperty.Register("Default_undefined_TwoWay_Property", typeof(string), typeof(Binding_DefaultBindMode_DataTemplate_Model), new FrameworkPropertyMetadata(null)); | ||
|
||
public string Default_OneWay_Property | ||
{ | ||
get { return (string)GetValue(Default_OneWay_PropertyProperty); } | ||
set { SetValue(Default_OneWay_PropertyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty Default_OneWay_PropertyProperty = | ||
DependencyProperty.Register("Default_OneWay_Property", typeof(string), typeof(Binding_DefaultBindMode_DataTemplate_Model), new FrameworkPropertyMetadata(null)); | ||
|
||
public string Default_OneWay_OneWay_Property | ||
{ | ||
get { return (string)GetValue(Default_OneWay_OneWay_PropertyProperty); } | ||
set { SetValue(Default_OneWay_OneWay_PropertyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty Default_OneWay_OneWay_PropertyProperty = | ||
DependencyProperty.Register("Default_OneWay_OneWay_Property", typeof(string), typeof(Binding_DefaultBindMode_DataTemplate_Model), new FrameworkPropertyMetadata(null)); | ||
|
||
|
||
public string Default_OneWay_TwoWay_Property | ||
{ | ||
get { return (string)GetValue(Default_OneWay_TwoWay_PropertyProperty); } | ||
set { SetValue(Default_OneWay_TwoWay_PropertyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty Default_OneWay_TwoWay_PropertyProperty = | ||
DependencyProperty.Register("Default_OneWay_TwoWay_Property", typeof(string), typeof(Binding_DefaultBindMode_DataTemplate_Model), new FrameworkPropertyMetadata(null)); | ||
|
||
public string Default_TwoWay_Property | ||
{ | ||
get { return (string)GetValue(Default_TwoWay_PropertyProperty); } | ||
set { SetValue(Default_TwoWay_PropertyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty Default_TwoWay_PropertyProperty = | ||
DependencyProperty.Register("Default_TwoWay_Property", typeof(string), typeof(Binding_DefaultBindMode_DataTemplate_Model), new FrameworkPropertyMetadata(null)); | ||
|
||
public string Default_TwoWay_OneWay_Property | ||
{ | ||
get { return (string)GetValue(Default_TwoWay_OneWay_PropertyProperty); } | ||
set { SetValue(Default_TwoWay_OneWay_PropertyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty Default_TwoWay_OneWay_PropertyProperty = | ||
DependencyProperty.Register("Default_TwoWay_OneWay_Property", typeof(string), typeof(Binding_DefaultBindMode_DataTemplate_Model), new FrameworkPropertyMetadata(null)); | ||
|
||
public string Default_TwoWay_TwoWay_Property | ||
{ | ||
get { return (string)GetValue(Default_TwoWay_TwoWay_PropertyProperty); } | ||
set { SetValue(Default_TwoWay_TwoWay_PropertyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty Default_TwoWay_TwoWay_PropertyProperty = | ||
DependencyProperty.Register("Default_TwoWay_TwoWay_Property", typeof(string), typeof(Binding_DefaultBindMode_DataTemplate_Model), new FrameworkPropertyMetadata(null)); | ||
|
||
public string Nested_Default_1_Property | ||
{ | ||
get { return (string)GetValue(Nested_Default_1_PropertyProperty); } | ||
set { SetValue(Nested_Default_1_PropertyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty Nested_Default_1_PropertyProperty = | ||
DependencyProperty.Register("Nested_Default_1_Property", typeof(string), typeof(Binding_DefaultBindMode_DataTemplate_Model), new FrameworkPropertyMetadata(null)); | ||
|
||
public string Nested_Default_2_Property | ||
{ | ||
get { return (string)GetValue(Nested_Default_2_PropertyProperty); } | ||
set { SetValue(Nested_Default_2_PropertyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty Nested_Default_2_PropertyProperty = | ||
DependencyProperty.Register("Nested_Default_2_Property", typeof(string), typeof(Binding_DefaultBindMode_DataTemplate_Model), new FrameworkPropertyMetadata(null)); | ||
|
||
public string Nested_Default_OneWay_OneWay_Property | ||
{ | ||
get { return (string)GetValue(Nested_Default_OneWay_OneWay_PropertyProperty); } | ||
set { SetValue(Nested_Default_OneWay_OneWay_PropertyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty Nested_Default_OneWay_OneWay_PropertyProperty = | ||
DependencyProperty.Register("Nested_Default_OneWay_OneWay_Property", typeof(string), typeof(Binding_DefaultBindMode_DataTemplate_Model), new FrameworkPropertyMetadata(null)); | ||
|
||
public string Nested_Default_OneWay_TwoWay_Property | ||
{ | ||
get { return (string)GetValue(Nested_Default_OneWay_TwoWay_PropertyProperty); } | ||
set { SetValue(Nested_Default_OneWay_TwoWay_PropertyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty Nested_Default_OneWay_TwoWay_PropertyProperty = | ||
DependencyProperty.Register("Nested_Default_OneWay_TwoWay_Property", typeof(string), typeof(Binding_DefaultBindMode_DataTemplate_Model), new FrameworkPropertyMetadata(null)); | ||
|
||
public string Nested_Default_OneWay_OneTime_Property | ||
{ | ||
get { return (string)GetValue(Nested_Default_OneWay_OneTime_PropertyProperty); } | ||
set { SetValue(Nested_Default_OneWay_OneTime_PropertyProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty Nested_Default_OneWay_OneTime_PropertyProperty = | ||
DependencyProperty.Register("Nested_Default_OneWay_OneTime_Property", typeof(string), typeof(Binding_DefaultBindMode_DataTemplate_Model), new FrameworkPropertyMetadata(null)); | ||
} | ||
} |
Oops, something went wrong.