This repository was archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] Fixed updating Label TextDecorations when no Text is set #5013
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue5003.xaml
This file contains hidden or 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,15 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
| xmlns:local="clr-namespace:Xamarin.Forms.Controls.Issues" | ||
| x:Class="Xamarin.Forms.Controls.Issues.Issue5003"> | ||
| <ContentPage.Resources> | ||
| <ResourceDictionary> | ||
| <local:StrikeThroughIfTrueConverter x:Key="StrikeThroughIfTrueConverter"/> | ||
| </ResourceDictionary> | ||
| </ContentPage.Resources> | ||
| <ContentPage.Content> | ||
| <Label Text="{Binding MyNullString}" | ||
| TextDecorations="{Binding SomeBoolean, Converter={StaticResource StrikeThroughIfTrueConverter}}"/> | ||
| </ContentPage.Content> | ||
| </ContentPage> |
47 changes: 47 additions & 0 deletions
47
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue5003.xaml.cs
This file contains hidden or 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,47 @@ | ||
| using System; | ||
| using System.Globalization; | ||
| using Xamarin.Forms.CustomAttributes; | ||
| using Xamarin.Forms.Internals; | ||
|
|
||
| namespace Xamarin.Forms.Controls.Issues | ||
| { | ||
| [Preserve(AllMembers = true)] | ||
| [Issue(IssueTracker.Github, 5003, "iOS StrikeThrough applied to null string throws error", PlatformAffected.iOS)] | ||
| public partial class Issue5003 : ContentPage | ||
| { | ||
|
|
||
| public Issue5003() | ||
| { | ||
| #if APP | ||
| InitializeComponent(); | ||
| #endif | ||
| BindingContext = new VM(); | ||
| } | ||
|
|
||
| [Preserve(AllMembers = true)] | ||
| class VM | ||
| { | ||
| public string MyNullString { get; set; } | ||
| public bool SomeBoolean { get; set; } | ||
| } | ||
| } | ||
|
|
||
| public class StrikeThroughIfTrueConverter : IValueConverter | ||
| { | ||
| public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
| { | ||
| if (value is bool b) | ||
| { | ||
| if (b) | ||
| return TextDecorations.Strikethrough; | ||
| } | ||
|
|
||
| return TextDecorations.None; | ||
| } | ||
|
|
||
| public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
| { | ||
| throw new NotImplementedException(); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.