This repository has been archived by the owner on May 1, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CSS] accept CSS values in converters
- Loading branch information
1 parent
a72549a
commit cb35e96
Showing
7 changed files
with
72 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Xamarin.Forms.Xaml | ||
{ | ||
public interface IConverterOptions | ||
{ | ||
bool IgnoreCase { get; } | ||
} | ||
} |
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
39 changes: 39 additions & 0 deletions
39
Xamarin.Forms.Core/StyleSheets/StyleSheetServiceProvider.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,39 @@ | ||
using System; | ||
using Xamarin.Forms.Xaml; | ||
|
||
namespace Xamarin.Forms.StyleSheets | ||
{ | ||
class StyleSheetServiceProvider : IServiceProvider | ||
{ | ||
IProvideValueTarget vtProvider; | ||
IConverterOptions convOptions => new ConverterOptions(); | ||
|
||
public StyleSheetServiceProvider(object targetObject, object targetProperty) | ||
{ | ||
vtProvider = new ValueTargetProvider { | ||
TargetObject = targetObject, | ||
TargetProperty = targetProperty | ||
}; | ||
} | ||
|
||
public object GetService(Type serviceType) | ||
{ | ||
if (serviceType == typeof(IProvideValueTarget)) | ||
return vtProvider; | ||
if (serviceType == typeof(IConverterOptions)) | ||
return convOptions; | ||
return null; | ||
} | ||
|
||
class ValueTargetProvider : IProvideValueTarget | ||
{ | ||
public object TargetObject { get; set; } | ||
public object TargetProperty { get; set; } | ||
} | ||
|
||
class ConverterOptions : IConverterOptions | ||
{ | ||
public bool IgnoreCase => true; | ||
} | ||
} | ||
} |
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