-
Notifications
You must be signed in to change notification settings - Fork 717
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 #2356 from unoplatform/dev/djo/listview-ios-fix-6
[iOS] Fix bug with ListViewItem.Margin application
- Loading branch information
Showing
9 changed files
with
192 additions
and
13 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
104 changes: 104 additions & 0 deletions
104
...lesApp/UITests.Shared/Windows_UI_Xaml_Controls/ListView/ListView_Margin_On_Container.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,104 @@ | ||
<UserControl x:Class="UITests.Shared.Windows_UI_Xaml_Controls.ListView.ListView_Margin_On_Container" | ||
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"> | ||
|
||
|
||
<UserControl.Resources> | ||
<Style x:Key="BillingAddressListViewStyle" | ||
TargetType="ListViewItem"> | ||
|
||
<Setter Property="Background" | ||
Value="LightBlue" /> | ||
<Setter Property="BorderThickness" | ||
Value="0" /> | ||
<Setter Property="Padding" | ||
Value="0" /> | ||
<Setter Property="Margin" | ||
Value="0,42,0,0" /> | ||
|
||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="ListViewItem"> | ||
<Grid x:Name="RootGrid" | ||
Background="{TemplateBinding Background}" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="0,0,0,1" | ||
Padding="{TemplateBinding Padding}"> | ||
<!-- ContentPresenter --> | ||
<ContentPresenter x:Name="ContentPresenter" | ||
Content="{TemplateBinding Content}" | ||
ContentTemplate="{TemplateBinding ContentTemplate}" | ||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" | ||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> | ||
</Grid> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
<!-- BillingAddress Template --> | ||
<DataTemplate x:Key="BillingAddressTemplate"> | ||
<Grid Background="LightPink" | ||
x:Name="ContentGrid"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="Auto" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
<!-- Info --> | ||
<StackPanel Margin="12,0"> | ||
|
||
<!-- Location Name --> | ||
<TextBlock MaxLines="1"> | ||
<Run Text="Maximus" /> | ||
<Run Text="Aurelius" /> | ||
</TextBlock> | ||
|
||
<!-- Address Line 1 --> | ||
<TextBlock Text="215 St. Jacques" /> | ||
|
||
<!-- Address Line 2 --> | ||
<TextBlock Text="Suite 500" /> | ||
|
||
<!-- Address Line 2 --> | ||
<TextBlock> | ||
<Run Text="Montreal" /><Run Text="," /> | ||
<Run Text="QC" /><Run Text="," /> | ||
<Run Text="H2Y 1M6" /> | ||
</TextBlock> | ||
|
||
<StackPanel Margin="0,4,0,0"> | ||
|
||
<!-- Phone Number Day --> | ||
<TextBlock> | ||
<Run Text="1 888 926-1276" /> | ||
<Run Text="(jour)" /> | ||
</TextBlock> | ||
|
||
<!-- Phone Number Evening --> | ||
<TextBlock> | ||
<Run Text="1 888 926-1276" /> | ||
<Run Text="(soir)" /> | ||
</TextBlock> | ||
</StackPanel> | ||
</StackPanel> | ||
</Grid> | ||
</DataTemplate> | ||
</UserControl.Resources> | ||
|
||
<Grid> | ||
<ListView x:Name="ListTest" | ||
ItemsSource="012345678" | ||
ItemContainerStyle="{StaticResource BillingAddressListViewStyle}" | ||
ItemTemplate="{StaticResource BillingAddressTemplate}" | ||
IsItemClickEnabled="True" | ||
SelectionMode="Single" | ||
Margin="0,8,0,0" /> | ||
</Grid> | ||
</UserControl> |
30 changes: 30 additions & 0 deletions
30
...App/UITests.Shared/Windows_UI_Xaml_Controls/ListView/ListView_Margin_On_Container.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,30 @@ | ||
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(description: "ListView with Margin set on ListViewItems via ItemContainerStyle")] | ||
public sealed partial class ListView_Margin_On_Container : UserControl | ||
{ | ||
|
||
public ListView_Margin_On_Container() | ||
{ | ||
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
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