diff options
author | Stephane Delcroix <stephane@delcroix.org> | 2016-12-01 22:39:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-01 22:39:43 +0100 |
commit | 1ff0db9c6f4ba1167e6b2620066f83088f23c5bf (patch) | |
tree | dbab7e305046c6ee4b1ccafd60afd3e255385320 | |
parent | e413e0cf331ae1512e2d8a6fcc89446c1cf2225c (diff) | |
download | xamarin-forms-1ff0db9c6f4ba1167e6b2620066f83088f23c5bf.tar.gz xamarin-forms-1ff0db9c6f4ba1167e6b2620066f83088f23c5bf.tar.bz2 xamarin-forms-1ff0db9c6f4ba1167e6b2620066f83088f23c5bf.zip |
Jimmgarrido uwp toolbar (#588)
* Fixed CommandBar being clipped when expanded by removing explicit Height
* Add UITest
5 files changed, 51 insertions, 7 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla47295.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla47295.cs new file mode 100644 index 00000000..0277e7d4 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla47295.cs @@ -0,0 +1,39 @@ +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 47295, "Toolbar in a NavigationPage is clipped when expanded", PlatformAffected.WinRT)] + public class Bugzilla47295 : TestNavigationPage + { + protected override void Init() + { + PushAsync(new TestPage47295()); + } + } + + [Preserve(AllMembers = true)] + public class TestPage47295 : ContentPage + { + public TestPage47295() + { + var descLabel = new Label { Text = "Press '...' to expand the CommandBar. The ToolbarItem's text label should not be clipped." }; + var pressedLabel = new Label { Text = "ToolbarItem pressed.", IsVisible = false }; + Content = new StackLayout + { + Children = { + descLabel, + pressedLabel + } + }; + + ToolbarItems.Add(new ToolbarItem("Test", "toolbar_close", () => pressedLabel.IsVisible = true)); + } + } +}
\ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index 08c26ba1..625226db 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -140,6 +140,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44476.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla46630.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla47971.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla47295.cs" /> <Compile Include="$(MSBuildThisFileDirectory)CarouselAsync.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla34561.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla34727.cs" /> @@ -605,4 +606,4 @@ <Generator>MSBuild:UpdateDesignTimeXaml</Generator> </EmbeddedResource> </ItemGroup> -</Project>
\ No newline at end of file +</Project> diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailControlStyle.xaml b/Xamarin.Forms.Platform.UAP/MasterDetailControlStyle.xaml index d82f78af..cd3a4401 100644 --- a/Xamarin.Forms.Platform.UAP/MasterDetailControlStyle.xaml +++ b/Xamarin.Forms.Platform.UAP/MasterDetailControlStyle.xaml @@ -3,7 +3,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:uwp="using:Xamarin.Forms.Platform.UWP"> <Style TargetType="uwp:MasterDetailControl"> - <Setter Property="ToolbarForeground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" /> + <Setter Property="ToolbarBackground" Value="{ThemeResource SystemControlBackgroundChromeMediumLowBrush}"/> + <Setter Property="ToolbarForeground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="uwp:MasterDetailControl"> @@ -47,7 +48,7 @@ </StackPanel> <Border x:Name="TopCommandBarArea" Grid.Column="1" HorizontalAlignment="Stretch"> - <uwp:FormsCommandBar x:Name="CommandBar" VerticalContentAlignment="Top" Background="{TemplateBinding ToolbarBackground}" Height="{ThemeResource TitleBarHeight}" /> + <uwp:FormsCommandBar x:Name="CommandBar" VerticalContentAlignment="Top" Background="{TemplateBinding ToolbarBackground}" /> </Border> </Grid> diff --git a/Xamarin.Forms.Platform.UAP/PageControlStyle.xaml b/Xamarin.Forms.Platform.UAP/PageControlStyle.xaml index bd199487..e1137a7c 100644 --- a/Xamarin.Forms.Platform.UAP/PageControlStyle.xaml +++ b/Xamarin.Forms.Platform.UAP/PageControlStyle.xaml @@ -4,7 +4,8 @@ xmlns:uwp="using:Xamarin.Forms.Platform.UWP"> <Style TargetType="uwp:PageControl"> <Setter Property="ContentMargin" Value="0" /> - <Setter Property="TitleBrush" Value="{ThemeResource DefaultTextForegroundThemeBrush}" /> + <Setter Property="ToolbarBackground" Value="{ThemeResource SystemControlBackgroundChromeMediumLowBrush}"/> + <Setter Property="TitleBrush" Value="{ThemeResource DefaultTextForegroundThemeBrush}" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="uwp:PageControl"> @@ -27,7 +28,7 @@ </Border> <Border x:Name="TopCommandBarArea" Grid.Column="1" HorizontalAlignment="Stretch"> - <uwp:FormsCommandBar x:Name="CommandBar" Background="{TemplateBinding ToolbarBackground}" Height="{ThemeResource TitleBarHeight}" /> + <uwp:FormsCommandBar x:Name="CommandBar" Background="{TemplateBinding ToolbarBackground}" /> </Border> </Grid> diff --git a/Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml b/Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml index 6d54a073..de6bcf1e 100644 --- a/Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml +++ b/Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml @@ -3,7 +3,9 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:uwp="using:Xamarin.Forms.Platform.UWP"> <Style x:Key="TabbedPageStyle" TargetType="uwp:FormsPivot"> - <Setter Property="HeaderTemplate"> + <Setter Property="ToolbarBackground" Value="{ThemeResource SystemControlBackgroundChromeMediumLowBrush}"/> + + <Setter Property="HeaderTemplate"> <Setter.Value> <DataTemplate> <TextBlock Name="TabbedPageHeaderTextBlock" Text="{Binding Title}" Style="{ThemeResource BodyTextBlockStyle}" /> @@ -75,7 +77,7 @@ </Border> <Border x:Name="TopCommandBarArea" Grid.Column="1" HorizontalAlignment="Stretch"> - <uwp:FormsCommandBar x:Name="CommandBar" VerticalContentAlignment="Top" Background="{TemplateBinding ToolbarBackground}" Height="{ThemeResource TitleBarHeight}" /> + <uwp:FormsCommandBar x:Name="CommandBar" VerticalContentAlignment="Top" Background="{TemplateBinding ToolbarBackground}" /> </Border> </Grid> |