Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Fix Entry/SearchBar color issues (#306)
Browse files Browse the repository at this point in the history
* Fix disappearing Entry text on UWP Anniversary Edition
Fix background color reversion bug in UWP Phone
Move SearchBar styling on UWP to its own file
Make foreground/background color changes on UWP SearchBar/Entry consistent
Fix SearchBar color toggle bug on WP8

* Temporarily moving SDK target to previous version

* Fix build error on OSX
  • Loading branch information
hartez authored and Jason Smith committed Aug 16, 2016
1 parent 966683a commit 30c0dcb
Show file tree
Hide file tree
Showing 16 changed files with 544 additions and 532 deletions.
1 change: 1 addition & 0 deletions .nuspec/Xamarin.Forms.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\PageControl.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\Resources.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\FormsTextBoxStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />
<file src="..\Xamarin.Forms.Platform.UAP\bin\$Configuration$\AutoSuggestStyle.xbf" target="lib\uap10.0\Xamarin.Forms.Platform.UAP" />

<file src="..\Xamarin.Forms.Core\bin\$Configuration$\Xamarin.Forms.Core.dll" target="lib\uap10.0" />
<file src="..\docs\Xamarin.Forms.Core.xml" target="lib\uap10.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<AssemblyName>Xamarin.Forms.ControlGallery.WindowsUniversal</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
<TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static ContentPage PasswordPage()

static ContentPage SearchBarPage()
{
var searchbarTextColorDefaultToggle = new Entry() { Text = "Default SearchBar Text Color" };
var searchbarTextColorDefaultToggle = new SearchBar() { Text = "Default SearchBar Text Color" };
var searchbarTextColorToggleButton = new Button() { Text = "Toggle SearchBar Color" };
searchbarTextColorToggleButton.Clicked += (sender, args) => {
if (searchbarTextColorDefaultToggle.TextColor.IsDefault)
Expand All @@ -73,7 +73,7 @@ static ContentPage SearchBarPage()
}
};

var searchbarPlaceholderColorDefaultToggle = new Entry() { Placeholder = "Default Placeholder Color" };
var searchbarPlaceholderColorDefaultToggle = new SearchBar() { Placeholder = "Default Placeholder Color" };
var searchbarPlaceholderToggleButton = new Button() { Text = "Toggle Placeholder Color" };
searchbarPlaceholderToggleButton.Clicked += (sender, args) => {
if (searchbarPlaceholderColorDefaultToggle.PlaceholderColor.IsDefault)
Expand Down
389 changes: 389 additions & 0 deletions Xamarin.Forms.Platform.UAP/AutoSuggestStyle.xaml

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions Xamarin.Forms.Platform.UAP/FormsTextBoxStyle.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
<Setter Property="MinWidth" Value="{ThemeResource TextControlThemeMinWidth}" />
<Setter Property="MinHeight" Value="{ThemeResource TextControlThemeMinHeight}" />
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
<Setter Property="ForegroundFocusBrush" Value="{ThemeResource SystemControlForegroundChromeBlackHighBrush}" />
<Setter Property="PlaceholderForegroundBrush" Value="{ThemeResource SystemControlPageTextBaseMediumBrush}" />
<Setter Property="PlaceholderForegroundFocusBrush" Value="{ThemeResource SystemControlPageTextChromeBlackMediumLowBrush}" />
<Setter Property="Background" Value="{ThemeResource SystemControlBackgroundAltHighBrush}" />
<Setter Property="BackgroundFocusBrush" Value="{ThemeResource SystemControlBackgroundChromeWhiteBrush}" />
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundChromeDisabledLowBrush}" />
<Setter Property="SelectionHighlightColor" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
<Setter Property="BorderThickness" Value="{ThemeResource TextControlBorderThemeThickness}" />
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
<Setter Property="PlaceholderForegroundBrush" Value="{ThemeResource SystemControlPageTextBaseMediumBrush}" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
Expand Down Expand Up @@ -123,7 +125,7 @@
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
Storyboard.TargetName="PlaceholderTextContentPresenter">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlPageTextChromeBlackMediumLowBrush}" />
<DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForegroundFocusBrush, RelativeSource={RelativeSource TemplatedParent}}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
Storyboard.TargetName="BackgroundElement">
Expand All @@ -137,7 +139,7 @@
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlForegroundChromeBlackHighBrush}" />
<DiscreteObjectKeyFrame KeyTime="0" Value="{Binding ForegroundFocusBrush, RelativeSource={RelativeSource TemplatedParent}}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RequestedTheme"
Storyboard.TargetName="ContentElement">
Expand Down
Loading

0 comments on commit 30c0dcb

Please sign in to comment.