VisualStateManager phase 1 (#1405)
* Port from old VSM branch * Add PS and notes * Checkpoint: entry text UWP mostly working, need to check on background colors * Remove irrelevant samples from the EntryDisabledStatesGallery Make Background color work on UWP Entry with VSM * Add platform specific for disabling legacy colors on Android * Add OnPlatform example to visual state manager gallery * Add example OnIdiom in Visual State Manager * Add platform specific for disabling legacy color mode on iOS Entry * Add gallery for Button disabled states Handling legacy colors for Buttons on Android * Split out disabled states galleries; disabled legacy handling for Picker * TimePicker disabled states * DatePicker color management on Android * Color management for pre-AppCompat button * Button legacy color handling on iOS * Consolidate Platform Specifics; legacy colors working for iOS Picker and DatePicker * Fix broken search bar color management SearchBar color management working with VSM Add test page for SearchBar disabled color management Consolidate legacy color management check code into extension method on Android * Legacy color management for Editor on Android * Fix legacy color stuff for SearchBar Cancel button on iOS * C# 7 cleanup * Add colors for Cancel Button * Make sure VisualStateGroup collections set by styles are distinct objects * Validation example * Make common state names consts * Make the Windows VSM and Forms VSM work together * Update galleries for Windows * Make new methods internal * Split gallery classes and add more explanation to validation example * Remove debugging statements * Add a quick code-only example * Make legacy color management work for fast button renderer * Remove old TODO * Update docs * Move RunTimeNamePropertyAttribute to Xamarin.Forms.Xaml namespace * Verify XF namespace when looking for VisualState * Use nameof * Make common states constants public * Cast VisualElement directly so it crashes if the property is set on the wrong type * Collection -> IList for VisualStateManager * Setting fromStyle to true * Remove extraneous `private set` * Seal VSM classes * Use constraints instead of == * Add teardown method; use constraints rather than == * Remove null checking with GetVisualStateGroups * Don't explicitly initialize collections on elements * Actually, turns out that fromStyle:false *was* correct * Direct casts * Use GetIsDefault check in GoToState * Validate parents in FindTypeForVisualState * Validate group and state names on Add * Fixed check for setter collection * Fix issues with "duplicate" names when VisualStateGroups declared directly on VisualElements * Add gallery example for VSGs directly on VisualElements * Update docs * Fix bug where initial TextColor isn't set for FastRenderer Button * Move to explicit VisualStateGroupList in Setter * Fix return types for unit tests * Using string.CompareOrdinal in GetState * Update docs * Add check for null/empty VisualState Name properties
This commit is contained in:
Родитель
c8b4685bc9
Коммит
28948d7ef7
|
@ -32,6 +32,7 @@ namespace Xamarin.Forms.Core.XamlC
|
|||
var parts = value.Split('.');
|
||||
if (parts.Length == 1) {
|
||||
var parent = node.Parent?.Parent as IElementNode ?? (node.Parent?.Parent as IListNode)?.Parent as IElementNode;
|
||||
|
||||
if ((node.Parent as ElementNode)?.XmlType.NamespaceUri == XamlParser.XFUri &&
|
||||
((node.Parent as ElementNode)?.XmlType.Name == "Setter" || (node.Parent as ElementNode)?.XmlType.Name == "PropertyCondition")) {
|
||||
if (parent.XmlType.NamespaceUri == XamlParser.XFUri &&
|
||||
|
@ -41,6 +42,15 @@ namespace Xamarin.Forms.Core.XamlC
|
|||
typeName = (ttnode as ValueNode).Value as string;
|
||||
else if (ttnode is IElementNode)
|
||||
typeName = ((ttnode as IElementNode).CollectionItems.FirstOrDefault() as ValueNode)?.Value as string ?? ((ttnode as IElementNode).Properties [new XmlName("", "TypeName")] as ValueNode)?.Value as string;
|
||||
} else if (parent.XmlType.NamespaceUri == XamlParser.XFUri && parent.XmlType.Name == "VisualState") {
|
||||
var current = parent.Parent.Parent.Parent as IElementNode;
|
||||
if (current.XmlType.NamespaceUri == XamlParser.XFUri && current.XmlType.Name == "Setter") {
|
||||
// Parent will be a Style, and the type will be that Style's TargetType
|
||||
typeName =
|
||||
((current?.Parent as IElementNode)?.Properties[new XmlName("", "TargetType")] as ValueNode)?.Value as string;
|
||||
} else {
|
||||
typeName = current.XmlType.Name;
|
||||
}
|
||||
}
|
||||
} else if ((node.Parent as ElementNode)?.XmlType.NamespaceUri == XamlParser.XFUri && (node.Parent as ElementNode)?.XmlType.Name == "Trigger")
|
||||
typeName = ((node.Parent as ElementNode).Properties [new XmlName("", "TargetType")] as ValueNode).Value as string;
|
||||
|
|
|
@ -19,6 +19,12 @@ namespace Xamarin.Forms.Core.XamlC
|
|||
((IElementNode)node).CollectionItems.Count == 1)
|
||||
valueNode = ((IElementNode)node).CollectionItems[0];
|
||||
|
||||
var bpNode = ((ValueNode)((IElementNode)node).Properties[new XmlName("", "Property")]);
|
||||
var bpRef = (new BindablePropertyConverter()).GetBindablePropertyFieldReference((string)bpNode.Value, module, bpNode);
|
||||
|
||||
if (SetterValueIsCollection(bpRef, module, node, context))
|
||||
yield break;
|
||||
|
||||
if (valueNode == null)
|
||||
throw new XamlParseException("Missing Value for Setter", (IXmlLineInfo)node);
|
||||
|
||||
|
@ -27,8 +33,6 @@ namespace Xamarin.Forms.Core.XamlC
|
|||
yield break;
|
||||
|
||||
var value = ((string)((ValueNode)valueNode).Value);
|
||||
var bpNode = ((ValueNode)((IElementNode)node).Properties[new XmlName("", "Property")]);
|
||||
var bpRef = (new BindablePropertyConverter()).GetBindablePropertyFieldReference((string)bpNode.Value, module, bpNode);
|
||||
|
||||
TypeReference _;
|
||||
var setValueRef = module.ImportReference(module.ImportReference(typeof(Setter)).GetProperty(p => p.Name == "Value", out _).SetMethod);
|
||||
|
@ -43,5 +47,28 @@ namespace Xamarin.Forms.Core.XamlC
|
|||
//set the value
|
||||
yield return Instruction.Create(OpCodes.Callvirt, setValueRef);
|
||||
}
|
||||
|
||||
static bool SetterValueIsCollection(FieldReference bindablePropertyReference, ModuleDefinition module, BaseNode node, ILContext context)
|
||||
{
|
||||
var items = (node as IElementNode)?.CollectionItems;
|
||||
|
||||
if (items == null || items.Count <= 0)
|
||||
return false;
|
||||
|
||||
// Is this a generic type ?
|
||||
var generic = bindablePropertyReference.GetBindablePropertyType(node, module) as GenericInstanceType;
|
||||
|
||||
// With a single generic argument?
|
||||
if (generic?.GenericArguments.Count != 1)
|
||||
return false;
|
||||
|
||||
// Is the generic argument assignable from this value?
|
||||
var genericType = generic.GenericArguments[0];
|
||||
|
||||
if (!(items[0] is IElementNode firstItem))
|
||||
return false;
|
||||
|
||||
return context.Variables[firstItem].VariableType.InheritsFromOrImplements(genericType);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
|
@ -39,7 +40,7 @@ namespace Xamarin.Forms.Build.Tasks
|
|||
{
|
||||
VariableDefinition namescopeVarDef;
|
||||
IList<string> namesInNamescope;
|
||||
if (parentNode == null || IsDataTemplate(node, parentNode) || IsStyle(node, parentNode)) {
|
||||
if (parentNode == null || IsDataTemplate(node, parentNode) || IsStyle(node, parentNode) || IsVisualStateGroupList(node)) {
|
||||
namescopeVarDef = CreateNamescope();
|
||||
namesInNamescope = new List<string>();
|
||||
} else {
|
||||
|
@ -81,6 +82,11 @@ namespace Xamarin.Forms.Build.Tasks
|
|||
return pnode != null && pnode.XmlType.Name == "Style";
|
||||
}
|
||||
|
||||
static bool IsVisualStateGroupList(ElementNode node)
|
||||
{
|
||||
return node != null && node.XmlType.Name == "VisualStateGroup" && node.Parent is IListNode;
|
||||
}
|
||||
|
||||
static bool IsXNameProperty(ValueNode node, INode parentNode)
|
||||
{
|
||||
var parentElement = parentNode as IElementNode;
|
||||
|
|
|
@ -64,6 +64,8 @@ namespace Xamarin.Forms.Build.Tasks
|
|||
return;
|
||||
}
|
||||
|
||||
if (TrySetRuntimeName(propertyName, Context.Variables[(IElementNode)parentNode], node))
|
||||
return;
|
||||
if (skips.Contains(propertyName))
|
||||
return;
|
||||
if (parentNode is IElementNode && ((IElementNode)parentNode).SkipProperties.Contains (propertyName))
|
||||
|
@ -1354,6 +1356,26 @@ namespace Xamarin.Forms.Build.Tasks
|
|||
|
||||
loadTemplate.Body.Optimize();
|
||||
}
|
||||
|
||||
bool TrySetRuntimeName(XmlName propertyName, VariableDefinition variableDefinition, ValueNode node)
|
||||
{
|
||||
if (propertyName != XmlName.xName)
|
||||
return false;
|
||||
|
||||
var attributes = variableDefinition.VariableType.Resolve()
|
||||
.CustomAttributes.Where(attribute => attribute.AttributeType.FullName == "Xamarin.Forms.Xaml.RuntimeNamePropertyAttribute").ToList();
|
||||
|
||||
if (!attributes.Any())
|
||||
return false;
|
||||
|
||||
var runTimeName = attributes[0].ConstructorArguments[0].Value as string;
|
||||
|
||||
if (string.IsNullOrEmpty(runTimeName))
|
||||
return false;
|
||||
|
||||
Context.IL.Append(SetPropertyValue(variableDefinition, new XmlName("", runTimeName), node, Context, node));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class VariableDefinitionReference
|
||||
|
|
|
@ -250,7 +250,7 @@ namespace Xamarin.Forms.Build.Tasks
|
|||
XmlNodeList names =
|
||||
root.SelectNodes(
|
||||
"//*[@" + xPrefix + ":Name" +
|
||||
"][not(ancestor:: __f__:DataTemplate) and not(ancestor:: __f__:ControlTemplate) and not(ancestor:: __f__:Style)]", nsmgr);
|
||||
"][not(ancestor:: __f__:DataTemplate) and not(ancestor:: __f__:ControlTemplate) and not(ancestor:: __f__:Style) and not(ancestor:: __f__:VisualStateManager.VisualStateGroups)]", nsmgr);
|
||||
foreach (XmlNode node in names) {
|
||||
// Don't take the root canvas
|
||||
if (node == root)
|
||||
|
|
|
@ -6,19 +6,19 @@ using Xamarin.Forms.Internals;
|
|||
namespace Xamarin.Forms.Controls
|
||||
{
|
||||
[Preserve (AllMembers=true)]
|
||||
[Issue (IssueTracker.None, 0, "Default colors toggle test", PlatformAffected.All)]
|
||||
[Issue (IssueTracker.None, 9906753, "Default colors toggle test", PlatformAffected.All)]
|
||||
public class DefaultColorToggleTest : TabbedPage
|
||||
{
|
||||
public DefaultColorToggleTest()
|
||||
{
|
||||
Title = "Test Color Toggle Page";
|
||||
|
||||
Children.Add(EntryPage());
|
||||
Children.Add(PickerPage());
|
||||
Children.Add(DatePickerPage());
|
||||
Children.Add(TimePickerPage());
|
||||
Children.Add(ButtonPage());
|
||||
Children.Add(LabelPage());
|
||||
Children.Add(EntryPage());
|
||||
Children.Add(PasswordPage());
|
||||
Children.Add(SearchBarPage());
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ using Xamarin.Forms.CustomAttributes;
|
|||
using Xamarin.Forms.Internals;
|
||||
using Xamarin.Forms.PlatformConfiguration;
|
||||
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
|
||||
using Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries;
|
||||
|
||||
namespace Xamarin.Forms.Controls
|
||||
{
|
||||
|
@ -244,6 +245,7 @@ namespace Xamarin.Forms.Controls
|
|||
}
|
||||
|
||||
List<GalleryPageFactory> _pages = new List<GalleryPageFactory> {
|
||||
new GalleryPageFactory(() => new VisualStateManagerGallery(), "VisualStateManager Gallery"),
|
||||
new GalleryPageFactory(() => new FlowDirectionGalleryLandingPage(), "FlowDirection"),
|
||||
new GalleryPageFactory(() => new AutomationPropertiesGallery(), "Accessibility"),
|
||||
new GalleryPageFactory(() => new PlatformSpecificsGallery(), "Platform Specifics"),
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
<?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:windowsSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.WindowsSpecific;assembly=Xamarin.Forms.Core"
|
||||
xmlns:androidSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
|
||||
xmlns:iosSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
|
||||
x:Class="Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries.ButtonDisabledStatesGallery"
|
||||
Title="Button Disabled States Gallery">
|
||||
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
<Style TargetType="Button" x:Key="CustomDisabledState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<!-- Because we're creating our own PointerOver state here, the Forms VSM will override
|
||||
the Windows VSM for UWP. So this button won't display the native PointerOver behavior.
|
||||
If we remove this next line, the usual PointerOver behavior will be restored. -->
|
||||
<VisualState x:Name="PointerOver" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Red" />
|
||||
<Setter Property="BackgroundColor" Value="Purple" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Button" x:Key="DefaultInInitialState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Green" />
|
||||
<Setter Property="BackgroundColor" Value="Black" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
|
||||
|
||||
<ContentPage.Content>
|
||||
<ScrollView VerticalOptions="Fill" HorizontalOptions="Fill">
|
||||
<StackLayout>
|
||||
|
||||
<!-- Not using the VSM at all; should exhibit pre-VSM default behavior -->
|
||||
<Label Text="The Button below uses the current XF defaults; when IsEnabled is false, it uses the default native colors for the control. (Legacy Color Behavior)"/>
|
||||
<Button Text="Button" x:Name="Button0" TextColor="Blue" BackgroundColor="Bisque" />
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button0_Toggle" Clicked="Button0_Toggle_OnClicked" />
|
||||
|
||||
<!-- Legacy Color Behavior turned off by the PlatformSpecific; ignores states entirely and uses
|
||||
whatever colors are manually set for it -->
|
||||
<Label Text="The Button below has the Legacy Color Behavior disabled; it will stick with whatever colors are set, regardless of state"/>
|
||||
<Button Text="Button" x:Name="Button1" TextColor="Blue" BackgroundColor="Bisque"
|
||||
androidSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
iosSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
windowsSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
/>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button1_Toggle" Clicked="Button1_Toggle_OnClicked" />
|
||||
|
||||
<!-- Disabled colors fully managed by the VSM -->
|
||||
<Label Text="The Button below uses the VSM to customize the colors for the disabled state." />
|
||||
<Button Text="Button" x:Name="Button2" Style="{StaticResource CustomDisabledState}" TextColor="Green"
|
||||
BackgroundColor="Beige" />
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button2_Toggle" Clicked="Button2_Toggle_OnClicked" />
|
||||
|
||||
<!-- This section verifies that the default colors for an entry's text and placeholder are cached and can be reverted to -->
|
||||
<Label Text="This Button uses Color.Default for the intial text/background, and colors from the VSM when disabled."/>
|
||||
<Button Text="Button" x:Name="Button3" Style="{StaticResource DefaultInInitialState}" TextColor="Default"
|
||||
BackgroundColor="Default" />
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button3_Toggle" Clicked="Button3_Toggle_OnClicked" />
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class ButtonDisabledStatesGallery : ContentPage
|
||||
{
|
||||
public ButtonDisabledStatesGallery ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
}
|
||||
|
||||
void Button0_Toggle_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Button0, button);
|
||||
}
|
||||
|
||||
void Button1_Toggle_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Button1, button);
|
||||
}
|
||||
|
||||
void Button2_Toggle_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Button2, button);
|
||||
}
|
||||
|
||||
void Button3_Toggle_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Button3, button);
|
||||
}
|
||||
|
||||
void ToggleIsEnabled(Button button, Button toggleButton)
|
||||
{
|
||||
button.IsEnabled = !button.IsEnabled;
|
||||
|
||||
if (toggleButton != null)
|
||||
{
|
||||
toggleButton.Text = $"Toggle IsEnabled (Currently {button.IsEnabled})";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
using System;
|
||||
|
||||
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
|
||||
{
|
||||
public class CodeOnlyExample : ContentPage
|
||||
{
|
||||
public CodeOnlyExample()
|
||||
{
|
||||
var layout = new StackLayout();
|
||||
|
||||
var calendar = new DatePicker();
|
||||
|
||||
VisualStateManager.SetVisualStateGroups(calendar, new VisualStateGroupList { SetUpMonths() });
|
||||
|
||||
calendar.DateSelected += CalendarOnDateSelected;
|
||||
calendar.Date = new DateTime(2017, 12, 25);
|
||||
|
||||
layout.Children.Add(calendar);
|
||||
|
||||
var context = new Label { Text = "The DatePicker above changes its colors based on the selected date's month. The colors are all VisualStates created and added in code." };
|
||||
layout.Children.Add(context);
|
||||
|
||||
Content = layout;
|
||||
}
|
||||
|
||||
static void CalendarOnDateSelected(object o, DateChangedEventArgs dateChangedEventArgs)
|
||||
{
|
||||
if (o is DatePicker dp)
|
||||
{
|
||||
VisualStateManager.GoToState(dp, dateChangedEventArgs.NewDate.Month.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
VisualStateGroup SetUpMonths()
|
||||
{
|
||||
var stateGroup = new VisualStateGroup { Name = "Months", TargetType = typeof(DatePicker) };
|
||||
|
||||
stateGroup.States.Add(CreateState(1, Color.CornflowerBlue, Color.AliceBlue));
|
||||
stateGroup.States.Add(CreateState(2, Color.Red, Color.WhiteSmoke));
|
||||
stateGroup.States.Add(CreateState(3, Color.GreenYellow, Color.ForestGreen));
|
||||
stateGroup.States.Add(CreateState(4, Color.GreenYellow, Color.SaddleBrown));
|
||||
stateGroup.States.Add(CreateState(5, Color.White, Color.Red));
|
||||
stateGroup.States.Add(CreateState(6, Color.RoyalBlue, Color.DarkOrange));
|
||||
stateGroup.States.Add(CreateState(7, Color.Red, Color.DeepSkyBlue));
|
||||
stateGroup.States.Add(CreateState(8, Color.DarkRed, Color.AliceBlue));
|
||||
stateGroup.States.Add(CreateState(9, Color.SaddleBrown, Color.AntiqueWhite));
|
||||
stateGroup.States.Add(CreateState(10, Color.Orange, Color.Black));
|
||||
stateGroup.States.Add(CreateState(11, Color.OrangeRed, Color.SaddleBrown));
|
||||
stateGroup.States.Add(CreateState(12, Color.Green, Color.Red));
|
||||
|
||||
return stateGroup;
|
||||
}
|
||||
|
||||
static VisualState CreateState(int month, Color textColor, Color backgroundColor)
|
||||
{
|
||||
var textColorSetter = new Setter { Value = textColor, Property = DatePicker.TextColorProperty };
|
||||
var backColorSetter = new Setter { Value = backgroundColor, Property = BackgroundColorProperty };
|
||||
|
||||
return new VisualState
|
||||
{
|
||||
Name = month.ToString(),
|
||||
TargetType = typeof(DatePicker),
|
||||
Setters = { textColorSetter, backColorSetter }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
<?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:windowsSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.WindowsSpecific;assembly=Xamarin.Forms.Core"
|
||||
xmlns:androidSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
|
||||
xmlns:iosSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
|
||||
x:Class="Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries.DatePickerDisabledStatesGallery"
|
||||
Title="DatePicker Disabled States Gallery">
|
||||
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
<Style TargetType="DatePicker" x:Key="CustomDisabledState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Red" />
|
||||
<Setter Property="BackgroundColor" Value="Purple" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="DatePicker" x:Key="DefaultInInitialState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Green" />
|
||||
<Setter Property="BackgroundColor" Value="Black" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<ContentPage.Content>
|
||||
<ScrollView VerticalOptions="Fill" HorizontalOptions="Fill">
|
||||
<StackLayout>
|
||||
|
||||
<!-- Not using the VSM at all; should exhibit pre-VSM default behavior -->
|
||||
<Label Text="The DatePicker below uses the current XF defaults; when IsEnabled is false, it uses the default native colors for the control. (Legacy Color Behavior)"/>
|
||||
<DatePicker x:Name="Picker0" TextColor="Blue" BackgroundColor="Bisque" >
|
||||
</DatePicker>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button0" Clicked="Button0_OnClicked" />
|
||||
|
||||
<!-- Legacy Color Behavior turned off by the PlatformSpecific; ignores states entirely and uses
|
||||
whatever colors are manually set for it -->
|
||||
<Label Text="The DatePicker below has the Legacy Color Behavior disabled; it will stick with whatever colors are set, regardless of state"/>
|
||||
<DatePicker x:Name="Picker1" TextColor="Blue" BackgroundColor="Bisque"
|
||||
androidSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
windowsSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
iosSpecific:VisualElement.IsLegacyColorModeEnabled="False">
|
||||
</DatePicker>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button1" Clicked="Button1_OnClicked" />
|
||||
|
||||
<!-- Disabled colors fully managed by the VSM -->
|
||||
<Label Text="The DatePicker below uses the VSM to customize the colors for the disabled state." />
|
||||
<DatePicker x:Name="Picker2" Style="{StaticResource CustomDisabledState}" TextColor="Green"
|
||||
BackgroundColor="Beige">
|
||||
</DatePicker>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button2" Clicked="Button2_OnClicked" />
|
||||
|
||||
<!-- This section verifies that the default colors for a DatePicker's text is cached and can be reverted to -->
|
||||
<Label Text="This DatePicker uses Color.Default for the intial text/background, and colors from the VSM when disabled."/>
|
||||
<DatePicker x:Name="Picker3" Style="{StaticResource DefaultInInitialState}" TextColor="Default"
|
||||
BackgroundColor="Default">
|
||||
</DatePicker>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button3" Clicked="Button3_OnClicked" />
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class DatePickerDisabledStatesGallery : ContentPage
|
||||
{
|
||||
public DatePickerDisabledStatesGallery ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
|
||||
Button0.Text = $"Toggle IsEnabled (Currently {Picker0.IsEnabled})";
|
||||
Button1.Text = $"Toggle IsEnabled (Currently {Picker1.IsEnabled})";
|
||||
Button2.Text = $"Toggle IsEnabled (Currently {Picker2.IsEnabled})";
|
||||
Button3.Text = $"Toggle IsEnabled (Currently {Picker3.IsEnabled})";
|
||||
}
|
||||
|
||||
void Button0_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Picker0, button);
|
||||
}
|
||||
|
||||
void Button1_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Picker1, button);
|
||||
}
|
||||
|
||||
void Button2_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Picker2, button);
|
||||
}
|
||||
|
||||
void Button3_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Picker3, button);
|
||||
}
|
||||
|
||||
void ToggleIsEnabled(DatePicker picker, Button toggleButton)
|
||||
{
|
||||
picker.IsEnabled = !picker.IsEnabled;
|
||||
|
||||
if (toggleButton != null)
|
||||
{
|
||||
toggleButton.Text = $"Toggle IsEnabled (Currently {picker.IsEnabled})";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
|
||||
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
|
||||
{
|
||||
public class DisabledStatesGallery : ContentPage
|
||||
{
|
||||
static Button GalleryNav(string control, Func<ContentPage> gallery, INavigation nav)
|
||||
{
|
||||
var button = new Button { Text = $"{control} Disabled States" };
|
||||
button.Clicked += (sender, args) => { nav.PushAsync(gallery()); };
|
||||
return button;
|
||||
}
|
||||
|
||||
public DisabledStatesGallery()
|
||||
{
|
||||
var desc = "Some of the XF controls have legacy (pre-VSM) behaviors such that when IsEnabled is set to `false`, they "
|
||||
+ "will override the colors set by the user with the default native colors for the 'disabled' "
|
||||
+ "state. For backward compatibility, this remains the default behavior for those controls. "
|
||||
+ "\n\nUsing the VSM with these controls overrides that behavior; it is also possible to override "
|
||||
+ "that behavior with the `IsLegacyColorModeEnabled` platform specific, which returns the "
|
||||
+ "controls to their old (pre-2.0) behavior (i.e., colors set on the control remain even when "
|
||||
+ "the control is 'disabled'). \n\nThe galleries below demonstrate each behavior.";
|
||||
|
||||
var descriptionLabel = new Label { Text = desc, Margin = new Thickness(2,2,2,2)};
|
||||
|
||||
Title = "Disabled states galleries";
|
||||
|
||||
Content = new ScrollView
|
||||
{
|
||||
Content = new StackLayout
|
||||
{
|
||||
Children =
|
||||
{
|
||||
descriptionLabel,
|
||||
GalleryNav("Editor", () => new EditorDisabledStatesGallery(), Navigation),
|
||||
GalleryNav("SearchBar", () => new SearchBarDisabledStatesGallery(), Navigation),
|
||||
GalleryNav("Entry", () => new EntryDisabledStatesGallery(), Navigation),
|
||||
GalleryNav("Button", () => new ButtonDisabledStatesGallery(), Navigation),
|
||||
GalleryNav("Picker", () => new PickerDisabledStatesGallery(), Navigation),
|
||||
GalleryNav("TimePicker", () => new TimePickerDisabledStatesGallery(), Navigation),
|
||||
GalleryNav("DatePicker", () => new DatePickerDisabledStatesGallery(), Navigation)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
<?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:windowsSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.WindowsSpecific;assembly=Xamarin.Forms.Core"
|
||||
xmlns:androidSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
|
||||
xmlns:iosSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
|
||||
x:Class="Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries.EditorDisabledStatesGallery"
|
||||
Title="Editor Disabled States Gallery">
|
||||
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
<Style TargetType="Editor" x:Key="CustomDisabledState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Red" />
|
||||
<Setter Property="BackgroundColor" Value="Purple" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Editor" x:Key="DefaultInInitialState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Green" />
|
||||
<Setter Property="BackgroundColor" Value="Black" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<ContentPage.Content>
|
||||
<ScrollView VerticalOptions="Fill" HorizontalOptions="Fill">
|
||||
<StackLayout>
|
||||
|
||||
<!-- Not using the VSM at all; should exhibit pre-VSM default behavior -->
|
||||
<Label Text="The Editor below uses the current XF defaults; when IsEnabled is false, it uses the default native colors for the control. (Legacy Color Behavior)"/>
|
||||
<Editor x:Name="Editor0" TextColor="Blue" BackgroundColor="Bisque" Text="Kwyjibo">
|
||||
</Editor>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button0" Clicked="Button0_OnClicked" />
|
||||
|
||||
<!-- Legacy Color Behavior turned off by the PlatformSpecific; ignores states entirely and uses
|
||||
whatever colors are manually set for it -->
|
||||
<Label Text="The Editor below has the Legacy Color Behavior disabled; it will stick with whatever colors are set, regardless of state"/>
|
||||
<Editor x:Name="Editor1" TextColor="Blue" BackgroundColor="GreenYellow" Text="Kwyjibo"
|
||||
windowsSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
androidSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
iosSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
/>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button1" Clicked="Button1_OnClicked" />
|
||||
|
||||
<!-- Disabled colors fully managed by the VSM -->
|
||||
<Label Text="The Editor below uses the VSM to customize the colors for the disabled state." />
|
||||
<Editor x:Name="Editor2" Style="{StaticResource CustomDisabledState}" TextColor="Green"
|
||||
BackgroundColor="Beige" Text="Kwyjibo" />
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button2" Clicked="Button2_OnClicked" />
|
||||
|
||||
<!-- This section verifies that the default colors for a searchbar's text and placeholder are cached and can be reverted to -->
|
||||
<Label Text="This Editor uses Color.Default for the intial text/background, and colors from the VSM when disabled."/>
|
||||
<Editor x:Name="Editor3" Style="{StaticResource DefaultInInitialState}" TextColor="Default"
|
||||
BackgroundColor="Default" Text="Kwyjibo" />
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button3" Clicked="Button3_OnClicked" />
|
||||
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class EditorDisabledStatesGallery : ContentPage
|
||||
{
|
||||
public EditorDisabledStatesGallery()
|
||||
{
|
||||
InitializeComponent ();
|
||||
|
||||
Button0.Text = $"Toggle IsEnabled (Currently {Editor0.IsEnabled})";
|
||||
Button1.Text = $"Toggle IsEnabled (Currently {Editor1.IsEnabled})";
|
||||
Button2.Text = $"Toggle IsEnabled (Currently {Editor2.IsEnabled})";
|
||||
Button3.Text = $"Toggle IsEnabled (Currently {Editor3.IsEnabled})";
|
||||
}
|
||||
|
||||
void Button0_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Editor0, button);
|
||||
}
|
||||
|
||||
void Button1_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Editor1, button);
|
||||
}
|
||||
|
||||
void Button2_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Editor2, button);
|
||||
}
|
||||
|
||||
void Button3_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Editor3, button);
|
||||
}
|
||||
|
||||
|
||||
void ToggleIsEnabled(Editor editor, Button toggleButton)
|
||||
{
|
||||
editor.IsEnabled = !editor.IsEnabled;
|
||||
|
||||
if (toggleButton != null)
|
||||
{
|
||||
toggleButton.Text = $"Toggle IsEnabled (Currently {editor.IsEnabled})";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
<?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:windowsSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.WindowsSpecific;assembly=Xamarin.Forms.Core"
|
||||
xmlns:androidSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
|
||||
xmlns:iosSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
|
||||
x:Class="Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries.EntryDisabledStatesGallery"
|
||||
Title="Entry Disabled States Gallery">
|
||||
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
<Style TargetType="Entry" x:Key="CustomDisabledState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Red" />
|
||||
<Setter Property="PlaceholderColor" Value="LightCoral" />
|
||||
<Setter Property="BackgroundColor" Value="Purple" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Entry" x:Key="DefaultInInitialState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Green" />
|
||||
<Setter Property="PlaceholderColor" Value="LightGreen" />
|
||||
<Setter Property="BackgroundColor" Value="Black" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<ScrollView VerticalOptions="Fill" HorizontalOptions="Fill">
|
||||
<StackLayout>
|
||||
|
||||
<!-- Not using the VSM at all; should exhibit pre-VSM default behavior -->
|
||||
<Label Text="The Entry below uses the current XF defaults; when IsEnabled is false, it uses the default native colors for the control. (Legacy Color Behavior)"/>
|
||||
<Entry x:Name="Entry0" TextColor="Blue" PlaceholderColor="Green" Placeholder="placeholder"
|
||||
BackgroundColor="Bisque" />
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button0" Clicked="Button0_OnClicked" />
|
||||
|
||||
<!-- Legacy Color Behavior turned off by the PlatformSpecific; ignores states entirely and uses
|
||||
whatever colors are manually set for it -->
|
||||
<Label Text="The Entry below has the Legacy Color Behavior disabled; it will stick with whatever colors are set, regardless of state"/>
|
||||
<Entry x:Name="Entry5" TextColor="Blue" PlaceholderColor="Green" Placeholder="placeholder"
|
||||
BackgroundColor="Bisque"
|
||||
windowsSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
androidSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
iosSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
/>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button5" Clicked="Button5_OnClicked" />
|
||||
|
||||
<!-- Disabled colors fully managed by the VSM -->
|
||||
<Label Text="The Entry below uses the VSM to customize the colors for the disabled state." />
|
||||
<Entry x:Name="Entry2" Style="{StaticResource CustomDisabledState}" TextColor="Green"
|
||||
PlaceholderColor="LightGreen" Placeholder="placeholder" BackgroundColor="Beige" />
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button2" Clicked="Button2_OnClicked" />
|
||||
|
||||
<!-- This section verifies that the default colors for an entry's text and placeholder are cached and can be reverted to -->
|
||||
<Label Text="This Entry uses Color.Default for the intial text/background, and colors from the VSM when disabled."/>
|
||||
<Entry x:Name="Entry3" Style="{StaticResource DefaultInInitialState}" TextColor="Default"
|
||||
PlaceholderColor="Default" Placeholder="placeholder" BackgroundColor="Default" />
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button3" Clicked="Button3_OnClicked" />
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage>
|
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class EntryDisabledStatesGallery : ContentPage
|
||||
{
|
||||
public EntryDisabledStatesGallery()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Button0.Text = $"Toggle IsEnabled (Currently {Entry0.IsEnabled})";
|
||||
Button2.Text = $"Toggle IsEnabled (Currently {Entry2.IsEnabled})";
|
||||
Button3.Text = $"Toggle IsEnabled (Currently {Entry3.IsEnabled})";
|
||||
Button5.Text = $"Toggle IsEnabled (Currently {Entry5.IsEnabled})";
|
||||
}
|
||||
|
||||
void Button0_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Entry0, button);
|
||||
}
|
||||
|
||||
void Button2_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Entry2, button);
|
||||
}
|
||||
|
||||
void Button3_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Entry3, button);
|
||||
}
|
||||
|
||||
void Button5_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Entry5, button);
|
||||
}
|
||||
|
||||
void ToggleIsEnabled(Entry entry, Button button)
|
||||
{
|
||||
entry.IsEnabled = !entry.IsEnabled;
|
||||
|
||||
if (button != null)
|
||||
{
|
||||
button.Text = $"Toggle IsEnabled (Currently {entry.IsEnabled})";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries.OnIdiomExample"
|
||||
Title="Using OnIdiom in the VisualStateManager">
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
<Style TargetType="Label" x:Key="OnIdiomExample">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="FontSize">
|
||||
<OnIdiom x:TypeArguments="x:Double">
|
||||
<OnIdiom.Phone>12</OnIdiom.Phone>
|
||||
<OnIdiom.Tablet>24</OnIdiom.Tablet>
|
||||
<OnIdiom.Desktop>36</OnIdiom.Desktop>
|
||||
<OnIdiom.TV>30</OnIdiom.TV>
|
||||
</OnIdiom>
|
||||
</Setter>
|
||||
<Setter Property="Text" Value="Normal State"></Setter>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="CustomState">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="FontSize">
|
||||
<OnIdiom x:TypeArguments="x:Double">
|
||||
<OnIdiom.Phone>24</OnIdiom.Phone>
|
||||
<OnIdiom.Tablet>48</OnIdiom.Tablet>
|
||||
<OnIdiom.Desktop>72</OnIdiom.Desktop>
|
||||
<OnIdiom.TV>60</OnIdiom.TV>
|
||||
</OnIdiom>
|
||||
</Setter>
|
||||
<Setter Property="Text" Value="Custom State"></Setter>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<ContentPage.Content>
|
||||
<StackLayout>
|
||||
<Label Text="Initial State" x:Name="DemoLabel" Style="{StaticResource OnIdiomExample}"/>
|
||||
|
||||
<Button Text="Change Label to Custom State" x:Name="ToggleButton" Clicked="Button_OnClicked"></Button>
|
||||
|
||||
<Label Text="The FontSize of the label above is set in the VSM using OnIdiom"></Label>
|
||||
<Label Text="On Tablets it will switch between 24 and 48"></Label>
|
||||
<Label Text="On Phones it will switch between 12 and 24"></Label>
|
||||
<Label Text="On Destktops it will switch between 36 and 72"></Label>
|
||||
<Label Text="On TVs it will switch between 30 and 60"></Label>
|
||||
</StackLayout>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class OnIdiomExample : ContentPage
|
||||
{
|
||||
const string DefaultState = "Normal";
|
||||
string _currentState = DefaultState;
|
||||
|
||||
public OnIdiomExample ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
}
|
||||
|
||||
void Button_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
if (_currentState == DefaultState)
|
||||
{
|
||||
_currentState = "CustomState";
|
||||
VisualStateManager.GoToState(DemoLabel, _currentState);
|
||||
ToggleButton.Text = "Change Label to Normal state";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_currentState = DefaultState;
|
||||
VisualStateManager.GoToState(DemoLabel, _currentState);
|
||||
ToggleButton.Text = "Change Label to Custom state";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries.OnPlatformExample"
|
||||
Title="Using OnPlatform in the VisualStateManager">
|
||||
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
<Style TargetType="Label" x:Key="OnPlatformExample">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor">
|
||||
<OnPlatform x:TypeArguments="Color">
|
||||
<On Platform="UWP" Value="Purple"></On>
|
||||
<On Platform="Android" Value="Blue"></On>
|
||||
<On Platform="iOS" Value="Red"></On>
|
||||
</OnPlatform>
|
||||
</Setter>
|
||||
<Setter Property="Text" Value="Normal State"></Setter>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="CustomState">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor">
|
||||
<OnPlatform x:TypeArguments="Color">
|
||||
<On Platform="UWP" Value="Green"></On>
|
||||
<On Platform="Android" Value="Yellow"></On>
|
||||
<On Platform="iOS" Value="Orange"></On>
|
||||
</OnPlatform>
|
||||
</Setter>
|
||||
<Setter Property="Text" Value="Custom State"></Setter>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<ContentPage.Content>
|
||||
<StackLayout>
|
||||
<Label Text="Initial State" x:Name="DemoLabel" Style="{StaticResource OnPlatformExample}"/>
|
||||
|
||||
<Button Text="Change Label to Custom State" x:Name="ToggleButton" Clicked="Button_OnClicked"></Button>
|
||||
|
||||
<Label Text="The color of the label above is set in the VSM using OnPlatform"></Label>
|
||||
<Label Text="On Windows it will switch between Purple and Green"></Label>
|
||||
<Label Text="On Android it will switch between Blue and Yellow"></Label>
|
||||
<Label Text="On iOS it will switch between Red and Orange"></Label>
|
||||
</StackLayout>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class OnPlatformExample : ContentPage
|
||||
{
|
||||
const string DefaultState = "Normal";
|
||||
string _currentState = DefaultState;
|
||||
|
||||
public OnPlatformExample()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
void Button_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
if (_currentState == DefaultState)
|
||||
{
|
||||
_currentState = "CustomState";
|
||||
VisualStateManager.GoToState(DemoLabel, _currentState);
|
||||
ToggleButton.Text = "Change Label to Normal state";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_currentState = DefaultState;
|
||||
VisualStateManager.GoToState(DemoLabel, _currentState);
|
||||
ToggleButton.Text = "Change Label to Custom state";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,104 @@
|
|||
<?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:windowsSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.WindowsSpecific;assembly=Xamarin.Forms.Core"
|
||||
xmlns:androidSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
|
||||
xmlns:iosSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
|
||||
x:Class="Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries.PickerDisabledStatesGallery"
|
||||
Title="Picker Disabled States Gallery">
|
||||
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
<Style TargetType="Picker" x:Key="CustomDisabledState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Red" />
|
||||
<Setter Property="BackgroundColor" Value="Purple" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Picker" x:Key="DefaultInInitialState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Green" />
|
||||
<Setter Property="BackgroundColor" Value="Black" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<ContentPage.Content>
|
||||
<ScrollView VerticalOptions="Fill" HorizontalOptions="Fill">
|
||||
<StackLayout>
|
||||
|
||||
<!-- Not using the VSM at all; should exhibit pre-VSM default behavior -->
|
||||
<Label Text="The Picker below uses the current XF defaults; when IsEnabled is false, it uses the default native colors for the control. (Legacy Color Behavior)"/>
|
||||
<Picker x:Name="Picker0" TextColor="Blue" BackgroundColor="Bisque" >
|
||||
<Picker.Items>
|
||||
<x:String>First</x:String>
|
||||
<x:String>Second</x:String>
|
||||
<!--<Picker.SelectedIndex>0</Picker.SelectedIndex>-->
|
||||
</Picker.Items>
|
||||
</Picker>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button0" Clicked="Button0_OnClicked" />
|
||||
|
||||
<!-- Legacy Color Behavior turned off by the PlatformSpecific; ignores states entirely and uses
|
||||
whatever colors are manually set for it -->
|
||||
<Label Text="The Picker below has the Legacy Color Behavior disabled; it will stick with whatever colors are set, regardless of state"/>
|
||||
<Picker x:Name="Picker1" TextColor="Blue" BackgroundColor="Bisque"
|
||||
windowsSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
androidSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
iosSpecific:VisualElement.IsLegacyColorModeEnabled="False">
|
||||
<Picker.Items>
|
||||
<x:String>First</x:String>
|
||||
<x:String>Second</x:String>
|
||||
</Picker.Items>
|
||||
<!--<Picker.SelectedIndex>0</Picker.SelectedIndex>-->
|
||||
</Picker>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button1" Clicked="Button1_OnClicked" />
|
||||
|
||||
<!-- Disabled colors fully managed by the VSM -->
|
||||
<Label Text="The Picker below uses the VSM to customize the colors for the disabled state." />
|
||||
<Picker x:Name="Picker2" Style="{StaticResource CustomDisabledState}" TextColor="Green"
|
||||
BackgroundColor="Beige">
|
||||
<Picker.Items>
|
||||
<x:String>First</x:String>
|
||||
<x:String>Second</x:String>
|
||||
<!--<Picker.SelectedIndex>0</Picker.SelectedIndex>-->
|
||||
</Picker.Items>
|
||||
</Picker>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button2" Clicked="Button2_OnClicked" />
|
||||
|
||||
<!-- This section verifies that the default for a Picker's text is cached and can be reverted to -->
|
||||
<Label Text="This Picker uses Color.Default for the intial text/background, and colors from the VSM when disabled."/>
|
||||
<Picker x:Name="Picker3" Style="{StaticResource DefaultInInitialState}" TextColor="Default"
|
||||
BackgroundColor="Default">
|
||||
<Picker.Items>
|
||||
<x:String>First</x:String>
|
||||
<x:String>Second</x:String>
|
||||
<!--<Picker.SelectedIndex>0</Picker.SelectedIndex>-->
|
||||
</Picker.Items>
|
||||
</Picker>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button3" Clicked="Button3_OnClicked" />
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class PickerDisabledStatesGallery : ContentPage
|
||||
{
|
||||
public PickerDisabledStatesGallery ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
|
||||
Button0.Text = $"Toggle IsEnabled (Currently {Picker0.IsEnabled})";
|
||||
Button1.Text = $"Toggle IsEnabled (Currently {Picker1.IsEnabled})";
|
||||
Button2.Text = $"Toggle IsEnabled (Currently {Picker2.IsEnabled})";
|
||||
Button3.Text = $"Toggle IsEnabled (Currently {Picker3.IsEnabled})";
|
||||
}
|
||||
|
||||
void Button0_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Picker0, button);
|
||||
}
|
||||
|
||||
void Button1_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Picker1, button);
|
||||
}
|
||||
|
||||
void Button2_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Picker2, button);
|
||||
}
|
||||
|
||||
void Button3_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Picker3, button);
|
||||
}
|
||||
|
||||
void ToggleIsEnabled(Picker picker, Button toggleButton)
|
||||
{
|
||||
picker.IsEnabled = !picker.IsEnabled;
|
||||
|
||||
if (toggleButton != null)
|
||||
{
|
||||
toggleButton.Text = $"Toggle IsEnabled (Currently {picker.IsEnabled})";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
<?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:windowsSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.WindowsSpecific;assembly=Xamarin.Forms.Core"
|
||||
xmlns:androidSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
|
||||
xmlns:iosSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
|
||||
x:Class="Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries.SearchBarDisabledStatesGallery"
|
||||
Title="SearchBar Disabled States Gallery">
|
||||
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
<Style TargetType="SearchBar" x:Key="CustomDisabledState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Red" />
|
||||
<Setter Property="PlaceholderColor" Value="LightCoral" />
|
||||
<Setter Property="BackgroundColor" Value="Purple" />
|
||||
<Setter Property="CancelButtonColor" Value="OrangeRed" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="SearchBar" x:Key="DefaultInInitialState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Green" />
|
||||
<Setter Property="PlaceholderColor" Value="LightGreen" />
|
||||
<Setter Property="BackgroundColor" Value="Black" />
|
||||
<Setter Property="CancelButtonColor" Value="DarkSeaGreen"></Setter>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<ContentPage.Content>
|
||||
<ScrollView VerticalOptions="Fill" HorizontalOptions="Fill">
|
||||
<StackLayout>
|
||||
|
||||
<!-- Not using the VSM at all; should exhibit pre-VSM default behavior -->
|
||||
<Label Text="The SearchBar below uses the current XF defaults; when IsEnabled is false, it uses the default native colors for the control. (Legacy Color Behavior)"/>
|
||||
<SearchBar x:Name="Search0" TextColor="Default" PlaceholderColor="LightBlue" BackgroundColor="Bisque"
|
||||
Placeholder="search" CancelButtonColor="Aqua">
|
||||
</SearchBar>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button0" Clicked="Button0_OnClicked" />
|
||||
|
||||
<!-- Legacy Color Behavior turned off by the PlatformSpecific; ignores states entirely and uses
|
||||
whatever colors are manually set for it -->
|
||||
<Label Text="The SearchBar below has the Legacy Color Behavior disabled; it will stick with whatever colors are set, regardless of state"/>
|
||||
<SearchBar x:Name="Search1" TextColor="Blue" PlaceholderColor="Green" Placeholder="placeholder"
|
||||
BackgroundColor="Bisque" CancelButtonColor="GreenYellow"
|
||||
windowsSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
androidSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
iosSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
/>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button1" Clicked="Button1_OnClicked" />
|
||||
|
||||
<!-- Disabled colors fully managed by the VSM -->
|
||||
<Label Text="The SearchBar below uses the VSM to customize the colors for the disabled state." />
|
||||
<SearchBar x:Name="Search2" Style="{StaticResource CustomDisabledState}" TextColor="Green"
|
||||
PlaceholderColor="LightGreen" Placeholder="placeholder" BackgroundColor="Beige"
|
||||
CancelButtonColor="Aquamarine"/>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button2" Clicked="Button2_OnClicked" />
|
||||
|
||||
<!-- This section verifies that the default colors for a searchbar's text and placeholder are cached and can be reverted to -->
|
||||
<Label Text="This SearchBar uses Color.Default for the intial text/background, and colors from the VSM when disabled."/>
|
||||
<SearchBar x:Name="Search3" Style="{StaticResource DefaultInInitialState}" TextColor="Default"
|
||||
PlaceholderColor="Default" Placeholder="placeholder" BackgroundColor="Default"
|
||||
CancelButtonColor="Default" />
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button3" Clicked="Button3_OnClicked" />
|
||||
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class SearchBarDisabledStatesGallery : ContentPage
|
||||
{
|
||||
public SearchBarDisabledStatesGallery ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
|
||||
Button0.Text = $"Toggle IsEnabled (Currently {Search0.IsEnabled})";
|
||||
Button1.Text = $"Toggle IsEnabled (Currently {Search1.IsEnabled})";
|
||||
Button2.Text = $"Toggle IsEnabled (Currently {Search2.IsEnabled})";
|
||||
Button3.Text = $"Toggle IsEnabled (Currently {Search3.IsEnabled})";
|
||||
}
|
||||
|
||||
void Button0_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Search0, button);
|
||||
}
|
||||
|
||||
void Button1_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Search1, button);
|
||||
}
|
||||
|
||||
void Button2_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Search2, button);
|
||||
}
|
||||
|
||||
void Button3_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Search3, button);
|
||||
}
|
||||
|
||||
|
||||
void ToggleIsEnabled(SearchBar searchBar, Button toggleButton)
|
||||
{
|
||||
searchBar.IsEnabled = !searchBar.IsEnabled;
|
||||
|
||||
if (toggleButton != null)
|
||||
{
|
||||
toggleButton.Text = $"Toggle IsEnabled (Currently {searchBar.IsEnabled})";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
<?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:windowsSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.WindowsSpecific;assembly=Xamarin.Forms.Core"
|
||||
xmlns:androidSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
|
||||
xmlns:iosSpecific="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
|
||||
x:Class="Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries.TimePickerDisabledStatesGallery"
|
||||
Title="TimePicker Disabled States Gallery">
|
||||
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
<Style TargetType="TimePicker" x:Key="CustomDisabledState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Red" />
|
||||
<Setter Property="BackgroundColor" Value="Purple" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="TimePicker" x:Key="DefaultInInitialState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Green" />
|
||||
<Setter Property="BackgroundColor" Value="Black" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<ContentPage.Content>
|
||||
<ScrollView VerticalOptions="Fill" HorizontalOptions="Fill">
|
||||
<StackLayout>
|
||||
|
||||
<!-- Not using the VSM at all; should exhibit pre-VSM default behavior -->
|
||||
<Label Text="The TimePicker below uses the current XF defaults; when IsEnabled is false, it uses the default native colors for the control. (Legacy Color Behavior)"/>
|
||||
<TimePicker x:Name="Picker0" TextColor="Blue" BackgroundColor="Bisque" >
|
||||
</TimePicker>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button0" Clicked="Button0_OnClicked" />
|
||||
|
||||
<!-- Legacy Color Behavior turned off by the PlatformSpecific; ignores states entirely and uses
|
||||
whatever colors are manually set for it -->
|
||||
<Label Text="The TimePicker below has the Legacy Color Behavior disabled; it will stick with whatever colors are set, regardless of state"/>
|
||||
<TimePicker x:Name="Picker1" TextColor="Blue" BackgroundColor="Bisque"
|
||||
androidSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
windowsSpecific:VisualElement.IsLegacyColorModeEnabled="False"
|
||||
iosSpecific:VisualElement.IsLegacyColorModeEnabled="False">
|
||||
</TimePicker>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button1" Clicked="Button1_OnClicked" />
|
||||
|
||||
<!-- Disabled colors fully managed by the VSM -->
|
||||
<Label Text="The TimePicker below uses the VSM to customize the colors for the disabled state." />
|
||||
<TimePicker x:Name="Picker2" Style="{StaticResource CustomDisabledState}" TextColor="Green"
|
||||
BackgroundColor="Beige">
|
||||
</TimePicker>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button2" Clicked="Button2_OnClicked" />
|
||||
|
||||
<!-- This section verifies that the default color for a TimePicker's text is cached and can be reverted to -->
|
||||
<Label Text="This TimePicker uses Color.Default for the intial text/background, and colors from the VSM when disabled."/>
|
||||
<TimePicker x:Name="Picker3" Style="{StaticResource DefaultInInitialState}" TextColor="Default"
|
||||
BackgroundColor="Default">
|
||||
</TimePicker>
|
||||
<Button Text="Toggle IsEnabled" x:Name="Button3" Clicked="Button3_OnClicked" />
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class TimePickerDisabledStatesGallery : ContentPage
|
||||
{
|
||||
public TimePickerDisabledStatesGallery ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
|
||||
Button0.Text = $"Toggle IsEnabled (Currently {Picker0.IsEnabled})";
|
||||
Button1.Text = $"Toggle IsEnabled (Currently {Picker1.IsEnabled})";
|
||||
Button2.Text = $"Toggle IsEnabled (Currently {Picker2.IsEnabled})";
|
||||
Button3.Text = $"Toggle IsEnabled (Currently {Picker3.IsEnabled})";
|
||||
}
|
||||
|
||||
void Button0_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Picker0, button);
|
||||
}
|
||||
|
||||
void Button1_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Picker1, button);
|
||||
}
|
||||
|
||||
void Button2_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Picker2, button);
|
||||
}
|
||||
|
||||
void Button3_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
ToggleIsEnabled(Picker3, button);
|
||||
}
|
||||
|
||||
void ToggleIsEnabled(TimePicker picker, Button toggleButton)
|
||||
{
|
||||
picker.IsEnabled = !picker.IsEnabled;
|
||||
|
||||
if (toggleButton != null)
|
||||
{
|
||||
toggleButton.Text = $"Toggle IsEnabled (Currently {picker.IsEnabled})";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries.ValidationExample">
|
||||
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
<Style TargetType="Label" x:Key="ErrorLabel">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="IsVisible" Value="False"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Invalid">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="IsVisible" Value="True"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
<Setter Property="TextColor" Value="Red"></Setter>
|
||||
<Setter Property="Margin" Value="2,10,2,10"></Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Label" x:Key="FormLabel">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Invalid">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="DarkRed"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
<Setter Property="Margin" Value="2,10,2,10"></Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Entry">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Invalid">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="BackgroundColor" Value="LightCoral"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Editor">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Invalid">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="BackgroundColor" Value="LightCoral"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<ContentPage.Content>
|
||||
<StackLayout>
|
||||
<Label Text="Validation Example Form" FontSize="24" HorizontalOptions="Fill" HorizontalTextAlignment="Center" />
|
||||
|
||||
<Label x:Name="SubjectLabel" Text="Subject (required):" Style="{StaticResource FormLabel}"></Label>
|
||||
<Entry x:Name="Subject"></Entry>
|
||||
<Label x:Name="SubjectError" Style="{StaticResource ErrorLabel}" Text="Invalid subject"></Label>
|
||||
|
||||
<Label x:Name="MessageLabel" Style="{StaticResource FormLabel}" Text="Message (40 characters maximum):" ></Label>
|
||||
<Label x:Name="CharacterCount" Style="{StaticResource FormLabel}"></Label>
|
||||
<Editor x:Name="Message"></Editor>
|
||||
<Label x:Name="MessageError" Style="{StaticResource ErrorLabel}" Text="Invalid message"></Label>
|
||||
|
||||
<Button x:Name="Submit" Text="Submit" Clicked="Submit_OnClicked"></Button>
|
||||
|
||||
<Label Margin="2,20,2,0"
|
||||
Text="The form above uses the VSM to create a custom 'Invalid' state for the various controls.
|
||||
|
||||
When validation runs for the form, it toggles the state of the controls between 'Invalid' and 'Normal',
|
||||
which determines the appearance of the controls. "></Label>
|
||||
|
||||
</StackLayout>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
|
@ -0,0 +1,65 @@
|
|||
using System;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class ValidationExample : ContentPage
|
||||
{
|
||||
public ValidationExample ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
|
||||
Message.TextChanged += EditorTextChanged;
|
||||
}
|
||||
|
||||
void EditorTextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
var count = e.NewTextValue.Length;
|
||||
|
||||
CharacterCount.Text = $"{count} characters";
|
||||
CheckMessageValid();
|
||||
}
|
||||
|
||||
bool IsValid()
|
||||
{
|
||||
var messageValid = CheckMessageValid();
|
||||
var subjectValid = CheckSubjectValid();
|
||||
|
||||
return messageValid && subjectValid;
|
||||
}
|
||||
|
||||
bool CheckMessageValid()
|
||||
{
|
||||
var isValid = Message.Text == null || Message.Text.Length <= 40;
|
||||
var state = isValid ? "Normal" : "Invalid";
|
||||
|
||||
VisualStateManager.GoToState(Message, state);
|
||||
VisualStateManager.GoToState(MessageError, state);
|
||||
VisualStateManager.GoToState(CharacterCount, state);
|
||||
VisualStateManager.GoToState(MessageLabel, state);
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
bool CheckSubjectValid()
|
||||
{
|
||||
var isValid = Subject.Text?.Length > 0;
|
||||
var state = isValid ? "Normal" : "Invalid";
|
||||
|
||||
VisualStateManager.GoToState(Subject, state);
|
||||
VisualStateManager.GoToState(SubjectError, state);
|
||||
VisualStateManager.GoToState(SubjectLabel, state);
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
void Submit_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
if (IsValid())
|
||||
{
|
||||
DisplayAlert("Submitted", "Thank you for submitting", "OK");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
|
||||
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
|
||||
{
|
||||
public class VisualStateManagerGallery : ContentPage
|
||||
{
|
||||
static Button GalleryNav(string galleryName, Func<ContentPage> gallery, INavigation nav)
|
||||
{
|
||||
var button = new Button { Text = $"{galleryName}" };
|
||||
button.Clicked += (sender, args) => { nav.PushAsync(gallery()); };
|
||||
return button;
|
||||
}
|
||||
|
||||
public VisualStateManagerGallery()
|
||||
{
|
||||
Content = new StackLayout
|
||||
{
|
||||
Children =
|
||||
{
|
||||
GalleryNav("Disabled States Gallery", () => new DisabledStatesGallery(), Navigation),
|
||||
GalleryNav("OnPlatform Example", () => new OnPlatformExample(), Navigation),
|
||||
GalleryNav("OnIdiom Example", () => new OnIdiomExample(), Navigation),
|
||||
GalleryNav("Validation Example", () => new ValidationExample(), Navigation),
|
||||
GalleryNav("Code (No XAML) Example", () => new CodeOnlyExample(), Navigation),
|
||||
GalleryNav("VisualStates directly on Elements", () => new VisualStatesDirectlyOnElements(), Navigation)
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries.VisualStatesDirectlyOnElements"
|
||||
Title="VisualStateGroups Directly on VisualElements">
|
||||
<ContentPage.Content>
|
||||
<StackLayout>
|
||||
<Label x:Name="ALabel" Text="This is a label" HorizontalTextAlignment="Start" HorizontalOptions="Start" >
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="ColorStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Invalid">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="DarkRed"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="AlignmentStates">
|
||||
<VisualState x:Name="LeftAligned">
|
||||
</VisualState>
|
||||
<VisualState x:Name="Centered">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="HorizontalTextAlignment" Value="Center"/>
|
||||
<Setter Property="HorizontalOptions" Value="Fill"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Label>
|
||||
|
||||
<Button x:Name="AButton" Text="Button" ContentLayout="Left" HorizontalOptions="Start" Image="coffee.png" TextColor="Blue">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="ColorStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Invalid">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="DarkRed"/>
|
||||
<Setter Property="Image" Value="toolbar_close.png"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="AlignmentStates">
|
||||
<VisualState x:Name="LeftAligned">
|
||||
</VisualState>
|
||||
<VisualState x:Name="Centered">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="HorizontalOptions" Value="Center"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Button>
|
||||
|
||||
|
||||
<Label x:Name="CurrentState"></Label>
|
||||
|
||||
<Button x:Name="ToggleValid" Text="Toggle Validity State" Clicked="ToggleValid_OnClicked"></Button>
|
||||
<Button x:Name="ToggleAlignment" Text="Toggle Alignment State" Clicked="ToggleAlignment_OnClicked"></Button>
|
||||
|
||||
</StackLayout>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
|
@ -0,0 +1,55 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace Xamarin.Forms.Controls.GalleryPages.VisualStateManagerGalleries
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class VisualStatesDirectlyOnElements : ContentPage
|
||||
{
|
||||
string _currentColorState = "Normal";
|
||||
string _currentAlignmentState = "LeftAligned";
|
||||
|
||||
public VisualStatesDirectlyOnElements ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
}
|
||||
|
||||
void ToggleValid_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
if (_currentColorState == "Normal")
|
||||
{
|
||||
_currentColorState = "Invalid";
|
||||
}
|
||||
else
|
||||
{
|
||||
_currentColorState = "Normal";
|
||||
}
|
||||
|
||||
CurrentState.Text = $"{_currentColorState}, {_currentAlignmentState}";
|
||||
VisualStateManager.GoToState(ALabel, _currentColorState);
|
||||
VisualStateManager.GoToState(AButton, _currentColorState);
|
||||
}
|
||||
|
||||
void ToggleAlignment_OnClicked(object sender, EventArgs e)
|
||||
{
|
||||
if (_currentAlignmentState == "LeftAligned")
|
||||
{
|
||||
_currentAlignmentState = "Centered";
|
||||
}
|
||||
else
|
||||
{
|
||||
_currentAlignmentState = "LeftAligned";
|
||||
}
|
||||
|
||||
CurrentState.Text = $"{_currentColorState}, {_currentAlignmentState}";
|
||||
VisualStateManager.GoToState(ALabel, _currentAlignmentState);
|
||||
VisualStateManager.GoToState(AButton, _currentAlignmentState);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,6 +31,27 @@
|
|||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="GalleryPages\crimson.jpg" />
|
||||
<Compile Update="GalleryPages\VisualStateManagerGalleries\OnPlatformExample.xaml.cs">
|
||||
<DependentUpon>OnPlatformExample.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Update="GalleryPages\VisualStateManagerGalleries\ButtonDisabledStatesGallery.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="GalleryPages\VisualStateManagerGalleries\DatePickerDisabledStatesGallery.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="GalleryPages\VisualStateManagerGalleries\PickerDisabledStatesGallery.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="GalleryPages\VisualStateManagerGalleries\SearchBarDisabledStatesGallery.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="GalleryPages\VisualStateManagerGalleries\TimePickerDisabledStatesGallery.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="GalleryPages\VisualStateManagerGalleries\ValidationExample.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="GalleryPages\XamlPage.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
|
|
|
@ -0,0 +1,180 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Xamarin.Forms.Core.UnitTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class VisualStateManagerTests
|
||||
{
|
||||
const string NormalStateName = "Normal";
|
||||
const string InvalidStateName = "Invalid";
|
||||
const string CommonStatesName = "CommonStates";
|
||||
|
||||
static VisualStateGroupList CreateTestStateGroups()
|
||||
{
|
||||
var stateGroups = new VisualStateGroupList();
|
||||
var visualStateGroup = new VisualStateGroup { Name = CommonStatesName };
|
||||
var normalState = new VisualState { Name = NormalStateName };
|
||||
var invalidState = new VisualState { Name = InvalidStateName };
|
||||
|
||||
visualStateGroup.States.Add(normalState);
|
||||
visualStateGroup.States.Add(invalidState);
|
||||
|
||||
stateGroups.Add(visualStateGroup);
|
||||
|
||||
return stateGroups;
|
||||
}
|
||||
|
||||
static VisualStateGroupList CreateStateGroupsWithoutNormalState()
|
||||
{
|
||||
var stateGroups = new VisualStateGroupList();
|
||||
var visualStateGroup = new VisualStateGroup { Name = CommonStatesName };
|
||||
var invalidState = new VisualState { Name = InvalidStateName };
|
||||
|
||||
visualStateGroup.States.Add(invalidState);
|
||||
|
||||
stateGroups.Add(visualStateGroup);
|
||||
|
||||
return stateGroups;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InitialStateIsNormalIfAvailable()
|
||||
{
|
||||
var label1 = new Label();
|
||||
|
||||
VisualStateManager.SetVisualStateGroups(label1, CreateTestStateGroups());
|
||||
|
||||
var groups1 = VisualStateManager.GetVisualStateGroups(label1);
|
||||
|
||||
Assert.That(groups1[0].CurrentState.Name, Is.EqualTo(NormalStateName));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InitialStateIsNullIfNormalNotAvailable()
|
||||
{
|
||||
var label1 = new Label();
|
||||
|
||||
VisualStateManager.SetVisualStateGroups(label1, CreateStateGroupsWithoutNormalState());
|
||||
|
||||
var groups1 = VisualStateManager.GetVisualStateGroups(label1);
|
||||
|
||||
Assert.Null(groups1[0].CurrentState);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void VisualElementsStateGroupsAreDistinct()
|
||||
{
|
||||
var label1 = new Label();
|
||||
var label2 = new Label();
|
||||
|
||||
VisualStateManager.SetVisualStateGroups(label1, CreateTestStateGroups());
|
||||
VisualStateManager.SetVisualStateGroups(label2, CreateTestStateGroups());
|
||||
|
||||
var groups1 = VisualStateManager.GetVisualStateGroups(label1);
|
||||
var groups2 = VisualStateManager.GetVisualStateGroups(label2);
|
||||
|
||||
Assert.AreNotSame(groups1, groups2);
|
||||
|
||||
Assert.That(groups1[0].CurrentState.Name, Is.EqualTo(NormalStateName));
|
||||
Assert.That(groups2[0].CurrentState.Name, Is.EqualTo(NormalStateName));
|
||||
|
||||
VisualStateManager.GoToState(label1, InvalidStateName);
|
||||
|
||||
Assert.That(groups1[0].CurrentState.Name, Is.EqualTo(InvalidStateName));
|
||||
Assert.That(groups2[0].CurrentState.Name, Is.EqualTo(NormalStateName));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void VisualStateGroupsFromSettersAreDistinct()
|
||||
{
|
||||
var x = new Setter();
|
||||
x.Property = VisualStateManager.VisualStateGroupsProperty;
|
||||
x.Value = CreateTestStateGroups();
|
||||
|
||||
var label1 = new Label();
|
||||
var label2 = new Label();
|
||||
|
||||
x.Apply(label1);
|
||||
x.Apply(label2);
|
||||
|
||||
var groups1 = VisualStateManager.GetVisualStateGroups(label1);
|
||||
var groups2 = VisualStateManager.GetVisualStateGroups(label2);
|
||||
|
||||
Assert.NotNull(groups1);
|
||||
Assert.NotNull(groups2);
|
||||
|
||||
Assert.AreNotSame(groups1, groups2);
|
||||
|
||||
Assert.That(groups1[0].CurrentState.Name, Is.EqualTo(NormalStateName));
|
||||
Assert.That(groups2[0].CurrentState.Name, Is.EqualTo(NormalStateName));
|
||||
|
||||
VisualStateManager.GoToState(label1, InvalidStateName);
|
||||
|
||||
Assert.That(groups1[0].CurrentState.Name, Is.EqualTo(InvalidStateName));
|
||||
Assert.That(groups2[0].CurrentState.Name, Is.EqualTo(NormalStateName));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ElementsDoNotHaveVisualStateGroupsCollectionByDefault()
|
||||
{
|
||||
var label1 = new Label();
|
||||
Assert.False(label1.HasVisualStateGroups());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void StateNamesMustBeUniqueWithinGroup()
|
||||
{
|
||||
IList<VisualStateGroup> vsgs = CreateTestStateGroups();
|
||||
|
||||
var duplicate = new VisualState { Name = NormalStateName };
|
||||
|
||||
Assert.Throws<InvalidOperationException>(() => vsgs[0].States.Add(duplicate));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void StateNamesMustBeUniqueWithinGroupList()
|
||||
{
|
||||
IList<VisualStateGroup> vsgs = CreateTestStateGroups();
|
||||
|
||||
// Create and add a second VisualStateGroup
|
||||
var secondGroup = new VisualStateGroup { Name = "Foo" };
|
||||
vsgs.Add(secondGroup);
|
||||
|
||||
// Create a VisualState with the same name as one in another group in this list
|
||||
var duplicate = new VisualState { Name = NormalStateName };
|
||||
|
||||
Assert.Throws<InvalidOperationException>(() => secondGroup.States.Add(duplicate));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GroupNamesMustBeUniqueWithinGroupList()
|
||||
{
|
||||
IList<VisualStateGroup> vsgs = CreateTestStateGroups();
|
||||
var secondGroup = new VisualStateGroup { Name = CommonStatesName };
|
||||
|
||||
Assert.Throws<InvalidOperationException>(() => vsgs.Add(secondGroup));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void StateNamesInGroupMayNotBeNull()
|
||||
{
|
||||
IList<VisualStateGroup> vsgs = CreateTestStateGroups();
|
||||
|
||||
var nullStateName = new VisualState();
|
||||
|
||||
Assert.Throws<InvalidOperationException>(() => vsgs[0].States.Add(nullStateName));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void StateNamesInGroupMayNotBeEmpty()
|
||||
{
|
||||
IList<VisualStateGroup> vsgs = CreateTestStateGroups();
|
||||
|
||||
var emptyStateName = new VisualState{Name = ""};
|
||||
|
||||
Assert.Throws<InvalidOperationException>(() => vsgs[0].States.Add(emptyStateName));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -153,6 +153,7 @@
|
|||
<Compile Include="TypeUnitTests.cs" />
|
||||
<Compile Include="ViewCellTests.cs" />
|
||||
<Compile Include="ViewUnitTests.cs" />
|
||||
<Compile Include="VisualStateManagerTests.cs" />
|
||||
<Compile Include="WeakEventManagerTests.cs" />
|
||||
<Compile Include="WebViewUnitTests.cs" />
|
||||
<Compile Include="ImageSourceTests.cs" />
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
@ -45,10 +47,13 @@ namespace Xamarin.Forms
|
|||
{
|
||||
var style = parent as Style;
|
||||
var triggerBase = parent as TriggerBase;
|
||||
var visualState = parent as VisualState;
|
||||
if (style != null)
|
||||
type = style.TargetType;
|
||||
else if (triggerBase != null)
|
||||
type = triggerBase.TargetType;
|
||||
else if (visualState != null)
|
||||
type = FindTypeForVisualState(parentValuesProvider, lineinfo);
|
||||
}
|
||||
else if (parentValuesProvider.TargetObject is Trigger)
|
||||
type = (parentValuesProvider.TargetObject as Trigger).TargetType;
|
||||
|
@ -102,5 +107,44 @@ namespace Xamarin.Forms
|
|||
throw new XamlParseException($"The PropertyName of {type.Name}.{name} is not {propertyName}", lineinfo);
|
||||
return bp;
|
||||
}
|
||||
|
||||
Type FindTypeForVisualState(IProvideParentValues parentValueProvider, IXmlLineInfo lineInfo)
|
||||
{
|
||||
var parents = parentValueProvider.ParentObjects.ToList();
|
||||
|
||||
// Skip 0; we would not be making this check if TargetObject were not a Setter
|
||||
// Skip 1; we would not be making this check if the immediate parent were not a VisualState
|
||||
|
||||
// VisualStates must be in a VisualStateGroup
|
||||
if(!(parents[2] is VisualStateGroup)) {
|
||||
throw new XamlParseException($"Expected {nameof(VisualStateGroup)} but found {parents[2]}.", lineInfo);
|
||||
}
|
||||
|
||||
var vsTarget = parents[3];
|
||||
|
||||
// Are these Visual States directly on a VisualElement?
|
||||
if (vsTarget is VisualElement)
|
||||
{
|
||||
return vsTarget.GetType();
|
||||
}
|
||||
|
||||
if (!(parents[3] is VisualStateGroupList))
|
||||
{
|
||||
throw new XamlParseException($"Expected {nameof(VisualStateGroupList)} but found {parents[3]}.", lineInfo);
|
||||
}
|
||||
|
||||
if (!(parents[4] is Setter))
|
||||
{
|
||||
throw new XamlParseException($"Expected {nameof(Setter)} but found {parents[4]}.", lineInfo);
|
||||
}
|
||||
|
||||
// These must be part of a Style; verify that
|
||||
if (!(parents[5] is Style style))
|
||||
{
|
||||
throw new XamlParseException($"Expected {nameof(Style)} but found {parents[5]}.", lineInfo);
|
||||
}
|
||||
|
||||
return style.TargetType;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
namespace Xamarin.Forms.PlatformConfiguration.AndroidSpecific
|
||||
{
|
||||
public static class Elevation
|
||||
{
|
||||
public static readonly BindableProperty ElevationProperty =
|
||||
BindableProperty.Create("Elevation", typeof(float?),
|
||||
typeof(Elevation));
|
||||
|
||||
public static float? GetElevation(VisualElement element)
|
||||
{
|
||||
return (float?)element.GetValue(ElevationProperty);
|
||||
}
|
||||
|
||||
public static void SetElevation(VisualElement element, float? value)
|
||||
{
|
||||
element.SetValue(ElevationProperty, value);
|
||||
}
|
||||
|
||||
public static float? GetElevation(this IPlatformElementConfiguration<Android, VisualElement> config)
|
||||
{
|
||||
return GetElevation(config.Element);
|
||||
}
|
||||
|
||||
public static IPlatformElementConfiguration<Android, VisualElement> SetElevation(this IPlatformElementConfiguration<Android, VisualElement> config, float? value)
|
||||
{
|
||||
SetElevation(config.Element, value);
|
||||
return config;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
namespace Xamarin.Forms.PlatformConfiguration.AndroidSpecific
|
||||
{
|
||||
using FormsElement = Forms.VisualElement;
|
||||
|
||||
public static class VisualElement
|
||||
{
|
||||
#region Elevation
|
||||
|
||||
public static readonly BindableProperty ElevationProperty =
|
||||
BindableProperty.Create("Elevation", typeof(float?),
|
||||
typeof(FormsElement));
|
||||
|
||||
public static float? GetElevation(FormsElement element)
|
||||
{
|
||||
return (float?)element.GetValue(ElevationProperty);
|
||||
}
|
||||
|
||||
public static void SetElevation(FormsElement element, float? value)
|
||||
{
|
||||
element.SetValue(ElevationProperty, value);
|
||||
}
|
||||
|
||||
public static float? GetElevation(this IPlatformElementConfiguration<Android, FormsElement> config)
|
||||
{
|
||||
return GetElevation(config.Element);
|
||||
}
|
||||
|
||||
public static IPlatformElementConfiguration<Android, FormsElement> SetElevation(this IPlatformElementConfiguration<Android, FormsElement> config, float? value)
|
||||
{
|
||||
SetElevation(config.Element, value);
|
||||
return config;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IsLegacyColorModeEnabled
|
||||
|
||||
public static readonly BindableProperty IsLegacyColorModeEnabledProperty =
|
||||
BindableProperty.CreateAttached("IsLegacyColorModeEnabled", typeof(bool),
|
||||
typeof(FormsElement), true);
|
||||
|
||||
public static bool GetIsLegacyColorModeEnabled(BindableObject element)
|
||||
{
|
||||
return (bool)element.GetValue(IsLegacyColorModeEnabledProperty);
|
||||
}
|
||||
|
||||
public static void SetIsLegacyColorModeEnabled(BindableObject element, bool value)
|
||||
{
|
||||
element.SetValue(IsLegacyColorModeEnabledProperty, value);
|
||||
}
|
||||
|
||||
public static bool GetIsLegacyColorModeEnabled(this IPlatformElementConfiguration<Android, FormsElement> config)
|
||||
{
|
||||
return (bool)config.Element.GetValue(IsLegacyColorModeEnabledProperty);
|
||||
}
|
||||
|
||||
public static IPlatformElementConfiguration<Android, FormsElement> SetIsLegacyColorModeEnabled(
|
||||
this IPlatformElementConfiguration<Android, FormsElement> config, bool value)
|
||||
{
|
||||
config.Element.SetValue(IsLegacyColorModeEnabledProperty, value);
|
||||
return config;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
namespace Xamarin.Forms.PlatformConfiguration.WindowsSpecific
|
||||
{
|
||||
using FormsElement = Forms.VisualElement;
|
||||
|
||||
public static class VisualElement
|
||||
{
|
||||
#region IsLegacyColorModeEnabled
|
||||
|
||||
public static readonly BindableProperty IsLegacyColorModeEnabledProperty =
|
||||
BindableProperty.CreateAttached("IsLegacyColorModeEnabled", typeof(bool),
|
||||
typeof(FormsElement), true);
|
||||
|
||||
public static bool GetIsLegacyColorModeEnabled(BindableObject element)
|
||||
{
|
||||
return (bool)element.GetValue(IsLegacyColorModeEnabledProperty);
|
||||
}
|
||||
|
||||
public static void SetIsLegacyColorModeEnabled(BindableObject element, bool value)
|
||||
{
|
||||
element.SetValue(IsLegacyColorModeEnabledProperty, value);
|
||||
}
|
||||
|
||||
public static bool GetIsLegacyColorModeEnabled(this IPlatformElementConfiguration<Windows, FormsElement> config)
|
||||
{
|
||||
return (bool)config.Element.GetValue(IsLegacyColorModeEnabledProperty);
|
||||
}
|
||||
|
||||
public static IPlatformElementConfiguration<Windows, FormsElement> SetIsLegacyColorModeEnabled(
|
||||
this IPlatformElementConfiguration<Windows, FormsElement> config, bool value)
|
||||
{
|
||||
config.Element.SetValue(IsLegacyColorModeEnabledProperty, value);
|
||||
return config;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -25,19 +25,22 @@ namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
|
|||
return GetAdjustsFontSizeToFitWidth(config.Element);
|
||||
}
|
||||
|
||||
public static IPlatformElementConfiguration<iOS, FormsElement> SetAdjustsFontSizeToFitWidth(this IPlatformElementConfiguration<iOS, FormsElement> config, bool value)
|
||||
public static IPlatformElementConfiguration<iOS, FormsElement> SetAdjustsFontSizeToFitWidth(
|
||||
this IPlatformElementConfiguration<iOS, FormsElement> config, bool value)
|
||||
{
|
||||
SetAdjustsFontSizeToFitWidth(config.Element, value);
|
||||
return config;
|
||||
}
|
||||
|
||||
public static IPlatformElementConfiguration<iOS, FormsElement> EnableAdjustsFontSizeToFitWidth(this IPlatformElementConfiguration<iOS, FormsElement> config)
|
||||
public static IPlatformElementConfiguration<iOS, FormsElement> EnableAdjustsFontSizeToFitWidth(
|
||||
this IPlatformElementConfiguration<iOS, FormsElement> config)
|
||||
{
|
||||
SetAdjustsFontSizeToFitWidth(config.Element, true);
|
||||
return config;
|
||||
}
|
||||
|
||||
public static IPlatformElementConfiguration<iOS, FormsElement> DisableAdjustsFontSizeToFitWidth(this IPlatformElementConfiguration<iOS, FormsElement> config)
|
||||
public static IPlatformElementConfiguration<iOS, FormsElement> DisableAdjustsFontSizeToFitWidth(
|
||||
this IPlatformElementConfiguration<iOS, FormsElement> config)
|
||||
{
|
||||
SetAdjustsFontSizeToFitWidth(config.Element, false);
|
||||
return config;
|
||||
|
|
|
@ -29,5 +29,35 @@ namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
|
|||
SetBlurEffect(config.Element, value);
|
||||
return config;
|
||||
}
|
||||
|
||||
#region IsLegacyColorModeEnabled
|
||||
|
||||
public static readonly BindableProperty IsLegacyColorModeEnabledProperty =
|
||||
BindableProperty.CreateAttached("IsLegacyColorModeEnabled", typeof(bool),
|
||||
typeof(FormsElement), true);
|
||||
|
||||
public static bool GetIsLegacyColorModeEnabled(BindableObject element)
|
||||
{
|
||||
return (bool)element.GetValue(IsLegacyColorModeEnabledProperty);
|
||||
}
|
||||
|
||||
public static void SetIsLegacyColorModeEnabled(BindableObject element, bool value)
|
||||
{
|
||||
element.SetValue(IsLegacyColorModeEnabledProperty, value);
|
||||
}
|
||||
|
||||
public static bool GetIsLegacyColorModeEnabled(this IPlatformElementConfiguration<iOS, FormsElement> config)
|
||||
{
|
||||
return (bool)config.Element.GetValue(IsLegacyColorModeEnabledProperty);
|
||||
}
|
||||
|
||||
public static IPlatformElementConfiguration<iOS, FormsElement> SetIsLegacyColorModeEnabled(
|
||||
this IPlatformElementConfiguration<iOS, FormsElement> config, bool value)
|
||||
{
|
||||
config.Element.SetValue(IsLegacyColorModeEnabledProperty, value);
|
||||
return config;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
|
||||
namespace Xamarin.Forms.Xaml
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
internal sealed class RuntimeNamePropertyAttribute : Attribute
|
||||
{
|
||||
public RuntimeNamePropertyAttribute(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public string Name { get; }
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Xml;
|
||||
|
@ -56,9 +57,14 @@ namespace Xamarin.Forms
|
|||
target.SetBinding(Property, binding.Clone(), fromStyle);
|
||||
else if (dynamicResource != null)
|
||||
target.SetDynamicResource(Property, dynamicResource.Key, fromStyle);
|
||||
else
|
||||
{
|
||||
if (Value is IList<VisualStateGroup> visualStateGroupCollection)
|
||||
target.SetValue(Property, visualStateGroupCollection.Clone(), fromStyle);
|
||||
else
|
||||
target.SetValue(Property, Value, fromStyle);
|
||||
}
|
||||
}
|
||||
|
||||
internal void UnApply(BindableObject target, bool fromStyle = false)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,8 @@ namespace Xamarin.Forms
|
|||
|
||||
public static readonly BindableProperty InputTransparentProperty = BindableProperty.Create("InputTransparent", typeof(bool), typeof(VisualElement), default(bool));
|
||||
|
||||
public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create("IsEnabled", typeof(bool), typeof(VisualElement), true);
|
||||
public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create("IsEnabled", typeof(bool),
|
||||
typeof(VisualElement), true, propertyChanged: OnIsEnabledPropertyChanged);
|
||||
|
||||
static readonly BindablePropertyKey XPropertyKey = BindableProperty.CreateReadOnly("X", typeof(double), typeof(VisualElement), default(double));
|
||||
|
||||
|
@ -88,8 +89,8 @@ namespace Xamarin.Forms
|
|||
public static readonly BindableProperty MinimumHeightRequestProperty = BindableProperty.Create("MinimumHeightRequest", typeof(double), typeof(VisualElement), -1d, propertyChanged: OnRequestChanged);
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static readonly BindablePropertyKey IsFocusedPropertyKey = BindableProperty.CreateReadOnly("IsFocused", typeof(bool), typeof(VisualElement), default(bool),
|
||||
propertyChanged: OnIsFocusedPropertyChanged);
|
||||
public static readonly BindablePropertyKey IsFocusedPropertyKey = BindableProperty.CreateReadOnly("IsFocused",
|
||||
typeof(bool), typeof(VisualElement), default(bool), propertyChanged: OnIsFocusedPropertyChanged);
|
||||
|
||||
public static readonly BindableProperty IsFocusedProperty = IsFocusedPropertyKey.BindableProperty;
|
||||
|
||||
|
@ -801,9 +802,30 @@ namespace Xamarin.Forms
|
|||
self.NotifyFlowDirectionChanged();
|
||||
}
|
||||
|
||||
static void OnIsEnabledPropertyChanged(BindableObject bindable, object oldValue, object newValue)
|
||||
{
|
||||
var element = (VisualElement)bindable;
|
||||
|
||||
if (element == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var isEnabled = (bool)newValue;
|
||||
|
||||
VisualStateManager.GoToState(element, isEnabled
|
||||
? VisualStateManager.CommonStates.Normal
|
||||
: VisualStateManager.CommonStates.Disabled);
|
||||
}
|
||||
|
||||
static void OnIsFocusedPropertyChanged(BindableObject bindable, object oldvalue, object newvalue)
|
||||
{
|
||||
var element = bindable as VisualElement;
|
||||
var element = (VisualElement)bindable;
|
||||
|
||||
if (element == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var isFocused = (bool)newvalue;
|
||||
if (isFocused)
|
||||
|
@ -814,6 +836,10 @@ namespace Xamarin.Forms
|
|||
{
|
||||
element.OnUnfocus();
|
||||
}
|
||||
|
||||
VisualStateManager.GoToState(element, isFocused
|
||||
? VisualStateManager.CommonStates.Normal
|
||||
: VisualStateManager.CommonStates.Focused);
|
||||
}
|
||||
|
||||
static void OnRequestChanged(BindableObject bindable, object oldvalue, object newvalue)
|
||||
|
|
|
@ -0,0 +1,361 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace Xamarin.Forms
|
||||
{
|
||||
public static class VisualStateManager
|
||||
{
|
||||
internal class CommonStates
|
||||
{
|
||||
public const string Normal = "Normal";
|
||||
public const string Disabled = "Disabled";
|
||||
public const string Focused = "Focused";
|
||||
}
|
||||
|
||||
public static readonly BindableProperty VisualStateGroupsProperty =
|
||||
BindableProperty.CreateAttached("VisualStateGroups", typeof(VisualStateGroupList), typeof(VisualElement),
|
||||
defaultValue: null, propertyChanged: VisualStateGroupsPropertyChanged,
|
||||
defaultValueCreator: bindable => new VisualStateGroupList());
|
||||
|
||||
static void VisualStateGroupsPropertyChanged(BindableObject bindable, object oldValue, object newValue)
|
||||
{
|
||||
GoToState((VisualElement)bindable, CommonStates.Normal);
|
||||
}
|
||||
|
||||
public static IList<VisualStateGroup> GetVisualStateGroups(VisualElement visualElement)
|
||||
{
|
||||
return (IList<VisualStateGroup>)visualElement.GetValue(VisualStateGroupsProperty);
|
||||
}
|
||||
|
||||
public static void SetVisualStateGroups(VisualElement visualElement, VisualStateGroupList value)
|
||||
{
|
||||
visualElement.SetValue(VisualStateGroupsProperty, value);
|
||||
}
|
||||
|
||||
public static bool GoToState(VisualElement visualElement, string name)
|
||||
{
|
||||
if (visualElement.GetIsDefault(VisualStateGroupsProperty))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var groups = (IList<VisualStateGroup>)visualElement.GetValue(VisualStateGroupsProperty);
|
||||
|
||||
foreach (VisualStateGroup group in groups)
|
||||
{
|
||||
if (group.CurrentState?.Name == name)
|
||||
{
|
||||
// We're already in the target state; nothing else to do
|
||||
return true;
|
||||
}
|
||||
|
||||
// See if this group contains the new state
|
||||
var target = group.GetState(name);
|
||||
if (target == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// If we've got a new state to transition to, unapply the setters from the current state
|
||||
if (group.CurrentState != null)
|
||||
{
|
||||
foreach (Setter setter in group.CurrentState.Setters)
|
||||
{
|
||||
setter.UnApply(visualElement);
|
||||
}
|
||||
}
|
||||
|
||||
// Update the current state
|
||||
group.CurrentState = target;
|
||||
|
||||
// Apply the setters from the new state
|
||||
foreach (Setter setter in target.Setters)
|
||||
{
|
||||
setter.Apply(visualElement);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool HasVisualStateGroups(this VisualElement element)
|
||||
{
|
||||
return !element.GetIsDefault(VisualStateGroupsProperty);
|
||||
}
|
||||
}
|
||||
|
||||
public class VisualStateGroupList : IList<VisualStateGroup>
|
||||
{
|
||||
readonly IList<VisualStateGroup> _internalList;
|
||||
|
||||
void Validate(IList<VisualStateGroup> groups)
|
||||
{
|
||||
// If we have 1 group, no need to worry about duplicate group names
|
||||
if (groups.Count > 1)
|
||||
{
|
||||
if (groups.GroupBy(vsg => vsg.Name).Any(g => g.Count() > 1))
|
||||
{
|
||||
throw new InvalidOperationException("VisualStateGroup Names must be unique");
|
||||
}
|
||||
}
|
||||
|
||||
// State names must be unique within this group list, so pull in all
|
||||
// the states in all the groups, group them by name, and see if we have
|
||||
// and duplicates
|
||||
if (groups.SelectMany(group => group.States)
|
||||
.GroupBy(state => state.Name)
|
||||
.Any(g => g.Count() > 1))
|
||||
{
|
||||
throw new InvalidOperationException("VisualState Names must be unique");
|
||||
}
|
||||
}
|
||||
|
||||
public VisualStateGroupList()
|
||||
{
|
||||
_internalList = new WatchAddList<VisualStateGroup>(Validate);
|
||||
}
|
||||
|
||||
void ValidateOnStatesChanged(object sender, EventArgs eventArgs)
|
||||
{
|
||||
Validate(_internalList);
|
||||
}
|
||||
|
||||
public IEnumerator<VisualStateGroup> GetEnumerator()
|
||||
{
|
||||
return _internalList.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return ((IEnumerable)_internalList).GetEnumerator();
|
||||
}
|
||||
|
||||
public void Add(VisualStateGroup item)
|
||||
{
|
||||
_internalList.Add(item);
|
||||
item.StatesChanged += ValidateOnStatesChanged;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
foreach (var group in _internalList)
|
||||
{
|
||||
group.StatesChanged -= ValidateOnStatesChanged;
|
||||
}
|
||||
|
||||
_internalList.Clear();
|
||||
}
|
||||
|
||||
public bool Contains(VisualStateGroup item)
|
||||
{
|
||||
return _internalList.Contains(item);
|
||||
}
|
||||
|
||||
public void CopyTo(VisualStateGroup[] array, int arrayIndex)
|
||||
{
|
||||
_internalList.CopyTo(array, arrayIndex);
|
||||
}
|
||||
|
||||
public bool Remove(VisualStateGroup item)
|
||||
{
|
||||
item.StatesChanged -= ValidateOnStatesChanged;
|
||||
return _internalList.Remove(item);
|
||||
}
|
||||
|
||||
public int Count => _internalList.Count;
|
||||
|
||||
public bool IsReadOnly => false;
|
||||
|
||||
public int IndexOf(VisualStateGroup item)
|
||||
{
|
||||
return _internalList.IndexOf(item);
|
||||
}
|
||||
|
||||
public void Insert(int index, VisualStateGroup item)
|
||||
{
|
||||
item.StatesChanged += ValidateOnStatesChanged;
|
||||
_internalList.Insert(index, item);
|
||||
}
|
||||
|
||||
public void RemoveAt(int index)
|
||||
{
|
||||
_internalList[index].StatesChanged -= ValidateOnStatesChanged;
|
||||
_internalList.RemoveAt(index);
|
||||
}
|
||||
|
||||
public VisualStateGroup this[int index]
|
||||
{
|
||||
get => _internalList[index];
|
||||
set => _internalList[index] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[RuntimeNameProperty(nameof(Name))]
|
||||
[ContentProperty(nameof(States))]
|
||||
public sealed class VisualStateGroup
|
||||
{
|
||||
public VisualStateGroup()
|
||||
{
|
||||
States = new WatchAddList<VisualState>(OnStatesChanged);
|
||||
}
|
||||
|
||||
public Type TargetType { get; set; }
|
||||
public string Name { get; set; }
|
||||
public IList<VisualState> States { get; }
|
||||
public VisualState CurrentState { get; internal set; }
|
||||
|
||||
internal VisualState GetState(string name)
|
||||
{
|
||||
foreach (VisualState state in States)
|
||||
{
|
||||
if (string.CompareOrdinal(state.Name, name) == 0)
|
||||
{
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
internal VisualStateGroup Clone()
|
||||
{
|
||||
var clone = new VisualStateGroup {TargetType = TargetType, Name = Name, CurrentState = CurrentState};
|
||||
foreach (VisualState state in States)
|
||||
{
|
||||
clone.States.Add(state.Clone());
|
||||
}
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
internal event EventHandler StatesChanged;
|
||||
|
||||
void OnStatesChanged(IList<VisualState> list)
|
||||
{
|
||||
if (list.Any(state => string.IsNullOrEmpty(state.Name)))
|
||||
{
|
||||
throw new InvalidOperationException("State names may not be null or empty");
|
||||
}
|
||||
|
||||
StatesChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
[RuntimeNameProperty(nameof(Name))]
|
||||
public sealed class VisualState
|
||||
{
|
||||
public VisualState()
|
||||
{
|
||||
Setters = new ObservableCollection<Setter>();
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
public IList<Setter> Setters { get;}
|
||||
public Type TargetType { get; set; }
|
||||
|
||||
internal VisualState Clone()
|
||||
{
|
||||
var clone = new VisualState { Name = Name, TargetType = TargetType };
|
||||
foreach (var setter in Setters)
|
||||
{
|
||||
clone.Setters.Add(setter);
|
||||
}
|
||||
|
||||
return clone;
|
||||
}
|
||||
}
|
||||
|
||||
internal static class VisualStateGroupListExtensions
|
||||
{
|
||||
internal static IList<VisualStateGroup> Clone(this IList<VisualStateGroup> groups)
|
||||
{
|
||||
var actual = new VisualStateGroupList();
|
||||
foreach (var group in groups)
|
||||
{
|
||||
actual.Add(group.Clone());
|
||||
}
|
||||
|
||||
return actual;
|
||||
}
|
||||
}
|
||||
|
||||
internal class WatchAddList<T> : IList<T>
|
||||
{
|
||||
readonly Action<List<T>> _onAdd;
|
||||
readonly List<T> _internalList;
|
||||
|
||||
public WatchAddList(Action<List<T>> onAdd)
|
||||
{
|
||||
_onAdd = onAdd;
|
||||
_internalList = new List<T>();
|
||||
}
|
||||
|
||||
public IEnumerator<T> GetEnumerator()
|
||||
{
|
||||
return _internalList.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return ((IEnumerable)_internalList).GetEnumerator();
|
||||
}
|
||||
|
||||
public void Add(T item)
|
||||
{
|
||||
_internalList.Add(item);
|
||||
_onAdd(_internalList);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
_internalList.Clear();
|
||||
}
|
||||
|
||||
public bool Contains(T item)
|
||||
{
|
||||
return _internalList.Contains(item);
|
||||
}
|
||||
|
||||
public void CopyTo(T[] array, int arrayIndex)
|
||||
{
|
||||
_internalList.CopyTo(array, arrayIndex);
|
||||
}
|
||||
|
||||
public bool Remove(T item)
|
||||
{
|
||||
return _internalList.Remove(item);
|
||||
}
|
||||
|
||||
public int Count => _internalList.Count;
|
||||
|
||||
public bool IsReadOnly => false;
|
||||
|
||||
public int IndexOf(T item)
|
||||
{
|
||||
return _internalList.IndexOf(item);
|
||||
}
|
||||
|
||||
public void Insert(int index, T item)
|
||||
{
|
||||
_internalList.Insert(index, item);
|
||||
_onAdd(_internalList);
|
||||
}
|
||||
|
||||
public void RemoveAt(int index)
|
||||
{
|
||||
_internalList.RemoveAt(index);
|
||||
}
|
||||
|
||||
public T this[int index]
|
||||
{
|
||||
get => _internalList[index];
|
||||
set => _internalList[index] = value;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ using Android.Support.V4.Content;
|
|||
using Android.Support.V7.Widget;
|
||||
using Android.Util;
|
||||
using Xamarin.Forms.Internals;
|
||||
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
|
||||
using GlobalResource = Android.Resource;
|
||||
using Object = Java.Lang.Object;
|
||||
using AView = Android.Views.View;
|
||||
|
@ -111,9 +112,11 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
|
|||
button.SetOnClickListener(ButtonClickListener.Instance.Value);
|
||||
button.SetOnTouchListener(ButtonTouchListener.Instance.Value);
|
||||
button.Tag = this;
|
||||
_textColorSwitcher = new TextColorSwitcher(button.TextColors);
|
||||
SetNativeControl(button);
|
||||
|
||||
var useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
_textColorSwitcher = new TextColorSwitcher(button.TextColors, useLegacyColorManagement);
|
||||
|
||||
SetNativeControl(button);
|
||||
button.AddOnAttachStateChangeListener(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ using System.ComponentModel;
|
|||
using System.Linq;
|
||||
using Android.Content;
|
||||
using Object = Java.Lang.Object;
|
||||
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
|
||||
|
||||
namespace Xamarin.Forms.Platform.Android.AppCompat
|
||||
{
|
||||
|
@ -62,7 +63,10 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
|
|||
textField.Tag = this;
|
||||
textField.InputType = InputTypes.Null;
|
||||
textField.SetOnClickListener(PickerListener.Instance);
|
||||
_textColorSwitcher = new TextColorSwitcher(textField.TextColors);
|
||||
|
||||
var useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
_textColorSwitcher = new TextColorSwitcher(textField.TextColors, useLegacyColorManagement);
|
||||
|
||||
SetNativeControl(textField);
|
||||
}
|
||||
UpdateFont();
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
|
|||
int _imageHeight = -1;
|
||||
bool _isDisposed;
|
||||
bool _inputTransparent;
|
||||
readonly Lazy<TextColorSwitcher> _textColorSwitcher;
|
||||
Lazy<TextColorSwitcher> _textColorSwitcher;
|
||||
readonly AutomationPropertiesProvider _automationPropertiesProvider;
|
||||
readonly EffectControlProvider _effectControlProvider;
|
||||
VisualElementTracker _tracker;
|
||||
|
@ -38,7 +38,6 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
|
|||
{
|
||||
_automationPropertiesProvider = new AutomationPropertiesProvider(this);
|
||||
_effectControlProvider = new EffectControlProvider(this);
|
||||
_textColorSwitcher = new Lazy<TextColorSwitcher>(() => new TextColorSwitcher(TextColors));
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
@ -48,7 +47,6 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
|
|||
{
|
||||
_automationPropertiesProvider = new AutomationPropertiesProvider(this);
|
||||
_effectControlProvider = new EffectControlProvider(this);
|
||||
_textColorSwitcher = new Lazy<TextColorSwitcher>(() => new TextColorSwitcher(TextColors));
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
@ -223,6 +221,9 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
|
|||
{
|
||||
this.EnsureId();
|
||||
|
||||
_textColorSwitcher = new Lazy<TextColorSwitcher>(
|
||||
() => new TextColorSwitcher(TextColors, e.NewElement.UseLegacyColorManagement()));
|
||||
|
||||
UpdateFont();
|
||||
UpdateText();
|
||||
UpdateBitmap();
|
||||
|
@ -503,7 +504,7 @@ namespace Xamarin.Forms.Platform.Android.FastRenderers
|
|||
|
||||
void UpdateTextColor()
|
||||
{
|
||||
if (Element == null || _isDisposed)
|
||||
if (Element == null || _isDisposed || _textColorSwitcher == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ using Android.Content;
|
|||
using Android.Graphics;
|
||||
using Android.Graphics.Drawables;
|
||||
using Android.Util;
|
||||
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
|
||||
using static System.String;
|
||||
using AButton = Android.Widget.Button;
|
||||
using AView = Android.Views.View;
|
||||
|
@ -108,7 +109,10 @@ namespace Xamarin.Forms.Platform.Android
|
|||
button.SetOnTouchListener(ButtonTouchListener.Instance.Value);
|
||||
button.Tag = this;
|
||||
SetNativeControl(button);
|
||||
_textColorSwitcher = new TextColorSwitcher(button.TextColors);
|
||||
|
||||
var useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
_textColorSwitcher = new TextColorSwitcher(button.TextColors, useLegacyColorManagement);
|
||||
|
||||
button.AddOnAttachStateChangeListener(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ using Android.Content;
|
|||
using Android.Content.Res;
|
||||
using Android.Util;
|
||||
using Android.Widget;
|
||||
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
|
||||
using AView = Android.Views.View;
|
||||
using Object = Java.Lang.Object;
|
||||
|
||||
|
@ -67,7 +68,9 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
textField.SetOnClickListener(TextFieldClickHandler.Instance);
|
||||
SetNativeControl(textField);
|
||||
_textColorSwitcher = new TextColorSwitcher(textField.TextColors);
|
||||
|
||||
var useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
_textColorSwitcher = new TextColorSwitcher(textField.TextColors, useLegacyColorManagement);
|
||||
}
|
||||
|
||||
SetDate(Element.Date);
|
||||
|
|
|
@ -15,8 +15,8 @@ namespace Xamarin.Forms.Platform.Android
|
|||
{
|
||||
public class EditorRenderer : ViewRenderer<Editor, FormsEditText>, ITextWatcher
|
||||
{
|
||||
ColorStateList _defaultColors;
|
||||
bool _disposed;
|
||||
TextColorSwitcher _textColorSwitcher;
|
||||
|
||||
public EditorRenderer(Context context) : base(context)
|
||||
{
|
||||
|
@ -67,6 +67,9 @@ namespace Xamarin.Forms.Platform.Android
|
|||
SetNativeControl(edit);
|
||||
edit.AddTextChangedListener(this);
|
||||
edit.OnKeyboardBackPressed += OnKeyboardBackPressed;
|
||||
|
||||
var useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
_textColorSwitcher = new TextColorSwitcher(edit.TextColors, useLegacyColorManagement);
|
||||
}
|
||||
|
||||
edit.SetSingleLine(false);
|
||||
|
@ -166,28 +169,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
void UpdateTextColor()
|
||||
{
|
||||
if (Element.TextColor.IsDefault)
|
||||
{
|
||||
if (_defaultColors == null)
|
||||
{
|
||||
// This control has always had the default colors; nothing to update
|
||||
return;
|
||||
}
|
||||
|
||||
// This control is being set back to the default colors
|
||||
Control.SetTextColor(_defaultColors);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_defaultColors == null)
|
||||
{
|
||||
// Keep track of the default colors so we can return to them later
|
||||
// and so we can preserve the default disabled color
|
||||
_defaultColors = Control.TextColors;
|
||||
}
|
||||
|
||||
Control.SetTextColor(Element.TextColor.ToAndroidPreserveDisabled(_defaultColors));
|
||||
}
|
||||
_textColorSwitcher?.UpdateTextColor(Control, Element.TextColor);
|
||||
}
|
||||
|
||||
void OnKeyboardBackPressed(object sender, EventArgs eventArgs)
|
||||
|
|
|
@ -9,13 +9,14 @@ using Android.Views;
|
|||
using Android.Views.InputMethods;
|
||||
using Android.Widget;
|
||||
using Java.Lang;
|
||||
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
|
||||
|
||||
namespace Xamarin.Forms.Platform.Android
|
||||
{
|
||||
public class EntryRenderer : ViewRenderer<Entry, FormsEditText>, ITextWatcher, TextView.IOnEditorActionListener
|
||||
{
|
||||
ColorStateList _hintTextColorDefault;
|
||||
ColorStateList _textColorDefault;
|
||||
TextColorSwitcher _hintColorSwitcher;
|
||||
TextColorSwitcher _textColorSwitcher;
|
||||
bool _disposed;
|
||||
|
||||
public EntryRenderer(Context context) : base(context)
|
||||
|
@ -76,6 +77,14 @@ namespace Xamarin.Forms.Platform.Android
|
|||
textView.AddTextChangedListener(this);
|
||||
textView.SetOnEditorActionListener(this);
|
||||
textView.OnKeyboardBackPressed += OnKeyboardBackPressed;
|
||||
|
||||
var useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
|
||||
_textColorSwitcher = new TextColorSwitcher(textView.TextColors, useLegacyColorManagement);
|
||||
_hintColorSwitcher = new TextColorSwitcher(textView.HintTextColors, useLegacyColorManagement);
|
||||
|
||||
|
||||
|
||||
SetNativeControl(textView);
|
||||
}
|
||||
|
||||
|
@ -162,28 +171,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
void UpdateColor()
|
||||
{
|
||||
if (Element.TextColor.IsDefault)
|
||||
{
|
||||
if (_textColorDefault == null)
|
||||
{
|
||||
// This control has always had the default colors; nothing to update
|
||||
return;
|
||||
}
|
||||
|
||||
// This control is being set back to the default colors
|
||||
Control.SetTextColor(_textColorDefault);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_textColorDefault == null)
|
||||
{
|
||||
// Keep track of the default colors so we can return to them later
|
||||
// and so we can preserve the default disabled color
|
||||
_textColorDefault = Control.TextColors;
|
||||
}
|
||||
|
||||
Control.SetTextColor(Element.TextColor.ToAndroidPreserveDisabled(_textColorDefault));
|
||||
}
|
||||
_textColorSwitcher.UpdateTextColor(Control, Element.TextColor);
|
||||
}
|
||||
|
||||
void UpdateFont()
|
||||
|
@ -212,30 +200,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
void UpdatePlaceholderColor()
|
||||
{
|
||||
Color placeholderColor = Element.PlaceholderColor;
|
||||
|
||||
if (placeholderColor.IsDefault)
|
||||
{
|
||||
if (_hintTextColorDefault == null)
|
||||
{
|
||||
// This control has always had the default colors; nothing to update
|
||||
return;
|
||||
}
|
||||
|
||||
// This control is being set back to the default colors
|
||||
Control.SetHintTextColor(_hintTextColorDefault);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_hintTextColorDefault == null)
|
||||
{
|
||||
// Keep track of the default colors so we can return to them later
|
||||
// and so we can preserve the default disabled color
|
||||
_hintTextColorDefault = Control.HintTextColors;
|
||||
}
|
||||
|
||||
Control.SetHintTextColor(placeholderColor.ToAndroidPreserveDisabled(_hintTextColorDefault));
|
||||
}
|
||||
_hintColorSwitcher.UpdateTextColor(Control, Element.PlaceholderColor, Control.SetHintTextColor);
|
||||
}
|
||||
|
||||
void OnKeyboardBackPressed(object sender, EventArgs eventArgs)
|
||||
|
|
|
@ -12,6 +12,7 @@ using ATimePicker = Android.Widget.TimePicker;
|
|||
using Object = Java.Lang.Object;
|
||||
using Orientation = Android.Widget.Orientation;
|
||||
using Android.Content;
|
||||
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
|
||||
|
||||
namespace Xamarin.Forms.Platform.Android
|
||||
{
|
||||
|
@ -62,7 +63,10 @@ namespace Xamarin.Forms.Platform.Android
|
|||
{
|
||||
var textField = CreateNativeControl();
|
||||
textField.SetOnClickListener(PickerListener.Instance);
|
||||
_textColorSwitcher = new TextColorSwitcher(textField.TextColors);
|
||||
|
||||
var useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
_textColorSwitcher = new TextColorSwitcher(textField.TextColors, useLegacyColorManagement);
|
||||
|
||||
SetNativeControl(textField);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,9 +15,9 @@ namespace Xamarin.Forms.Platform.Android
|
|||
public class SearchBarRenderer : ViewRenderer<SearchBar, SearchView>, SearchView.IOnQueryTextListener
|
||||
{
|
||||
EditText _editText;
|
||||
ColorStateList _hintTextColorDefault;
|
||||
InputTypes _inputType;
|
||||
ColorStateList _textColorDefault;
|
||||
TextColorSwitcher _textColorSwitcher;
|
||||
TextColorSwitcher _hintColorSwitcher;
|
||||
|
||||
public SearchBarRenderer(Context context) : base(context)
|
||||
{
|
||||
|
@ -63,6 +63,15 @@ namespace Xamarin.Forms.Platform.Android
|
|||
searchView.SetIconifiedByDefault(false);
|
||||
searchView.Iconified = false;
|
||||
SetNativeControl(searchView);
|
||||
_editText = _editText ?? Control.GetChildrenOfType<EditText>().FirstOrDefault();
|
||||
|
||||
if (_editText != null)
|
||||
{
|
||||
var useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
_textColorSwitcher = new TextColorSwitcher(_editText.TextColors, useLegacyColorManagement);
|
||||
_hintColorSwitcher = new TextColorSwitcher(_editText.HintTextColors, useLegacyColorManagement);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BuildVersionCodes androidVersion = Build.VERSION.SdkInt;
|
||||
|
@ -163,6 +172,11 @@ namespace Xamarin.Forms.Platform.Android
|
|||
}
|
||||
else
|
||||
control.SetInputType(_inputType);
|
||||
|
||||
if (_editText != null)
|
||||
{
|
||||
_editText.Enabled = model.IsEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
void ClearFocus(SearchView view)
|
||||
|
@ -195,32 +209,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
void UpdatePlaceholderColor()
|
||||
{
|
||||
_editText = _editText ?? Control.GetChildrenOfType<EditText>().FirstOrDefault();
|
||||
|
||||
if (_editText == null)
|
||||
return;
|
||||
|
||||
Color placeholderColor = Element.PlaceholderColor;
|
||||
|
||||
if (placeholderColor.IsDefault)
|
||||
{
|
||||
if (_hintTextColorDefault == null)
|
||||
{
|
||||
// This control has always had the default colors; nothing to update
|
||||
return;
|
||||
}
|
||||
|
||||
// This control is being set back to the default colors
|
||||
_editText.SetHintTextColor(_hintTextColorDefault);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Keep track of the default colors so we can return to them later
|
||||
// and so we can preserve the default disabled color
|
||||
_hintTextColorDefault = _hintTextColorDefault ?? _editText.HintTextColors;
|
||||
|
||||
_editText.SetHintTextColor(placeholderColor.ToAndroidPreserveDisabled(_hintTextColorDefault));
|
||||
}
|
||||
_hintColorSwitcher?.UpdateTextColor(_editText, Element.PlaceholderColor, _editText.SetHintTextColor);
|
||||
}
|
||||
|
||||
void UpdateText()
|
||||
|
@ -232,32 +221,7 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
void UpdateTextColor()
|
||||
{
|
||||
_editText = _editText ?? Control.GetChildrenOfType<EditText>().FirstOrDefault();
|
||||
|
||||
if (_editText == null)
|
||||
return;
|
||||
|
||||
Color textColor = Element.TextColor;
|
||||
|
||||
if (textColor.IsDefault)
|
||||
{
|
||||
if (_textColorDefault == null)
|
||||
{
|
||||
// This control has always had the default colors; nothing to update
|
||||
return;
|
||||
}
|
||||
|
||||
// This control is being set back to the default colors
|
||||
_editText.SetTextColor(_textColorDefault);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Keep track of the default colors so we can return to them later
|
||||
// and so we can preserve the default disabled color
|
||||
_textColorDefault = _textColorDefault ?? _editText.TextColors;
|
||||
|
||||
_editText.SetTextColor(textColor.ToAndroidPreserveDisabled(_textColorDefault));
|
||||
}
|
||||
_textColorSwitcher?.UpdateTextColor(_editText, Element.TextColor);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@ using ADatePicker = Android.Widget.DatePicker;
|
|||
using ATimePicker = Android.Widget.TimePicker;
|
||||
using Object = Java.Lang.Object;
|
||||
using Android.OS;
|
||||
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
|
||||
|
||||
namespace Xamarin.Forms.Platform.Android
|
||||
{
|
||||
|
@ -61,7 +62,10 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
textField.SetOnClickListener(TimePickerListener.Instance);
|
||||
SetNativeControl(textField);
|
||||
_textColorSwitcher = new TextColorSwitcher(textField.TextColors);
|
||||
|
||||
var useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
_textColorSwitcher = new TextColorSwitcher(textField.TextColors, useLegacyColorManagement);
|
||||
|
||||
_is24HourFormat = DateFormat.Is24HourFormat(Context);
|
||||
_timeFormat = _is24HourFormat ? "HH:mm" : Element.Format;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using Android.Content.Res;
|
||||
using Android.Widget;
|
||||
|
||||
|
@ -5,36 +6,52 @@ namespace Xamarin.Forms.Platform.Android
|
|||
{
|
||||
/// <summary>
|
||||
/// Handles color state management for the TextColor property
|
||||
/// for Button, Picker, TimePicker, and DatePicker
|
||||
/// for Entry, Button, Picker, TimePicker, and DatePicker
|
||||
/// </summary>
|
||||
internal class TextColorSwitcher
|
||||
{
|
||||
static readonly int[][] s_colorStates = { new[] { global::Android.Resource.Attribute.StateEnabled }, new[] { -global::Android.Resource.Attribute.StateEnabled } };
|
||||
|
||||
readonly ColorStateList _defaultTextColors;
|
||||
readonly bool _useLegacyColorManagement;
|
||||
Color _currentTextColor;
|
||||
|
||||
public TextColorSwitcher(ColorStateList textColors)
|
||||
public TextColorSwitcher(ColorStateList textColors, bool useLegacyColorManagement = true)
|
||||
{
|
||||
_defaultTextColors = textColors;
|
||||
_useLegacyColorManagement = useLegacyColorManagement;
|
||||
}
|
||||
|
||||
public void UpdateTextColor(TextView control, Color color)
|
||||
public void UpdateTextColor(TextView control, Color color, Action<ColorStateList> setColor = null)
|
||||
{
|
||||
if (color == _currentTextColor)
|
||||
return;
|
||||
|
||||
if (setColor == null)
|
||||
{
|
||||
setColor = control.SetTextColor;
|
||||
}
|
||||
|
||||
_currentTextColor = color;
|
||||
|
||||
if (color.IsDefault)
|
||||
control.SetTextColor(_defaultTextColors);
|
||||
{
|
||||
setColor(_defaultTextColors);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_useLegacyColorManagement)
|
||||
{
|
||||
// Set the new enabled state color, preserving the default disabled state color
|
||||
int defaultDisabledColor = _defaultTextColors.GetColorForState(s_colorStates[1], color.ToAndroid());
|
||||
control.SetTextColor(new ColorStateList(s_colorStates, new[] { color.ToAndroid().ToArgb(), defaultDisabledColor }));
|
||||
setColor(new ColorStateList(s_colorStates, new[] { color.ToAndroid().ToArgb(), defaultDisabledColor }));
|
||||
}
|
||||
else
|
||||
{
|
||||
var acolor = color.ToAndroid().ToArgb();
|
||||
setColor(new ColorStateList(s_colorStates, new[] { acolor, acolor }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
|
||||
|
||||
namespace Xamarin.Forms.Platform.Android
|
||||
{
|
||||
|
@ -13,5 +14,13 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
return renderer;
|
||||
}
|
||||
|
||||
internal static bool UseLegacyColorManagement<T>(this T element) where T : VisualElement, IElementConfiguration<T>
|
||||
{
|
||||
// Determine whether we're letting the VSM handle the colors or doing it the old way
|
||||
// or disabling the legacy color management and doing it the old-old (pre 2.0) way
|
||||
return !element.HasVisualStateGroups()
|
||||
&& element.OnThisPlatform().GetIsLegacyColorModeEnabled();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -204,6 +204,38 @@
|
|||
</Style>
|
||||
</Grid.Resources>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="FormsManaged">
|
||||
<!-- These "Forms" prefixed states exist to support the Forms VSM; once custom
|
||||
visual state managers are working correctly for TextBox, we'll be able to remove them
|
||||
(see notes in FormsVisualStateManager.cs) -->
|
||||
<VisualState x:Name="FormsNormal" />
|
||||
<VisualState x:Name="FormsDisabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
|
||||
Storyboard.TargetName="HeaderContentPresenter">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
|
||||
Storyboard.TargetName="BackgroundElement">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{Binding Background, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BorderElement">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{Binding Foreground, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
|
||||
Storyboard.TargetName="PlaceholderTextContentPresenter">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForegroundBrush, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
|
|
|
@ -25,10 +25,17 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
if (Control == null)
|
||||
{
|
||||
var button = new FormsButton();
|
||||
|
||||
button.Click += OnButtonClick;
|
||||
button.AddHandler(PointerPressedEvent, new PointerEventHandler(OnPointerPressed), true);
|
||||
button.Loaded += ButtonOnLoaded;
|
||||
|
||||
SetNativeControl(button);
|
||||
}
|
||||
else
|
||||
{
|
||||
WireUpFormsVsm();
|
||||
}
|
||||
|
||||
UpdateContent();
|
||||
|
||||
|
@ -51,6 +58,19 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
}
|
||||
}
|
||||
|
||||
void ButtonOnLoaded(object o, RoutedEventArgs routedEventArgs)
|
||||
{
|
||||
WireUpFormsVsm();
|
||||
}
|
||||
|
||||
void WireUpFormsVsm()
|
||||
{
|
||||
if (Element.UseFormsVsm())
|
||||
{
|
||||
InterceptVisualStateManager.Hook(Control.GetFirstDescendant<Windows.UI.Xaml.Controls.Grid>(), Control, Element);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
base.OnElementPropertyChanged(sender, e);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Windows.UI.Xaml.Media;
|
||||
using System.Drawing;
|
||||
using Windows.UI.Xaml.Media;
|
||||
|
||||
namespace Xamarin.Forms.Platform.UWP
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Media;
|
||||
|
@ -35,6 +36,10 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
Control.Loaded += ControlOnLoaded;
|
||||
Control.DateChanged += OnControlDateChanged;
|
||||
}
|
||||
else
|
||||
{
|
||||
WireUpFormsVsm();
|
||||
}
|
||||
|
||||
UpdateMinimumDate();
|
||||
UpdateMaximumDate();
|
||||
|
@ -47,6 +52,8 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
|
||||
void ControlOnLoaded(object sender, RoutedEventArgs routedEventArgs)
|
||||
{
|
||||
WireUpFormsVsm();
|
||||
|
||||
// The defaults from the control template won't be available
|
||||
// right away; we have to wait until after the template has been applied
|
||||
_defaultBrush = Control.Foreground;
|
||||
|
@ -55,6 +62,20 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
UpdateTextColor();
|
||||
}
|
||||
|
||||
void WireUpFormsVsm()
|
||||
{
|
||||
if (!Element.UseFormsVsm())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
InterceptVisualStateManager.Hook(Control.GetFirstDescendant<StackPanel>(), Control, Element);
|
||||
|
||||
// We also have to intercept the VSM changes on the DatePicker's button
|
||||
var button = Control.GetDescendantsByName<Windows.UI.Xaml.Controls.Button>("FlyoutButton").FirstOrDefault();
|
||||
InterceptVisualStateManager.Hook(button.GetFirstDescendant<Windows.UI.Xaml.Controls.Grid>(), button, Element);
|
||||
}
|
||||
|
||||
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
base.OnElementPropertyChanged(sender, e);
|
||||
|
|
|
@ -3,6 +3,7 @@ using Windows.UI.Xaml;
|
|||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Xamarin.Forms.Internals;
|
||||
using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;
|
||||
|
||||
namespace Xamarin.Forms.Platform.UWP
|
||||
{
|
||||
|
@ -32,6 +33,11 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
|
||||
textBox.TextChanged += OnNativeTextChanged;
|
||||
textBox.LostFocus += OnLostFocus;
|
||||
|
||||
// If the Forms VisualStateManager is in play or the user wants to disable the Forms legacy
|
||||
// color stuff, then the underlying textbox should just use the Forms VSM states
|
||||
textBox.UseFormsVsm = e.NewElement.HasVisualStateGroups()
|
||||
|| !e.NewElement.OnThisPlatform().GetIsLegacyColorModeEnabled();
|
||||
}
|
||||
|
||||
UpdateText();
|
||||
|
|
|
@ -3,8 +3,7 @@ using Windows.System;
|
|||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Xamarin.Forms.Internals;
|
||||
|
||||
|
||||
using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;
|
||||
|
||||
namespace Xamarin.Forms.Platform.UWP
|
||||
{
|
||||
|
@ -26,10 +25,15 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
if (Control == null)
|
||||
{
|
||||
var textBox = new FormsTextBox { Style = Windows.UI.Xaml.Application.Current.Resources["FormsTextBoxStyle"] as Windows.UI.Xaml.Style };
|
||||
SetNativeControl(textBox);
|
||||
|
||||
SetNativeControl(textBox);
|
||||
textBox.TextChanged += OnNativeTextChanged;
|
||||
textBox.KeyUp += TextBoxOnKeyUp;
|
||||
|
||||
// If the Forms VisualStateManager is in play or the user wants to disable the Forms legacy
|
||||
// color stuff, then the underlying textbox should just use the Forms VSM states
|
||||
textBox.UseFormsVsm = e.NewElement.HasVisualStateGroups()
|
||||
|| !e.NewElement.OnThisPlatform().GetIsLegacyColorModeEnabled();
|
||||
}
|
||||
|
||||
UpdateIsPassword();
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Media.Animation;
|
||||
using WVisualState = Windows.UI.Xaml.VisualState;
|
||||
|
||||
namespace Xamarin.Forms.Platform.UWP
|
||||
{
|
||||
|
@ -23,14 +24,14 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
// into the opening and closing animations so it can handle them smoothly
|
||||
// and measure at the appropriate times
|
||||
|
||||
var openedState = GetTemplateChild("Opened") as VisualState;
|
||||
var openedState = GetTemplateChild("Opened") as WVisualState;
|
||||
if (openedState != null)
|
||||
{
|
||||
openedState.Storyboard.Completed += (sender, o) => OnOpenAnimationCompleted();
|
||||
IsOpeningAnimated = true;
|
||||
}
|
||||
|
||||
var closedState = GetTemplateChild("Closed") as VisualState;
|
||||
var closedState = GetTemplateChild("Closed") as WVisualState;
|
||||
|
||||
// On the phone, this is a dummy animation we've added to the closed state in the VSM
|
||||
// Since it finishes immediately, we can use its Completed event to signal that the
|
||||
|
|
|
@ -7,6 +7,7 @@ using Windows.UI.Xaml;
|
|||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using WVisualStateManager = Windows.UI.Xaml.VisualStateManager;
|
||||
|
||||
namespace Xamarin.Forms.Platform.UWP
|
||||
{
|
||||
|
@ -40,7 +41,7 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
public new static readonly DependencyProperty TextProperty = DependencyProperty.Register(nameof(Text),
|
||||
typeof(string), typeof(FormsTextBox), new PropertyMetadata("", TextPropertyChanged));
|
||||
|
||||
InputScope passwordInputScope;
|
||||
InputScope _passwordInputScope;
|
||||
Border _borderElement;
|
||||
InputScope _cachedInputScope;
|
||||
bool _cachedPredictionsSetting;
|
||||
|
@ -53,6 +54,12 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
{
|
||||
TextChanged += OnTextChanged;
|
||||
SelectionChanged += OnSelectionChanged;
|
||||
IsEnabledChanged += OnIsEnabledChanged;
|
||||
}
|
||||
|
||||
void OnIsEnabledChanged(object sender, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
|
||||
{
|
||||
UpdateEnabled();
|
||||
}
|
||||
|
||||
public Brush BackgroundFocusBrush
|
||||
|
@ -73,6 +80,8 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
set { SetValue(IsPasswordProperty, value); }
|
||||
}
|
||||
|
||||
internal bool UseFormsVsm { get; set; }
|
||||
|
||||
public Brush PlaceholderForegroundBrush
|
||||
{
|
||||
get { return (Brush)GetValue(PlaceholderForegroundBrushProperty); }
|
||||
|
@ -95,16 +104,16 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
{
|
||||
get
|
||||
{
|
||||
if (passwordInputScope != null)
|
||||
if (_passwordInputScope != null)
|
||||
{
|
||||
return passwordInputScope;
|
||||
return _passwordInputScope;
|
||||
}
|
||||
|
||||
passwordInputScope = new InputScope();
|
||||
_passwordInputScope = new InputScope();
|
||||
var name = new InputScopeName { NameValue = InputScopeNameValue.Default };
|
||||
passwordInputScope.Names.Add(name);
|
||||
_passwordInputScope.Names.Add(name);
|
||||
|
||||
return passwordInputScope;
|
||||
return _passwordInputScope;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -369,13 +378,21 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
// when the Windows.UI.XAML.VisualStateManager moves to the "Focused" state. So we have to force a
|
||||
// "refresh" of the Focused state by going to that state again
|
||||
|
||||
var control = dependencyObject as Control;
|
||||
if (control == null || control.FocusState == FocusState.Unfocused)
|
||||
if (!(dependencyObject is Control control) || control.FocusState == FocusState.Unfocused)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
VisualStateManager.GoToState(control, "Focused", false);
|
||||
WVisualStateManager.GoToState(control, "Focused", false);
|
||||
}
|
||||
|
||||
internal void UpdateEnabled()
|
||||
{
|
||||
if (UseFormsVsm)
|
||||
{
|
||||
var state = IsEnabled ? "FormsNormal" : "FormsDisabled";
|
||||
WVisualStateManager.GoToState(this, state, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -84,6 +84,39 @@
|
|||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
|
||||
<VisualStateGroup x:Name="FormsManaged">
|
||||
<!-- These "Forms" prefixed states exist to support the Forms VSM; once custom
|
||||
visual state managers are working correctly for TextBox, we'll be able to remove them
|
||||
(see notes in FormsVisualStateManager.cs) -->
|
||||
<VisualState x:Name="FormsNormal" />
|
||||
<VisualState x:Name="FormsDisabled">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
|
||||
Storyboard.TargetName="HeaderContentPresenter">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"
|
||||
Storyboard.TargetName="BackgroundElement">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{Binding Background, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BorderElement">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{Binding Foreground, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"
|
||||
Storyboard.TargetName="PlaceholderTextContentPresenter">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForegroundBrush, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Disabled">
|
||||
<Storyboard>
|
||||
|
|
|
@ -0,0 +1,115 @@
|
|||
using System;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Xamarin.Forms.Platform.UWP
|
||||
{
|
||||
internal class InterceptVisualStateManager : Windows.UI.Xaml.VisualStateManager
|
||||
{
|
||||
static InterceptVisualStateManager s_instance;
|
||||
|
||||
public static readonly DependencyProperty FormsElementProperty = DependencyProperty.RegisterAttached(
|
||||
"FormsElement", typeof(VisualElement), typeof(Control), new PropertyMetadata(null));
|
||||
|
||||
public static void SetFormsElement(Control frameworkElement, VisualElement value)
|
||||
{
|
||||
frameworkElement.SetValue(FormsElementProperty, value);
|
||||
}
|
||||
|
||||
public static VisualElement GetFormsElement(Control frameworkElement)
|
||||
{
|
||||
return (VisualElement)frameworkElement.GetValue(FormsElementProperty);
|
||||
}
|
||||
|
||||
internal static InterceptVisualStateManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
s_instance = s_instance ?? new InterceptVisualStateManager();
|
||||
return s_instance;
|
||||
}
|
||||
}
|
||||
|
||||
// For most of the UWP controls, this custom VisualStateManager is injected to prevent the default Windows
|
||||
// VSM from handling states which the Forms VSM is already managing.
|
||||
// The exception are the controls which are built on TextBox (SearchBar, Entry, Editor); there's a UWP
|
||||
// bug wherein the GoToStateCore override for those controls is never called (Item 10976357 in VSTS)
|
||||
// So until that's resolved, the FormsTextBox control is doing that work as best it can.
|
||||
|
||||
protected override bool GoToStateCore(Control control, FrameworkElement templateRoot, string stateName,
|
||||
Windows.UI.Xaml.VisualStateGroup @group, Windows.UI.Xaml.VisualState state, bool useTransitions)
|
||||
{
|
||||
// If this custom VSM is in play, it's because the control is using the Forms VSM or the user has disabled
|
||||
// legacy color handling. Either way, we may need to prevent the Windows VSM from transitioning to the new
|
||||
// state. So we intercept the transition here.
|
||||
|
||||
if (ShouldIntercept(control, state, stateName))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.GoToStateCore(control, templateRoot, stateName, @group, state, useTransitions);
|
||||
}
|
||||
|
||||
static bool ShouldIntercept(Control control, Windows.UI.Xaml.VisualState state, string stateName)
|
||||
{
|
||||
if (state == null || state.Name == "Normal")
|
||||
{
|
||||
// We don't intercept the "Normal" state, that's the base state onto which Forms applies properties
|
||||
return false;
|
||||
}
|
||||
|
||||
// Retrieve the VisualElement we're managing states for
|
||||
var visualElement = GetFormsElement(control);
|
||||
|
||||
if (visualElement == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Retrieve the set of VisualStateGroups for the VisualElement
|
||||
var groups = VisualStateManager.GetVisualStateGroups(visualElement);
|
||||
|
||||
if (groups == null)
|
||||
{
|
||||
// No groups?
|
||||
// Then the user disabled legacy color management through the platform specific, not by using the XFVSM
|
||||
// So our ignored states lists is effectively "Disabled" and "Focused"
|
||||
if (state.Name == "Disabled" || state.Name == "Focused")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check the states the XFVSM is managing
|
||||
foreach (VisualStateGroup vsg in groups)
|
||||
{
|
||||
foreach (VisualState vs in vsg.States)
|
||||
{
|
||||
if (vs.Name == stateName)
|
||||
{
|
||||
// The XFVSM is already handling this state, so don't let the Windows VSM do it
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
internal static void Hook(FrameworkElement rootElement, Control control, VisualElement visualElement)
|
||||
{
|
||||
if (rootElement == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Set this as the custom VSM for that root element,
|
||||
// and associate the VisualElement with this UWP Control
|
||||
SetCustomVisualStateManager(rootElement, Instance);
|
||||
SetFormsElement(control, visualElement);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -48,6 +48,10 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
Control.ClosedAnimationStarted += ControlOnClosedAnimationStarted;
|
||||
Control.Loaded += ControlOnLoaded;
|
||||
}
|
||||
else
|
||||
{
|
||||
WireUpFormsVsm();
|
||||
}
|
||||
|
||||
Control.ItemsSource = ((LockableObservableListWrapper)Element.Items)._list;
|
||||
|
||||
|
@ -74,6 +78,8 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
|
||||
void ControlOnLoaded(object sender, RoutedEventArgs routedEventArgs)
|
||||
{
|
||||
WireUpFormsVsm();
|
||||
|
||||
// The defaults from the control template won't be available
|
||||
// right away; we have to wait until after the template has been applied
|
||||
_defaultBrush = Control.Foreground;
|
||||
|
@ -82,6 +88,14 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
UpdateTextColor();
|
||||
}
|
||||
|
||||
void WireUpFormsVsm()
|
||||
{
|
||||
if (Element.UseFormsVsm())
|
||||
{
|
||||
InterceptVisualStateManager.Hook(Control.GetFirstDescendant<Windows.UI.Xaml.Controls.Grid>(), Control, Element);
|
||||
}
|
||||
}
|
||||
|
||||
void ControlOnClosedAnimationStarted(object sender, EventArgs eventArgs)
|
||||
{
|
||||
if (!Control.IsFullScreen)
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
using System.ComponentModel;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;
|
||||
using WVisualStateManager = Windows.UI.Xaml.VisualStateManager;
|
||||
|
||||
namespace Xamarin.Forms.Platform.UWP
|
||||
{
|
||||
|
@ -74,6 +77,12 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
UpdateAlignment();
|
||||
UpdateTextColor();
|
||||
UpdatePlaceholderColor();
|
||||
UpdateBackgroundColor();
|
||||
|
||||
// If the Forms VisualStateManager is in play or the user wants to disable the Forms legacy
|
||||
// color stuff, then the underlying textbox should just use the Forms VSM states
|
||||
_queryTextBox.UseFormsVsm = Element.HasVisualStateGroups()
|
||||
|| !Element.OnThisPlatform().GetIsLegacyColorModeEnabled();
|
||||
}
|
||||
|
||||
void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs e)
|
||||
|
@ -183,5 +192,22 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
BrushHelpers.UpdateColor(textColor, ref _defaultTextColorFocusBrush,
|
||||
() => _queryTextBox.ForegroundFocusBrush, brush => _queryTextBox.ForegroundFocusBrush = brush);
|
||||
}
|
||||
|
||||
protected override void UpdateBackgroundColor()
|
||||
{
|
||||
if (_queryTextBox == null)
|
||||
return;
|
||||
|
||||
Color backgroundColor = Element.BackgroundColor;
|
||||
|
||||
if (!backgroundColor.IsDefault)
|
||||
{
|
||||
_queryTextBox.Background = backgroundColor.ToBrush();
|
||||
}
|
||||
else
|
||||
{
|
||||
_queryTextBox.ClearValue(Windows.UI.Xaml.Controls.Control.BackgroundProperty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using WVisualStateManager = Windows.UI.Xaml.VisualStateManager;
|
||||
using WVisualStateGroup = Windows.UI.Xaml.VisualStateGroup;
|
||||
using WVisualState = Windows.UI.Xaml.VisualState;
|
||||
|
||||
namespace Xamarin.Forms.Platform.UWP
|
||||
{
|
||||
|
@ -121,14 +125,14 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
if (VisualTreeHelper.GetChildrenCount(control) == 0)
|
||||
control.ApplyTemplate();
|
||||
|
||||
VisualStateManager.GoToState(control, "Disabled", true);
|
||||
WVisualStateManager.GoToState(control, "Disabled", true);
|
||||
|
||||
var rootElement = (FrameworkElement)VisualTreeHelper.GetChild(control, 0);
|
||||
|
||||
var cache = new VisualStateCache();
|
||||
IList<VisualStateGroup> groups = VisualStateManager.GetVisualStateGroups(rootElement);
|
||||
IList<WVisualStateGroup> groups = WVisualStateManager.GetVisualStateGroups(rootElement);
|
||||
|
||||
VisualStateGroup common = null;
|
||||
WVisualStateGroup common = null;
|
||||
foreach (var group in groups)
|
||||
{
|
||||
if (group.Name == "CommonStates")
|
||||
|
@ -144,7 +148,7 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
|
||||
if (common != null)
|
||||
{
|
||||
foreach (VisualState state in common.States)
|
||||
foreach (WVisualState state in common.States)
|
||||
{
|
||||
if (state.Name == "Normal")
|
||||
cache.Normal = state;
|
||||
|
@ -183,7 +187,7 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
|
||||
var rootElement = (FrameworkElement)VisualTreeHelper.GetChild(control, 0);
|
||||
|
||||
IList<VisualStateGroup> groups = VisualStateManager.GetVisualStateGroups(rootElement);
|
||||
IList<WVisualStateGroup> groups = WVisualStateManager.GetVisualStateGroups(rootElement);
|
||||
|
||||
if (cache.FocusStates != null)
|
||||
groups.Add(cache.FocusStates);
|
||||
|
@ -199,7 +203,7 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
if (cache.PointerOver != null)
|
||||
commonStates.States.Add(cache.PointerOver);
|
||||
|
||||
VisualStateManager.GoToState(control, "Normal", true);
|
||||
WVisualStateManager.GoToState(control, "Normal", true);
|
||||
|
||||
cache = null;
|
||||
}
|
||||
|
@ -246,8 +250,8 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
|
||||
class VisualStateCache
|
||||
{
|
||||
public VisualStateGroup FocusStates;
|
||||
public VisualState Normal, PointerOver, Pressed;
|
||||
public WVisualStateGroup FocusStates;
|
||||
public WVisualState Normal, PointerOver, Pressed;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Media;
|
||||
|
@ -33,11 +34,16 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
if (Control == null)
|
||||
{
|
||||
var picker = new Windows.UI.Xaml.Controls.TimePicker();
|
||||
|
||||
SetNativeControl(picker);
|
||||
|
||||
Control.TimeChanged += OnControlTimeChanged;
|
||||
Control.Loaded += ControlOnLoaded;
|
||||
}
|
||||
else
|
||||
{
|
||||
WireUpFormsVsm();
|
||||
}
|
||||
|
||||
UpdateTime();
|
||||
UpdateFlowDirection();
|
||||
|
@ -46,6 +52,8 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
|
||||
void ControlOnLoaded(object sender, RoutedEventArgs routedEventArgs)
|
||||
{
|
||||
WireUpFormsVsm();
|
||||
|
||||
// The defaults from the control template won't be available
|
||||
// right away; we have to wait until after the template has been applied
|
||||
_defaultBrush = Control.Foreground;
|
||||
|
@ -54,6 +62,20 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
UpdateTextColor();
|
||||
}
|
||||
|
||||
void WireUpFormsVsm()
|
||||
{
|
||||
if (!Element.UseFormsVsm())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
InterceptVisualStateManager.Hook(Control.GetFirstDescendant<StackPanel>(), Control, Element);
|
||||
|
||||
// We also have to intercept the VSM changes on the TimePicker's button
|
||||
var button = Control.GetDescendantsByName<Windows.UI.Xaml.Controls.Button>("FlyoutButton").FirstOrDefault();
|
||||
InterceptVisualStateManager.Hook(button.GetFirstDescendant<Windows.UI.Xaml.Controls.Grid>(), button, Element);
|
||||
}
|
||||
|
||||
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
base.OnElementPropertyChanged(sender, e);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;
|
||||
|
||||
namespace Xamarin.Forms.Platform.UWP
|
||||
{
|
||||
|
@ -48,5 +49,13 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
Platform.SetRenderer(self, null);
|
||||
}
|
||||
}
|
||||
|
||||
internal static bool UseFormsVsm<T>(this T element) where T : VisualElement, IElementConfiguration<T>
|
||||
{
|
||||
// Determine whether we're letting the VSM handle the colors or doing it the old way
|
||||
// or disabling the legacy color management and doing it the old-old (pre 2.0) way
|
||||
return element.HasVisualStateGroups()
|
||||
|| !element.OnThisPlatform().GetIsLegacyColorModeEnabled();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -128,6 +128,7 @@
|
|||
<Compile Include="FormsProgressBar.cs" />
|
||||
<Compile Include="FormsTextBox.cs" />
|
||||
<Compile Include="FormsComboBox.cs" />
|
||||
<Compile Include="InterceptVisualStateManager.cs" />
|
||||
<Compile Include="HorizontalTextAlignmentConverter.cs" />
|
||||
<Compile Include="ITitleProvider.cs" />
|
||||
<Compile Include="IToolbarProvider.cs" />
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
|
||||
|
||||
namespace Xamarin.Forms.Platform.iOS
|
||||
{
|
||||
internal static class VisualElementExtensions
|
||||
{
|
||||
internal static bool UseLegacyColorManagement<T>(this T element) where T : VisualElement, IElementConfiguration<T>
|
||||
{
|
||||
// Determine whether we're letting the VSM handle the colors or doing it the old way
|
||||
// or disabling the legacy color management and doing it the old-old (pre 2.0) way
|
||||
return !element.HasVisualStateGroups()
|
||||
&& element.OnThisPlatform().GetIsLegacyColorModeEnabled();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@ using System.Diagnostics;
|
|||
using System.Linq;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
|
||||
using SizeF = CoreGraphics.CGSize;
|
||||
|
||||
namespace Xamarin.Forms.Platform.iOS
|
||||
|
@ -13,6 +14,7 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
UIColor _buttonTextColorDefaultDisabled;
|
||||
UIColor _buttonTextColorDefaultHighlighted;
|
||||
UIColor _buttonTextColorDefaultNormal;
|
||||
bool _useLegacyColorManagement;
|
||||
bool _titleChanged;
|
||||
SizeF _titleSize;
|
||||
|
||||
|
@ -62,6 +64,8 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
SetControlPropertiesFromProxy();
|
||||
|
||||
_useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
|
||||
_buttonTextColorDefaultNormal = Control.TitleColor(UIControlState.Normal);
|
||||
_buttonTextColorDefaultHighlighted = Control.TitleColor(UIControlState.Highlighted);
|
||||
_buttonTextColorDefaultDisabled = Control.TitleColor(UIControlState.Disabled);
|
||||
|
@ -206,11 +210,13 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
}
|
||||
else
|
||||
{
|
||||
Control.SetTitleColor(Element.TextColor.ToUIColor(), UIControlState.Normal);
|
||||
Control.SetTitleColor(Element.TextColor.ToUIColor(), UIControlState.Highlighted);
|
||||
Control.SetTitleColor(_buttonTextColorDefaultDisabled, UIControlState.Disabled);
|
||||
var color = Element.TextColor.ToUIColor();
|
||||
|
||||
Control.TintColor = Element.TextColor.ToUIColor();
|
||||
Control.SetTitleColor(color, UIControlState.Normal);
|
||||
Control.SetTitleColor(color, UIControlState.Highlighted);
|
||||
Control.SetTitleColor(_useLegacyColorManagement ? _buttonTextColorDefaultDisabled : color, UIControlState.Disabled);
|
||||
|
||||
Control.TintColor = color;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.ComponentModel;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
|
||||
using RectangleF = CoreGraphics.CGRect;
|
||||
|
||||
namespace Xamarin.Forms.Platform.iOS
|
||||
|
@ -23,6 +24,7 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
UIDatePicker _picker;
|
||||
UIColor _defaultTextColor;
|
||||
bool _disposed;
|
||||
bool _useLegacyColorManagement;
|
||||
|
||||
IElementController ElementController => Element as IElementController;
|
||||
|
||||
|
@ -56,6 +58,8 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
_defaultTextColor = entry.TextColor;
|
||||
|
||||
_useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
|
||||
SetNativeControl(entry);
|
||||
}
|
||||
|
||||
|
@ -132,10 +136,13 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
{
|
||||
var textColor = Element.TextColor;
|
||||
|
||||
if (textColor.IsDefault || !Element.IsEnabled)
|
||||
if (textColor.IsDefault || (!Element.IsEnabled && _useLegacyColorManagement))
|
||||
Control.TextColor = _defaultTextColor;
|
||||
else
|
||||
Control.TextColor = textColor.ToUIColor();
|
||||
|
||||
// HACK This forces the color to update; there's probably a more elegant way to make this happen
|
||||
Control.Text = Control.Text;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
|
|
|
@ -12,6 +12,13 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
public class EntryRenderer : ViewRenderer<Entry, UITextField>
|
||||
{
|
||||
UIColor _defaultTextColor;
|
||||
|
||||
// Placeholder default color is 70% gray
|
||||
// https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UITextField_Class/index.html#//apple_ref/occ/instp/UITextField/placeholder
|
||||
readonly Color _defaultPlaceholderColor = ColorExtensions.SeventyPercentGrey.ToColor();
|
||||
|
||||
bool _useLegacyColorManagement;
|
||||
|
||||
bool _disposed;
|
||||
|
||||
static readonly int baseHeight = 30;
|
||||
|
@ -73,7 +80,11 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
var textField = new UITextField(RectangleF.Empty);
|
||||
SetNativeControl(textField);
|
||||
|
||||
// Cache the default text color
|
||||
_defaultTextColor = textField.TextColor;
|
||||
|
||||
_useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
|
||||
textField.BorderStyle = UITextBorderStyle.RoundedRect;
|
||||
textField.ClipsToBounds = true;
|
||||
|
||||
|
@ -165,10 +176,14 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
{
|
||||
var textColor = Element.TextColor;
|
||||
|
||||
if (textColor.IsDefault || !Element.IsEnabled)
|
||||
Control.TextColor = _defaultTextColor;
|
||||
if (_useLegacyColorManagement)
|
||||
{
|
||||
Control.TextColor = textColor.IsDefault || !Element.IsEnabled ? _defaultTextColor : textColor.ToUIColor();
|
||||
}
|
||||
else
|
||||
Control.TextColor = textColor.ToUIColor();
|
||||
{
|
||||
Control.TextColor = textColor.IsDefault ? _defaultTextColor : textColor.ToUIColor();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAdjustsFontSizeToFitWidth()
|
||||
|
@ -215,13 +230,18 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
var targetColor = Element.PlaceholderColor;
|
||||
|
||||
// Placeholder default color is 70% gray
|
||||
// https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UITextField_Class/index.html#//apple_ref/occ/instp/UITextField/placeholder
|
||||
|
||||
var color = Element.IsEnabled && !targetColor.IsDefault ? targetColor : ColorExtensions.SeventyPercentGrey.ToColor();
|
||||
|
||||
if (_useLegacyColorManagement)
|
||||
{
|
||||
var color = targetColor.IsDefault || !Element.IsEnabled ? _defaultPlaceholderColor : targetColor;
|
||||
Control.AttributedPlaceholder = formatted.ToAttributed(Element, color);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using VSM color management; take whatever is in Element.PlaceholderColor
|
||||
var color = targetColor.IsDefault ? _defaultPlaceholderColor : targetColor;
|
||||
Control.AttributedPlaceholder = formatted.ToAttributed(Element, color);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateText()
|
||||
{
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
UIPickerView _picker;
|
||||
UIColor _defaultTextColor;
|
||||
bool _disposed;
|
||||
bool _useLegacyColorManagement;
|
||||
|
||||
IElementController ElementController => Element as IElementController;
|
||||
|
||||
|
@ -51,6 +52,8 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
_defaultTextColor = entry.TextColor;
|
||||
|
||||
_useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
|
||||
SetNativeControl(entry);
|
||||
}
|
||||
|
||||
|
@ -158,10 +161,13 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
{
|
||||
var textColor = Element.TextColor;
|
||||
|
||||
if (textColor.IsDefault || !Element.IsEnabled)
|
||||
if (textColor.IsDefault || (!Element.IsEnabled && _useLegacyColorManagement))
|
||||
Control.TextColor = _defaultTextColor;
|
||||
else
|
||||
Control.TextColor = textColor.ToUIColor();
|
||||
|
||||
// HACK This forces the color to update; there's probably a more elegant way to make this happen
|
||||
Control.Text = Control.Text;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
|
|
|
@ -16,6 +16,7 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
UITextField _textField;
|
||||
bool _textWasTyped;
|
||||
string _typedText;
|
||||
bool _useLegacyColorManagement;
|
||||
|
||||
IElementController ElementController => Element as IElementController;
|
||||
|
||||
|
@ -52,6 +53,9 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
SetNativeControl(searchBar);
|
||||
|
||||
_textField = _textField ?? Control.FindDescendantView<UITextField>();
|
||||
_useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
|
||||
Control.CancelButtonClicked += OnCancelClicked;
|
||||
Control.SearchButtonClicked += OnSearchButtonClicked;
|
||||
Control.TextChanged += OnTextChanged;
|
||||
|
@ -193,8 +197,16 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
{
|
||||
cancelButton.SetTitleColor(Element.CancelButtonColor.ToUIColor(), UIControlState.Normal);
|
||||
cancelButton.SetTitleColor(Element.CancelButtonColor.ToUIColor(), UIControlState.Highlighted);
|
||||
|
||||
if (_useLegacyColorManagement)
|
||||
{
|
||||
cancelButton.SetTitleColor(_cancelButtonTextColorDefaultDisabled, UIControlState.Disabled);
|
||||
}
|
||||
else
|
||||
{
|
||||
cancelButton.SetTitleColor(Element.CancelButtonColor.ToUIColor(), UIControlState.Disabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateFont()
|
||||
|
@ -214,21 +226,28 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
void UpdatePlaceholder()
|
||||
{
|
||||
_textField = _textField ?? Control.FindDescendantView<UITextField>();
|
||||
|
||||
if (_textField == null)
|
||||
return;
|
||||
|
||||
var formatted = (FormattedString)Element.Placeholder ?? string.Empty;
|
||||
var targetColor = Element.PlaceholderColor;
|
||||
|
||||
if (_useLegacyColorManagement)
|
||||
{
|
||||
// Placeholder default color is 70% gray
|
||||
// https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UITextField_Class/index.html#//apple_ref/occ/instp/UITextField/placeholder
|
||||
|
||||
var color = Element.IsEnabled && !targetColor.IsDefault ? targetColor : ColorExtensions.SeventyPercentGrey.ToColor();
|
||||
var color = Element.IsEnabled && !targetColor.IsDefault
|
||||
? targetColor : ColorExtensions.SeventyPercentGrey.ToColor();
|
||||
|
||||
_textField.AttributedPlaceholder = formatted.ToAttributed(Element, color);
|
||||
}
|
||||
else
|
||||
{
|
||||
_textField.AttributedPlaceholder = formatted.ToAttributed(Element, targetColor.IsDefault
|
||||
? ColorExtensions.SeventyPercentGrey.ToColor() : targetColor);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateText()
|
||||
{
|
||||
|
@ -252,17 +271,21 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
void UpdateTextColor()
|
||||
{
|
||||
_textField = _textField ?? Control.FindDescendantView<UITextField>();
|
||||
|
||||
if (_textField == null)
|
||||
return;
|
||||
|
||||
_defaultTextColor = _defaultTextColor ?? _textField.TextColor;
|
||||
var targetColor = Element.TextColor;
|
||||
|
||||
if (_useLegacyColorManagement)
|
||||
{
|
||||
var color = Element.IsEnabled && !targetColor.IsDefault ? targetColor : _defaultTextColor.ToColor();
|
||||
|
||||
_textField.TextColor = color.ToUIColor();
|
||||
}
|
||||
else
|
||||
{
|
||||
_textField.TextColor = targetColor.IsDefault ? _defaultTextColor : targetColor.ToUIColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
UIDatePicker _picker;
|
||||
UIColor _defaultTextColor;
|
||||
bool _disposed;
|
||||
bool _useLegacyColorManagement;
|
||||
|
||||
IElementController ElementController => Element as IElementController;
|
||||
|
||||
|
@ -68,6 +69,8 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
|
||||
_defaultTextColor = entry.TextColor;
|
||||
|
||||
_useLegacyColorManagement = e.NewElement.UseLegacyColorManagement();
|
||||
|
||||
_picker.ValueChanged += OnValueChanged;
|
||||
|
||||
SetNativeControl(entry);
|
||||
|
@ -126,10 +129,13 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
{
|
||||
var textColor = Element.TextColor;
|
||||
|
||||
if (textColor.IsDefault || !Element.IsEnabled)
|
||||
if (textColor.IsDefault || (!Element.IsEnabled && _useLegacyColorManagement))
|
||||
Control.TextColor = _defaultTextColor;
|
||||
else
|
||||
Control.TextColor = textColor.ToUIColor();
|
||||
|
||||
// HACK This forces the color to update; there's probably a more elegant way to make this happen
|
||||
Control.Text = Control.Text;
|
||||
}
|
||||
|
||||
void UpdateTime()
|
||||
|
|
|
@ -122,6 +122,7 @@
|
|||
<Compile Include="Extensions\ArrayExtensions.cs" />
|
||||
<Compile Include="Extensions\FlowDirectionExtensions.cs" />
|
||||
<Compile Include="Extensions\PlatformConfigurationExtensions.cs" />
|
||||
<Compile Include="Extensions\VisualElementExtensions.cs" />
|
||||
<Compile Include="Flags.cs" />
|
||||
<Compile Include="NativeViewWrapper.cs" />
|
||||
<Compile Include="NativeViewWrapperRenderer.cs" />
|
||||
|
|
|
@ -0,0 +1,119 @@
|
|||
<?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:coll="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
|
||||
x:Class="Xamarin.Forms.Xaml.UnitTests.VisualStateManagerTests">
|
||||
<ContentPage.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style TargetType="Entry" x:Key="CustomDisabledState">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Gray" />
|
||||
<Setter Property="PlaceholderColor" Value="LightGray" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="Other">
|
||||
<VisualState x:Name="Fake">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Gray" />
|
||||
<Setter Property="PlaceholderColor" Value="LightGray" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="Extra">
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Entry" x:Key="OtherStyle">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Default" />
|
||||
<Setter Property="PlaceholderColor" Value="Default" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Label" x:Key="ErrorLabel">
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="IsVisible" Value="False"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Invalid">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="IsVisible" Value="True"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
<Setter Property="TextColor" Value="Red"></Setter>
|
||||
<Setter Property="Margin" Value="2,10,2,10"></Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<StackLayout>
|
||||
<Entry x:Name="Entry0" />
|
||||
<Entry x:Name="Entry1" Style="{StaticResource CustomDisabledState}" />
|
||||
|
||||
<Entry x:Name="Entry2">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="Gray" />
|
||||
<Setter Property="PlaceholderColor" Value="LightGray" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
<VisualStateGroup x:Name="Other">
|
||||
<VisualState x:Name="Fake" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Entry>
|
||||
|
||||
<Entry x:Name="Entry3">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="Empty" />
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Entry>
|
||||
|
||||
<Label x:Name="ErrorLabel1" Style="{StaticResource ErrorLabel}"></Label>
|
||||
<Label x:Name="ErrorLabel2" Style="{StaticResource ErrorLabel}"></Label>
|
||||
|
||||
<Entry x:Name="Entry4" Style="{StaticResource OtherStyle}"></Entry>
|
||||
|
||||
<!-- This entry is here to verify that XamlG and XamlC don't complain about duplicate VisualStateGroup
|
||||
and VisualState names on different VisualElements -->
|
||||
<Entry x:Name="Entry5">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Entry>
|
||||
|
||||
</StackLayout>
|
||||
|
||||
</ContentPage>
|
|
@ -0,0 +1,175 @@
|
|||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using Xamarin.Forms.Core.UnitTests;
|
||||
|
||||
namespace Xamarin.Forms.Xaml.UnitTests
|
||||
{
|
||||
public partial class VisualStateManagerTests : ContentPage
|
||||
{
|
||||
public VisualStateManagerTests()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public VisualStateManagerTests(bool useCompiledXaml)
|
||||
{
|
||||
//this stub will be replaced at compile time
|
||||
}
|
||||
|
||||
[TestFixture]
|
||||
public class Tests
|
||||
{
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
Device.PlatformServices = new MockPlatformServices ();
|
||||
Application.Current = new MockApplication ();
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
Device.PlatformServices = null;
|
||||
Application.Current = null;
|
||||
}
|
||||
|
||||
[TestCase(false)]
|
||||
[TestCase(true)]
|
||||
public void VisualStatesFromStyleXaml(bool useCompiledXaml)
|
||||
{
|
||||
var layout = new VisualStateManagerTests(useCompiledXaml);
|
||||
|
||||
var entry0 = layout.Entry0;
|
||||
|
||||
// Verify that Entry0 has no VisualStateGroups
|
||||
Assert.False(entry0.HasVisualStateGroups());
|
||||
Assert.That(Color.Default, Is.EqualTo(entry0.TextColor));
|
||||
Assert.That(Color.Default, Is.EqualTo(entry0.PlaceholderColor));
|
||||
|
||||
var entry1 = layout.Entry1;
|
||||
|
||||
// Verify that the correct groups are set up for Entry1
|
||||
var groups = VisualStateManager.GetVisualStateGroups(entry1);
|
||||
Assert.AreEqual(3, groups.Count);
|
||||
Assert.That(groups[0].Name, Is.EqualTo("CommonStates"));
|
||||
Assert.Contains("Normal", groups[0].States.Select(state => state.Name).ToList());
|
||||
Assert.Contains("Disabled", groups[0].States.Select(state => state.Name).ToList());
|
||||
|
||||
Assert.AreEqual(Color.Default, entry1.TextColor);
|
||||
Assert.AreEqual(Color.Default, entry1.PlaceholderColor);
|
||||
|
||||
// Change the state of Entry1
|
||||
Assert.True(VisualStateManager.GoToState(entry1, "Disabled"));
|
||||
|
||||
// And verify that the changes took
|
||||
Assert.AreEqual(Color.Gray, entry1.TextColor);
|
||||
Assert.AreEqual(Color.LightGray, entry1.PlaceholderColor);
|
||||
|
||||
// Verify that Entry0 was unaffected
|
||||
Assert.AreEqual(Color.Default, entry0.TextColor);
|
||||
Assert.AreEqual(Color.Default, entry0.PlaceholderColor);
|
||||
}
|
||||
|
||||
[TestCase(false)]
|
||||
[TestCase(true)]
|
||||
public void UnapplyVisualState(bool useCompiledXaml)
|
||||
{
|
||||
var layout = new VisualStateManagerTests(useCompiledXaml);
|
||||
var entry1 = layout.Entry1;
|
||||
|
||||
Assert.AreEqual(Color.Default, entry1.TextColor);
|
||||
Assert.AreEqual(Color.Default, entry1.PlaceholderColor);
|
||||
|
||||
// Change the state of Entry1
|
||||
var groups = VisualStateManager.GetVisualStateGroups(entry1);
|
||||
Assert.True(VisualStateManager.GoToState(entry1, "Disabled"));
|
||||
|
||||
// And verify that the changes took
|
||||
Assert.AreEqual(Color.Gray, entry1.TextColor);
|
||||
Assert.AreEqual(Color.LightGray, entry1.PlaceholderColor);
|
||||
|
||||
// Now change it to Normal
|
||||
Assert.True(VisualStateManager.GoToState(entry1, "Normal"));
|
||||
|
||||
// And verify that the changes reverted
|
||||
Assert.AreEqual(Color.Default, entry1.TextColor);
|
||||
Assert.AreEqual(Color.Default, entry1.PlaceholderColor);
|
||||
}
|
||||
|
||||
[TestCase(false)]
|
||||
[TestCase(true)]
|
||||
public void VisualStateGroupsDirectlyOnElement(bool useCompiledXaml)
|
||||
{
|
||||
var layout = new VisualStateManagerTests(useCompiledXaml);
|
||||
|
||||
var entry = layout.Entry2;
|
||||
|
||||
var groups = VisualStateManager.GetVisualStateGroups(entry);
|
||||
|
||||
Assert.NotNull(groups);
|
||||
Assert.That(groups.Count, Is.EqualTo(2));
|
||||
}
|
||||
|
||||
[TestCase(false)]
|
||||
[TestCase(true)]
|
||||
public void EmptyGroupDirectlyOnElement(bool useCompiledXaml)
|
||||
{
|
||||
var layout = new VisualStateManagerTests(useCompiledXaml);
|
||||
|
||||
var entry3 = layout.Entry3;
|
||||
|
||||
var groups = VisualStateManager.GetVisualStateGroups(entry3);
|
||||
|
||||
Assert.NotNull(groups);
|
||||
Assert.True(groups.Count == 1);
|
||||
}
|
||||
|
||||
[TestCase(false)]
|
||||
[TestCase(true)]
|
||||
public void VisualStateGroupsFromStylesAreDistinct(bool useCompiledXaml)
|
||||
{
|
||||
var layout = new VisualStateManagerTests(useCompiledXaml);
|
||||
|
||||
var label1 = layout.ErrorLabel1;
|
||||
var label2 = layout.ErrorLabel2;
|
||||
|
||||
var groups1 = VisualStateManager.GetVisualStateGroups(label1);
|
||||
var groups2 = VisualStateManager.GetVisualStateGroups(label2);
|
||||
|
||||
Assert.AreNotSame(groups1, groups2);
|
||||
|
||||
var currentState1 = groups1[0].CurrentState;
|
||||
var currentState2 = groups2[0].CurrentState;
|
||||
|
||||
Assert.That(currentState1.Name, Is.EqualTo("Normal"));
|
||||
Assert.That(currentState2.Name, Is.EqualTo("Normal"));
|
||||
|
||||
VisualStateManager.GoToState(label1, "Invalid");
|
||||
|
||||
Assert.That(groups1[0].CurrentState.Name, Is.EqualTo("Invalid"));
|
||||
Assert.That(groups2[0].CurrentState.Name, Is.EqualTo("Normal"));
|
||||
}
|
||||
|
||||
[TestCase(false)]
|
||||
[TestCase(true)]
|
||||
public void SettersAreAddedToCorrectState(bool useCompiledXaml)
|
||||
{
|
||||
var layout = new VisualStateManagerTests(useCompiledXaml);
|
||||
|
||||
var entry = layout.Entry4;
|
||||
|
||||
var groups = VisualStateManager.GetVisualStateGroups(entry);
|
||||
|
||||
Assert.That(groups.Count, Is.EqualTo(1));
|
||||
|
||||
var common = groups[0];
|
||||
|
||||
var normal = common.States.Single(state => state.Name == "Normal");
|
||||
var disabled = common.States.Single(state => state.Name == "Disabled");
|
||||
|
||||
Assert.That(normal.Setters.Count, Is.EqualTo(0));
|
||||
Assert.That(disabled.Setters.Count, Is.EqualTo(2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -119,6 +119,9 @@
|
|||
<Compile Include="OnPlatformTests.cs" />
|
||||
<Compile Include="NullExtensionTests.cs" />
|
||||
<Compile Include="TypeExtensionTests.cs" />
|
||||
<Compile Include="VisualStateManagerTests.xaml.cs">
|
||||
<DependentUpon>VisualStateManagerTests.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="XamlgTests.cs" />
|
||||
<Compile Include="Issues\TestCases.cs" />
|
||||
<Compile Include="Issues\Issue1493.cs" />
|
||||
|
@ -1045,4 +1048,14 @@
|
|||
<Folder Include="css\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
|
||||
<ItemGroup>
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="VisualStateManagerTests.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -42,7 +42,10 @@ namespace Xamarin.Forms.Xaml
|
|||
var value = Values [node];
|
||||
var source = Values [parentNode];
|
||||
XmlName propertyName;
|
||||
|
||||
if (TryGetPropertyName(node, parentNode, out propertyName)) {
|
||||
if (TrySetRuntimeName(propertyName, source, value, node))
|
||||
return;
|
||||
if (Skips.Contains(propertyName))
|
||||
return;
|
||||
if (parentElement.SkipProperties.Contains(propertyName))
|
||||
|
@ -117,6 +120,7 @@ namespace Xamarin.Forms.Xaml
|
|||
if (xpe == null && typeof(IEnumerable).IsAssignableFrom(Context.Types[parentElement]) && Context.Types[parentElement].GetRuntimeMethods().Any(mi => mi.Name == "Add" && mi.GetParameters().Length == 1)) {
|
||||
var addMethod =
|
||||
Context.Types[parentElement].GetRuntimeMethods().First(mi => mi.Name == "Add" && mi.GetParameters().Length == 1);
|
||||
|
||||
addMethod.Invoke(source, new[] { value });
|
||||
return;
|
||||
}
|
||||
|
@ -166,6 +170,8 @@ namespace Xamarin.Forms.Xaml
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Visit(RootNode node, INode parentNode)
|
||||
{
|
||||
}
|
||||
|
@ -250,6 +256,7 @@ namespace Xamarin.Forms.Xaml
|
|||
XamlParseException xpe;
|
||||
elementType = XamlParser.GetElementType(new XmlType(namespaceURI, typename, null), lineInfo,
|
||||
context.RootElement.GetType().GetTypeInfo().Assembly, out xpe);
|
||||
|
||||
if (xpe != null)
|
||||
throw xpe;
|
||||
return true;
|
||||
|
@ -300,7 +307,6 @@ namespace Xamarin.Forms.Xaml
|
|||
Exception xpe = null;
|
||||
var xKey = node is IElementNode && ((IElementNode)node).Properties.ContainsKey(XmlName.xKey) ? ((ValueNode)((IElementNode)node).Properties[XmlName.xKey]).Value as string : null;
|
||||
|
||||
|
||||
//If it's an attached BP, update elementType and propertyName
|
||||
var bpOwnerType = xamlelement.GetType();
|
||||
var attached = GetRealNameAndType(ref bpOwnerType, propertyName.NamespaceURI, ref localName, context, lineInfo);
|
||||
|
@ -330,7 +336,7 @@ namespace Xamarin.Forms.Xaml
|
|||
if (xpe == null && TryAddToProperty(xamlelement, propertyName, value, xKey, lineInfo, serviceProvider, context, out xpe))
|
||||
return;
|
||||
|
||||
xpe = xpe ?? new XamlParseException($"Cannot assign property \"{localName}\": Property does not exists, or is not assignable, or mismatching type between value and property", lineInfo);
|
||||
xpe = xpe ?? new XamlParseException($"Cannot assign property \"{localName}\": Property does not exist, or is not assignable, or mismatching type between value and property", lineInfo);
|
||||
if (context.ExceptionHandler != null)
|
||||
context.ExceptionHandler(xpe);
|
||||
else
|
||||
|
@ -471,7 +477,9 @@ namespace Xamarin.Forms.Xaml
|
|||
bindable.SetValue(property, convertedValue);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
// This might be a collection; see if we can add to it
|
||||
return TryAddValue(bindable, property, value, serviceProvider);
|
||||
}
|
||||
|
||||
if (nativeBindingService != null && nativeBindingService.TrySetValue(element, property, convertedValue))
|
||||
|
@ -569,6 +577,7 @@ namespace Xamarin.Forms.Xaml
|
|||
|
||||
object targetProperty;
|
||||
var collection = GetPropertyValue(element, propertyName, context, lineInfo, out targetProperty) as IEnumerable;
|
||||
|
||||
if (collection == null)
|
||||
return false;
|
||||
|
||||
|
@ -628,5 +637,52 @@ namespace Xamarin.Forms.Xaml
|
|||
return context.Values [cnode];
|
||||
};
|
||||
}
|
||||
|
||||
static bool TryAddValue(BindableObject bindable, BindableProperty property, object value, XamlServiceProvider serviceProvider)
|
||||
{
|
||||
if(property?.ReturnTypeInfo?.GenericTypeArguments == null){
|
||||
return false;
|
||||
}
|
||||
|
||||
if(property.ReturnType == null){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (property.ReturnTypeInfo.GenericTypeArguments.Length != 1 ||
|
||||
!property.ReturnTypeInfo.GenericTypeArguments[0].IsInstanceOfType(value))
|
||||
return false;
|
||||
|
||||
// This might be a collection we can add to; see if we can find an Add method
|
||||
var addMethod = GetAllRuntimeMethods(property.ReturnType)
|
||||
.FirstOrDefault(mi => mi.Name == "Add" && mi.GetParameters().Length == 1);
|
||||
if (addMethod == null)
|
||||
return false;
|
||||
|
||||
// If there's an add method, get the collection
|
||||
var collection = bindable.GetValue(property);
|
||||
|
||||
// And add the new value to it
|
||||
addMethod.Invoke(collection, new[] { value.ConvertTo(addMethod.GetParameters()[0].ParameterType, (Func<TypeConverter>)null, serviceProvider) });
|
||||
return true;
|
||||
}
|
||||
|
||||
static IEnumerable<MethodInfo> GetAllRuntimeMethods(Type type)
|
||||
{
|
||||
return type.GetRuntimeMethods()
|
||||
.Concat(type.GetTypeInfo().ImplementedInterfaces.SelectMany(t => t.GetRuntimeMethods()));
|
||||
}
|
||||
|
||||
bool TrySetRuntimeName(XmlName propertyName, object source, object value, ValueNode node)
|
||||
{
|
||||
if (propertyName != XmlName.xName)
|
||||
return false;
|
||||
|
||||
var runTimeName = source.GetType().GetTypeInfo().GetCustomAttribute<RuntimeNamePropertyAttribute>();
|
||||
if (runTimeName == null)
|
||||
return false;
|
||||
|
||||
SetPropertyValue(source, new XmlName("", runTimeName.Name), value, Context.RootElement, node, Context, node);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,7 +31,7 @@ namespace Xamarin.Forms.Xaml
|
|||
|
||||
public void Visit(ElementNode node, INode parentNode)
|
||||
{
|
||||
var ns = parentNode == null || IsDataTemplate(node, parentNode) || IsStyle(node, parentNode)
|
||||
var ns = parentNode == null || IsDataTemplate(node, parentNode) || IsStyle(node, parentNode) || IsVisualStateGroupList(node)
|
||||
? new NameScope()
|
||||
: scopes[parentNode];
|
||||
node.Namescope = ns;
|
||||
|
@ -65,5 +65,10 @@ namespace Xamarin.Forms.Xaml
|
|||
var pnode = parentNode as ElementNode;
|
||||
return pnode != null && pnode.XmlType.Name == "Style";
|
||||
}
|
||||
|
||||
static bool IsVisualStateGroupList(ElementNode node)
|
||||
{
|
||||
return node != null && node.XmlType.Name == "VisualStateGroup" && node.Parent is IListNode;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,214 @@
|
|||
<Type Name="VisualElement" FullName="Xamarin.Forms.PlatformConfiguration.AndroidSpecific.VisualElement">
|
||||
<TypeSignature Language="C#" Value="public static class VisualElement" />
|
||||
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit VisualElement extends System.Object" />
|
||||
<AssemblyInfo>
|
||||
<AssemblyName>Xamarin.Forms.Core</AssemblyName>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<Base>
|
||||
<BaseTypeName>System.Object</BaseTypeName>
|
||||
</Base>
|
||||
<Interfaces />
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
<Members>
|
||||
<Member MemberName="ElevationProperty">
|
||||
<MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty ElevationProperty;" />
|
||||
<MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty ElevationProperty" />
|
||||
<MemberType>Field</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.BindableProperty</ReturnType>
|
||||
</ReturnValue>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GetElevation">
|
||||
<MemberSignature Language="C#" Value="public static Nullable<float> GetElevation (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> config);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1<float32> GetElevation(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> config) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Nullable<System.Single></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GetElevation">
|
||||
<MemberSignature Language="C#" Value="public static Nullable<float> GetElevation (Xamarin.Forms.VisualElement element);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1<float32> GetElevation(class Xamarin.Forms.VisualElement element) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Nullable<System.Single></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="element" Type="Xamarin.Forms.VisualElement" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="element">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static bool GetIsLegacyColorModeEnabled (Xamarin.Forms.BindableObject element);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool GetIsLegacyColorModeEnabled(class Xamarin.Forms.BindableObject element) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="element" Type="Xamarin.Forms.BindableObject" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="element">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static bool GetIsLegacyColorModeEnabled (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> config);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool GetIsLegacyColorModeEnabled(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> config) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="IsLegacyColorModeEnabledProperty">
|
||||
<MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty IsLegacyColorModeEnabledProperty;" />
|
||||
<MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty IsLegacyColorModeEnabledProperty" />
|
||||
<MemberType>Field</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.BindableProperty</ReturnType>
|
||||
</ReturnValue>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="SetElevation">
|
||||
<MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> SetElevation (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> config, Nullable<float> value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> SetElevation(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> config, valuetype System.Nullable`1<float32> value) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
<Parameter Name="value" Type="System.Nullable<System.Single>" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<param name="value">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="SetElevation">
|
||||
<MemberSignature Language="C#" Value="public static void SetElevation (Xamarin.Forms.VisualElement element, Nullable<float> value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetElevation(class Xamarin.Forms.VisualElement element, valuetype System.Nullable`1<float32> value) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="element" Type="Xamarin.Forms.VisualElement" />
|
||||
<Parameter Name="value" Type="System.Nullable<System.Single>" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="element">To be added.</param>
|
||||
<param name="value">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="SetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static void SetIsLegacyColorModeEnabled (Xamarin.Forms.BindableObject element, bool value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetIsLegacyColorModeEnabled(class Xamarin.Forms.BindableObject element, bool value) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="element" Type="Xamarin.Forms.BindableObject" />
|
||||
<Parameter Name="value" Type="System.Boolean" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="element">To be added.</param>
|
||||
<param name="value">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="SetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> SetIsLegacyColorModeEnabled (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> config, bool value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> SetIsLegacyColorModeEnabled(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> config, bool value) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
<Parameter Name="value" Type="System.Boolean" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<param name="value">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
</Members>
|
||||
</Type>
|
|
@ -1,6 +1,6 @@
|
|||
<Type Name="Elevation" FullName="Xamarin.Forms.PlatformConfiguration.AndroidSpecific.Elevation">
|
||||
<TypeSignature Language="C#" Value="public static class Elevation" />
|
||||
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit Elevation extends System.Object" />
|
||||
<Type Name="VisualElement" FullName="Xamarin.Forms.PlatformConfiguration.WindowsSpecific.VisualElement">
|
||||
<TypeSignature Language="C#" Value="public static class VisualElement" />
|
||||
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit VisualElement extends System.Object" />
|
||||
<AssemblyInfo>
|
||||
<AssemblyName>Xamarin.Forms.Core</AssemblyName>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
|
@ -14,9 +14,49 @@
|
|||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
<Members>
|
||||
<Member MemberName="ElevationProperty">
|
||||
<MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty ElevationProperty;" />
|
||||
<MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty ElevationProperty" />
|
||||
<Member MemberName="GetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static bool GetIsLegacyColorModeEnabled (Xamarin.Forms.BindableObject element);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool GetIsLegacyColorModeEnabled(class Xamarin.Forms.BindableObject element) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="element" Type="Xamarin.Forms.BindableObject" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="element">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static bool GetIsLegacyColorModeEnabled (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.VisualElement> config);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool GetIsLegacyColorModeEnabled(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Windows, class Xamarin.Forms.VisualElement> config) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="IsLegacyColorModeEnabledProperty">
|
||||
<MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty IsLegacyColorModeEnabledProperty;" />
|
||||
<MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty IsLegacyColorModeEnabledProperty" />
|
||||
<MemberType>Field</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
|
@ -29,71 +69,9 @@
|
|||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GetElevation">
|
||||
<MemberSignature Language="C#" Value="public static Nullable<float> GetElevation (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> config);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1<float32> GetElevation(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> config) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Nullable<System.Single></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GetElevation">
|
||||
<MemberSignature Language="C#" Value="public static Nullable<float> GetElevation (Xamarin.Forms.VisualElement element);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1<float32> GetElevation(class Xamarin.Forms.VisualElement element) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Nullable<System.Single></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="element" Type="Xamarin.Forms.VisualElement" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="element">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="SetElevation">
|
||||
<MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> SetElevation (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> config, Nullable<float> value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> SetElevation(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> config, valuetype System.Nullable`1<float32> value) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
<Parameter Name="value" Type="System.Nullable<System.Single>" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<param name="value">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="SetElevation">
|
||||
<MemberSignature Language="C#" Value="public static void SetElevation (Xamarin.Forms.VisualElement element, Nullable<float> value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetElevation(class Xamarin.Forms.VisualElement element, valuetype System.Nullable`1<float32> value) cil managed" />
|
||||
<Member MemberName="SetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static void SetIsLegacyColorModeEnabled (Xamarin.Forms.BindableObject element, bool value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetIsLegacyColorModeEnabled(class Xamarin.Forms.BindableObject element, bool value) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
|
@ -102,8 +80,8 @@
|
|||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="element" Type="Xamarin.Forms.VisualElement" />
|
||||
<Parameter Name="value" Type="System.Nullable<System.Single>" />
|
||||
<Parameter Name="element" Type="Xamarin.Forms.BindableObject" />
|
||||
<Parameter Name="value" Type="System.Boolean" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="element">To be added.</param>
|
||||
|
@ -112,5 +90,27 @@
|
|||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="SetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.VisualElement> SetIsLegacyColorModeEnabled (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.VisualElement> config, bool value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Windows, class Xamarin.Forms.VisualElement> SetIsLegacyColorModeEnabled(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Windows, class Xamarin.Forms.VisualElement> config, bool value) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.VisualElement></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
<Parameter Name="value" Type="System.Boolean" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<param name="value">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
</Members>
|
||||
</Type>
|
|
@ -71,6 +71,61 @@
|
|||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static bool GetIsLegacyColorModeEnabled (Xamarin.Forms.BindableObject element);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool GetIsLegacyColorModeEnabled(class Xamarin.Forms.BindableObject element) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="element" Type="Xamarin.Forms.BindableObject" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="element">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static bool GetIsLegacyColorModeEnabled (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement> config);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool GetIsLegacyColorModeEnabled(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.iOS, class Xamarin.Forms.VisualElement> config) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="IsLegacyColorModeEnabledProperty">
|
||||
<MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty IsLegacyColorModeEnabledProperty;" />
|
||||
<MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty IsLegacyColorModeEnabledProperty" />
|
||||
<MemberType>Field</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.BindableProperty</ReturnType>
|
||||
</ReturnValue>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="SetBlurEffect">
|
||||
<MemberSignature Language="C#" Value="public static void SetBlurEffect (Xamarin.Forms.BindableObject element, Xamarin.Forms.PlatformConfiguration.iOSSpecific.BlurEffectStyle value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetBlurEffect(class Xamarin.Forms.BindableObject element, valuetype Xamarin.Forms.PlatformConfiguration.iOSSpecific.BlurEffectStyle value) cil managed" />
|
||||
|
@ -92,6 +147,49 @@
|
|||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="SetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static void SetIsLegacyColorModeEnabled (Xamarin.Forms.BindableObject element, bool value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetIsLegacyColorModeEnabled(class Xamarin.Forms.BindableObject element, bool value) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="element" Type="Xamarin.Forms.BindableObject" />
|
||||
<Parameter Name="value" Type="System.Boolean" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="element">To be added.</param>
|
||||
<param name="value">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="SetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement> SetIsLegacyColorModeEnabled (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement> config, bool value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.iOS, class Xamarin.Forms.VisualElement> SetIsLegacyColorModeEnabled(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.iOS, class Xamarin.Forms.VisualElement> config, bool value) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
<Parameter Name="value" Type="System.Boolean" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<param name="value">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="UseBlurEffect">
|
||||
<MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement> UseBlurEffect (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement> config, Xamarin.Forms.PlatformConfiguration.iOSSpecific.BlurEffectStyle value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.iOS, class Xamarin.Forms.VisualElement> UseBlurEffect(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.iOS, class Xamarin.Forms.VisualElement> config, valuetype Xamarin.Forms.PlatformConfiguration.iOSSpecific.BlurEffectStyle value) cil managed" />
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
<Type Name="VisualState" FullName="Xamarin.Forms.VisualState">
|
||||
<TypeSignature Language="C#" Value="public sealed class VisualState" />
|
||||
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit VisualState extends System.Object" />
|
||||
<AssemblyInfo>
|
||||
<AssemblyName>Xamarin.Forms.Core</AssemblyName>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<Base>
|
||||
<BaseTypeName>System.Object</BaseTypeName>
|
||||
</Base>
|
||||
<Interfaces />
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
<Members>
|
||||
<Member MemberName=".ctor">
|
||||
<MemberSignature Language="C#" Value="public VisualState ();" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
|
||||
<MemberType>Constructor</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<Parameters />
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Name">
|
||||
<MemberSignature Language="C#" Value="public string Name { get; set; }" />
|
||||
<MemberSignature Language="ILAsm" Value=".property instance string Name" />
|
||||
<MemberType>Property</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.String</ReturnType>
|
||||
</ReturnValue>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<value>To be added.</value>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Setters">
|
||||
<MemberSignature Language="C#" Value="public System.Collections.Generic.IList<Xamarin.Forms.Setter> Setters { get; }" />
|
||||
<MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IList`1<class Xamarin.Forms.Setter> Setters" />
|
||||
<MemberType>Property</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Collections.Generic.IList<Xamarin.Forms.Setter></ReturnType>
|
||||
</ReturnValue>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<value>To be added.</value>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="TargetType">
|
||||
<MemberSignature Language="C#" Value="public Type TargetType { get; set; }" />
|
||||
<MemberSignature Language="ILAsm" Value=".property instance class System.Type TargetType" />
|
||||
<MemberType>Property</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Type</ReturnType>
|
||||
</ReturnValue>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<value>To be added.</value>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
</Members>
|
||||
</Type>
|
|
@ -0,0 +1,100 @@
|
|||
<Type Name="VisualStateGroup" FullName="Xamarin.Forms.VisualStateGroup">
|
||||
<TypeSignature Language="C#" Value="public sealed class VisualStateGroup" />
|
||||
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit VisualStateGroup extends System.Object" />
|
||||
<AssemblyInfo>
|
||||
<AssemblyName>Xamarin.Forms.Core</AssemblyName>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<Base>
|
||||
<BaseTypeName>System.Object</BaseTypeName>
|
||||
</Base>
|
||||
<Interfaces />
|
||||
<Attributes>
|
||||
<Attribute>
|
||||
<AttributeName>Xamarin.Forms.ContentProperty("States")</AttributeName>
|
||||
</Attribute>
|
||||
</Attributes>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
<Members>
|
||||
<Member MemberName=".ctor">
|
||||
<MemberSignature Language="C#" Value="public VisualStateGroup ();" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
|
||||
<MemberType>Constructor</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<Parameters />
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="CurrentState">
|
||||
<MemberSignature Language="C#" Value="public Xamarin.Forms.VisualState CurrentState { get; }" />
|
||||
<MemberSignature Language="ILAsm" Value=".property instance class Xamarin.Forms.VisualState CurrentState" />
|
||||
<MemberType>Property</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.VisualState</ReturnType>
|
||||
</ReturnValue>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<value>To be added.</value>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Name">
|
||||
<MemberSignature Language="C#" Value="public string Name { get; set; }" />
|
||||
<MemberSignature Language="ILAsm" Value=".property instance string Name" />
|
||||
<MemberType>Property</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.String</ReturnType>
|
||||
</ReturnValue>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<value>To be added.</value>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="States">
|
||||
<MemberSignature Language="C#" Value="public System.Collections.Generic.IList<Xamarin.Forms.VisualState> States { get; }" />
|
||||
<MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IList`1<class Xamarin.Forms.VisualState> States" />
|
||||
<MemberType>Property</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Collections.Generic.IList<Xamarin.Forms.VisualState></ReturnType>
|
||||
</ReturnValue>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<value>To be added.</value>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="TargetType">
|
||||
<MemberSignature Language="C#" Value="public Type TargetType { get; set; }" />
|
||||
<MemberSignature Language="ILAsm" Value=".property instance class System.Type TargetType" />
|
||||
<MemberType>Property</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Type</ReturnType>
|
||||
</ReturnValue>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<value>To be added.</value>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
</Members>
|
||||
</Type>
|
|
@ -0,0 +1,283 @@
|
|||
<Type Name="VisualStateGroupList" FullName="Xamarin.Forms.VisualStateGroupList">
|
||||
<TypeSignature Language="C#" Value="public class VisualStateGroupList : System.Collections.Generic.ICollection<Xamarin.Forms.VisualStateGroup>, System.Collections.Generic.IEnumerable<Xamarin.Forms.VisualStateGroup>, System.Collections.Generic.IList<Xamarin.Forms.VisualStateGroup>" />
|
||||
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit VisualStateGroupList extends System.Object implements class System.Collections.Generic.ICollection`1<class Xamarin.Forms.VisualStateGroup>, class System.Collections.Generic.IEnumerable`1<class Xamarin.Forms.VisualStateGroup>, class System.Collections.Generic.IList`1<class Xamarin.Forms.VisualStateGroup>, class System.Collections.IEnumerable" />
|
||||
<AssemblyInfo>
|
||||
<AssemblyName>Xamarin.Forms.Core</AssemblyName>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<Base>
|
||||
<BaseTypeName>System.Object</BaseTypeName>
|
||||
</Base>
|
||||
<Interfaces>
|
||||
<Interface>
|
||||
<InterfaceName>System.Collections.Generic.ICollection<Xamarin.Forms.VisualStateGroup></InterfaceName>
|
||||
</Interface>
|
||||
<Interface>
|
||||
<InterfaceName>System.Collections.Generic.IEnumerable<Xamarin.Forms.VisualStateGroup></InterfaceName>
|
||||
</Interface>
|
||||
<Interface>
|
||||
<InterfaceName>System.Collections.Generic.IList<Xamarin.Forms.VisualStateGroup></InterfaceName>
|
||||
</Interface>
|
||||
</Interfaces>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
<Members>
|
||||
<Member MemberName=".ctor">
|
||||
<MemberSignature Language="C#" Value="public VisualStateGroupList ();" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
|
||||
<MemberType>Constructor</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<Parameters />
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Add">
|
||||
<MemberSignature Language="C#" Value="public void Add (Xamarin.Forms.VisualStateGroup item);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Add(class Xamarin.Forms.VisualStateGroup item) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="item" Type="Xamarin.Forms.VisualStateGroup" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="item">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Clear">
|
||||
<MemberSignature Language="C#" Value="public void Clear ();" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Clear() cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters />
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Contains">
|
||||
<MemberSignature Language="C#" Value="public bool Contains (Xamarin.Forms.VisualStateGroup item);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool Contains(class Xamarin.Forms.VisualStateGroup item) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="item" Type="Xamarin.Forms.VisualStateGroup" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="item">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="CopyTo">
|
||||
<MemberSignature Language="C#" Value="public void CopyTo (Xamarin.Forms.VisualStateGroup[] array, int arrayIndex);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void CopyTo(class Xamarin.Forms.VisualStateGroup[] array, int32 arrayIndex) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="array" Type="Xamarin.Forms.VisualStateGroup[]" />
|
||||
<Parameter Name="arrayIndex" Type="System.Int32" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="array">To be added.</param>
|
||||
<param name="arrayIndex">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Count">
|
||||
<MemberSignature Language="C#" Value="public int Count { get; }" />
|
||||
<MemberSignature Language="ILAsm" Value=".property instance int32 Count" />
|
||||
<MemberType>Property</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Int32</ReturnType>
|
||||
</ReturnValue>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<value>To be added.</value>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GetEnumerator">
|
||||
<MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerator<Xamarin.Forms.VisualStateGroup> GetEnumerator ();" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Collections.Generic.IEnumerator`1<class Xamarin.Forms.VisualStateGroup> GetEnumerator() cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Collections.Generic.IEnumerator<Xamarin.Forms.VisualStateGroup></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters />
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="IndexOf">
|
||||
<MemberSignature Language="C#" Value="public int IndexOf (Xamarin.Forms.VisualStateGroup item);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance int32 IndexOf(class Xamarin.Forms.VisualStateGroup item) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Int32</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="item" Type="Xamarin.Forms.VisualStateGroup" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="item">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Insert">
|
||||
<MemberSignature Language="C#" Value="public void Insert (int index, Xamarin.Forms.VisualStateGroup item);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Insert(int32 index, class Xamarin.Forms.VisualStateGroup item) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="index" Type="System.Int32" />
|
||||
<Parameter Name="item" Type="Xamarin.Forms.VisualStateGroup" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="index">To be added.</param>
|
||||
<param name="item">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="IsReadOnly">
|
||||
<MemberSignature Language="C#" Value="public bool IsReadOnly { get; }" />
|
||||
<MemberSignature Language="ILAsm" Value=".property instance bool IsReadOnly" />
|
||||
<MemberType>Property</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<value>To be added.</value>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Item">
|
||||
<MemberSignature Language="C#" Value="public Xamarin.Forms.VisualStateGroup this[int index] { get; set; }" />
|
||||
<MemberSignature Language="ILAsm" Value=".property instance class Xamarin.Forms.VisualStateGroup Item(int32)" />
|
||||
<MemberType>Property</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.VisualStateGroup</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="index" Type="System.Int32" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="index">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<value>To be added.</value>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Remove">
|
||||
<MemberSignature Language="C#" Value="public bool Remove (Xamarin.Forms.VisualStateGroup item);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool Remove(class Xamarin.Forms.VisualStateGroup item) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="item" Type="Xamarin.Forms.VisualStateGroup" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="item">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="RemoveAt">
|
||||
<MemberSignature Language="C#" Value="public void RemoveAt (int index);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void RemoveAt(int32 index) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="index" Type="System.Int32" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="index">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="System.Collections.IEnumerable.GetEnumerator">
|
||||
<MemberSignature Language="C#" Value="System.Collections.IEnumerator IEnumerable.GetEnumerator ();" />
|
||||
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance class System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Collections.IEnumerator</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters />
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
</Members>
|
||||
</Type>
|
|
@ -0,0 +1,116 @@
|
|||
<Type Name="VisualStateManager" FullName="Xamarin.Forms.VisualStateManager">
|
||||
<TypeSignature Language="C#" Value="public static class VisualStateManager" />
|
||||
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit VisualStateManager extends System.Object" />
|
||||
<AssemblyInfo>
|
||||
<AssemblyName>Xamarin.Forms.Core</AssemblyName>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<Base>
|
||||
<BaseTypeName>System.Object</BaseTypeName>
|
||||
</Base>
|
||||
<Interfaces />
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
<Members>
|
||||
<Member MemberName="GetVisualStateGroups">
|
||||
<MemberSignature Language="C#" Value="public static System.Collections.Generic.IList<Xamarin.Forms.VisualStateGroup> GetVisualStateGroups (Xamarin.Forms.VisualElement visualElement);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IList`1<class Xamarin.Forms.VisualStateGroup> GetVisualStateGroups(class Xamarin.Forms.VisualElement visualElement) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Collections.Generic.IList<Xamarin.Forms.VisualStateGroup></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="visualElement" Type="Xamarin.Forms.VisualElement" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="visualElement">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="GoToState">
|
||||
<MemberSignature Language="C#" Value="public static bool GoToState (Xamarin.Forms.VisualElement visualElement, string name);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool GoToState(class Xamarin.Forms.VisualElement visualElement, string name) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="visualElement" Type="Xamarin.Forms.VisualElement" />
|
||||
<Parameter Name="name" Type="System.String" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="visualElement">To be added.</param>
|
||||
<param name="name">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="HasVisualStateGroups">
|
||||
<MemberSignature Language="C#" Value="public static bool HasVisualStateGroups (this Xamarin.Forms.VisualElement element);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool HasVisualStateGroups(class Xamarin.Forms.VisualElement element) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="element" Type="Xamarin.Forms.VisualElement" RefType="this" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="element">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<returns>To be added.</returns>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="SetVisualStateGroups">
|
||||
<MemberSignature Language="C#" Value="public static void SetVisualStateGroups (Xamarin.Forms.VisualElement visualElement, Xamarin.Forms.VisualStateGroupList value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetVisualStateGroups(class Xamarin.Forms.VisualElement visualElement, class Xamarin.Forms.VisualStateGroupList value) cil managed" />
|
||||
<MemberType>Method</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Void</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="visualElement" Type="Xamarin.Forms.VisualElement" />
|
||||
<Parameter Name="value" Type="Xamarin.Forms.VisualStateGroupList" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="visualElement">To be added.</param>
|
||||
<param name="value">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="VisualStateGroupsProperty">
|
||||
<MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty VisualStateGroupsProperty;" />
|
||||
<MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty VisualStateGroupsProperty" />
|
||||
<MemberType>Field</MemberType>
|
||||
<AssemblyInfo>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</AssemblyInfo>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.BindableProperty</ReturnType>
|
||||
</ReturnValue>
|
||||
<Docs>
|
||||
<summary>To be added.</summary>
|
||||
<remarks>To be added.</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
</Members>
|
||||
</Type>
|
|
@ -427,6 +427,10 @@
|
|||
<Type Name="VisualElement" Kind="Class" />
|
||||
<Type Name="VisualElement+FocusRequestArgs" Kind="Class" />
|
||||
<Type Name="VisualElement+VisibilityConverter" Kind="Class" />
|
||||
<Type Name="VisualState" Kind="Class" />
|
||||
<Type Name="VisualStateGroup" Kind="Class" />
|
||||
<Type Name="VisualStateGroupList" Kind="Class" />
|
||||
<Type Name="VisualStateManager" Kind="Class" />
|
||||
<Type Name="WebNavigatedEventArgs" Kind="Class" />
|
||||
<Type Name="WebNavigatingEventArgs" Kind="Class" />
|
||||
<Type Name="WebNavigationEvent" Kind="Enumeration" />
|
||||
|
@ -501,9 +505,9 @@
|
|||
</Namespace>
|
||||
<Namespace Name="Xamarin.Forms.PlatformConfiguration.AndroidSpecific">
|
||||
<Type Name="Application" Kind="Class" />
|
||||
<Type Name="Elevation" Kind="Class" />
|
||||
<Type Name="ListView" Kind="Class" />
|
||||
<Type Name="TabbedPage" Kind="Class" />
|
||||
<Type Name="VisualElement" Kind="Class" />
|
||||
<Type Name="WindowSoftInputModeAdjust" Kind="Enumeration" />
|
||||
</Namespace>
|
||||
<Namespace Name="Xamarin.Forms.PlatformConfiguration.AndroidSpecific.AppCompat">
|
||||
|
@ -557,6 +561,7 @@
|
|||
<Type Name="MasterDetailPage" Kind="Class" />
|
||||
<Type Name="Page" Kind="Class" />
|
||||
<Type Name="ToolbarPlacement" Kind="Enumeration" />
|
||||
<Type Name="VisualElement" Kind="Class" />
|
||||
</Namespace>
|
||||
<Namespace Name="Xamarin.Forms.StyleSheets">
|
||||
<Type Name="StyleSheet" Kind="Class" />
|
||||
|
@ -1882,50 +1887,6 @@
|
|||
<Link Type="Xamarin.Forms.PlatformConfiguration.AndroidSpecific.Application" Member="M:Xamarin.Forms.PlatformConfiguration.AndroidSpecific.Application.UseWindowSoftInputModeAdjust(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.Application},Xamarin.Forms.PlatformConfiguration.AndroidSpecific.WindowSoftInputModeAdjust)" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
|
||||
</Targets>
|
||||
<Member MemberName="GetElevation">
|
||||
<MemberSignature Language="C#" Value="public static Nullable<float> GetElevation (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> config);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1<float32> GetElevation(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> config) cil managed" />
|
||||
<MemberType>ExtensionMethod</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Nullable<System.Single></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
</Docs>
|
||||
<Link Type="Xamarin.Forms.PlatformConfiguration.AndroidSpecific.Elevation" Member="M:Xamarin.Forms.PlatformConfiguration.AndroidSpecific.Elevation.GetElevation(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement})" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
|
||||
</Targets>
|
||||
<Member MemberName="SetElevation">
|
||||
<MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> SetElevation (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> config, Nullable<float> value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> SetElevation(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> config, valuetype System.Nullable`1<float32> value) cil managed" />
|
||||
<MemberType>ExtensionMethod</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
<Parameter Name="value" Type="System.Nullable<System.Single>" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<param name="value">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
</Docs>
|
||||
<Link Type="Xamarin.Forms.PlatformConfiguration.AndroidSpecific.Elevation" Member="M:Xamarin.Forms.PlatformConfiguration.AndroidSpecific.Elevation.SetElevation(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement},System.Nullable{System.Single})" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
|
||||
|
@ -2100,6 +2061,94 @@
|
|||
<Link Type="Xamarin.Forms.PlatformConfiguration.AndroidSpecific.TabbedPage" Member="M:Xamarin.Forms.PlatformConfiguration.AndroidSpecific.TabbedPage.SetOffscreenPageLimit(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.TabbedPage},System.Int32)" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
|
||||
</Targets>
|
||||
<Member MemberName="GetElevation">
|
||||
<MemberSignature Language="C#" Value="public static Nullable<float> GetElevation (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> config);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Nullable`1<float32> GetElevation(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> config) cil managed" />
|
||||
<MemberType>ExtensionMethod</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Nullable<System.Single></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
</Docs>
|
||||
<Link Type="Xamarin.Forms.PlatformConfiguration.AndroidSpecific.VisualElement" Member="M:Xamarin.Forms.PlatformConfiguration.AndroidSpecific.VisualElement.GetElevation(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement})" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
|
||||
</Targets>
|
||||
<Member MemberName="GetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static bool GetIsLegacyColorModeEnabled (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> config);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool GetIsLegacyColorModeEnabled(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> config) cil managed" />
|
||||
<MemberType>ExtensionMethod</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
</Docs>
|
||||
<Link Type="Xamarin.Forms.PlatformConfiguration.AndroidSpecific.VisualElement" Member="M:Xamarin.Forms.PlatformConfiguration.AndroidSpecific.VisualElement.GetIsLegacyColorModeEnabled(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement})" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
|
||||
</Targets>
|
||||
<Member MemberName="SetElevation">
|
||||
<MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> SetElevation (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> config, Nullable<float> value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> SetElevation(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> config, valuetype System.Nullable`1<float32> value) cil managed" />
|
||||
<MemberType>ExtensionMethod</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
<Parameter Name="value" Type="System.Nullable<System.Single>" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<param name="value">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
</Docs>
|
||||
<Link Type="Xamarin.Forms.PlatformConfiguration.AndroidSpecific.VisualElement" Member="M:Xamarin.Forms.PlatformConfiguration.AndroidSpecific.VisualElement.SetElevation(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement},System.Nullable{System.Single})" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
|
||||
</Targets>
|
||||
<Member MemberName="SetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> SetIsLegacyColorModeEnabled (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement> config, bool value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> SetIsLegacyColorModeEnabled(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Android, class Xamarin.Forms.VisualElement> config, bool value) cil managed" />
|
||||
<MemberType>ExtensionMethod</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
<Parameter Name="value" Type="System.Boolean" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<param name="value">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
</Docs>
|
||||
<Link Type="Xamarin.Forms.PlatformConfiguration.AndroidSpecific.VisualElement" Member="M:Xamarin.Forms.PlatformConfiguration.AndroidSpecific.VisualElement.SetIsLegacyColorModeEnabled(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.Android,Xamarin.Forms.VisualElement},System.Boolean)" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
|
||||
|
@ -2821,6 +2870,50 @@
|
|||
<Link Type="Xamarin.Forms.PlatformConfiguration.iOSSpecific.VisualElement" Member="M:Xamarin.Forms.PlatformConfiguration.iOSSpecific.VisualElement.GetBlurEffect(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement})" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
|
||||
</Targets>
|
||||
<Member MemberName="GetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static bool GetIsLegacyColorModeEnabled (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement> config);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool GetIsLegacyColorModeEnabled(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.iOS, class Xamarin.Forms.VisualElement> config) cil managed" />
|
||||
<MemberType>ExtensionMethod</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
</Docs>
|
||||
<Link Type="Xamarin.Forms.PlatformConfiguration.iOSSpecific.VisualElement" Member="M:Xamarin.Forms.PlatformConfiguration.iOSSpecific.VisualElement.GetIsLegacyColorModeEnabled(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement})" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
|
||||
</Targets>
|
||||
<Member MemberName="SetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement> SetIsLegacyColorModeEnabled (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement> config, bool value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.iOS, class Xamarin.Forms.VisualElement> SetIsLegacyColorModeEnabled(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.iOS, class Xamarin.Forms.VisualElement> config, bool value) cil managed" />
|
||||
<MemberType>ExtensionMethod</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
<Parameter Name="value" Type="System.Boolean" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<param name="value">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
</Docs>
|
||||
<Link Type="Xamarin.Forms.PlatformConfiguration.iOSSpecific.VisualElement" Member="M:Xamarin.Forms.PlatformConfiguration.iOSSpecific.VisualElement.SetIsLegacyColorModeEnabled(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.VisualElement},System.Boolean)" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
|
||||
|
@ -4095,6 +4188,50 @@
|
|||
<Link Type="Xamarin.Forms.PlatformConfiguration.WindowsSpecific.Page" Member="M:Xamarin.Forms.PlatformConfiguration.WindowsSpecific.Page.SetToolbarPlacement(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.Page},Xamarin.Forms.PlatformConfiguration.WindowsSpecific.ToolbarPlacement)" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
|
||||
</Targets>
|
||||
<Member MemberName="GetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static bool GetIsLegacyColorModeEnabled (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.VisualElement> config);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool GetIsLegacyColorModeEnabled(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Windows, class Xamarin.Forms.VisualElement> config) cil managed" />
|
||||
<MemberType>ExtensionMethod</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
</Docs>
|
||||
<Link Type="Xamarin.Forms.PlatformConfiguration.WindowsSpecific.VisualElement" Member="M:Xamarin.Forms.PlatformConfiguration.WindowsSpecific.VisualElement.GetIsLegacyColorModeEnabled(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.VisualElement})" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:Xamarin.Forms.IPlatformElementConfiguration`2" />
|
||||
</Targets>
|
||||
<Member MemberName="SetIsLegacyColorModeEnabled">
|
||||
<MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.VisualElement> SetIsLegacyColorModeEnabled (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.VisualElement> config, bool value);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Windows, class Xamarin.Forms.VisualElement> SetIsLegacyColorModeEnabled(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.Windows, class Xamarin.Forms.VisualElement> config, bool value) cil managed" />
|
||||
<MemberType>ExtensionMethod</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.VisualElement></ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.VisualElement>" RefType="this" />
|
||||
<Parameter Name="value" Type="System.Boolean" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="config">To be added.</param>
|
||||
<param name="value">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
</Docs>
|
||||
<Link Type="Xamarin.Forms.PlatformConfiguration.WindowsSpecific.VisualElement" Member="M:Xamarin.Forms.PlatformConfiguration.WindowsSpecific.VisualElement.SetIsLegacyColorModeEnabled(Xamarin.Forms.IPlatformElementConfiguration{Xamarin.Forms.PlatformConfiguration.Windows,Xamarin.Forms.VisualElement},System.Boolean)" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:System.Collections.Generic.IList`1" />
|
||||
|
@ -4441,5 +4578,26 @@
|
|||
<Link Type="Xamarin.Forms.ViewExtensions" Member="M:Xamarin.Forms.ViewExtensions.TranslateTo(Xamarin.Forms.VisualElement,System.Double,System.Double,System.UInt32,Xamarin.Forms.Easing)" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
<ExtensionMethod>
|
||||
<Targets>
|
||||
<Target Type="T:Xamarin.Forms.VisualElement" />
|
||||
</Targets>
|
||||
<Member MemberName="HasVisualStateGroups">
|
||||
<MemberSignature Language="C#" Value="public static bool HasVisualStateGroups (this Xamarin.Forms.VisualElement element);" />
|
||||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool HasVisualStateGroups(class Xamarin.Forms.VisualElement element) cil managed" />
|
||||
<MemberType>ExtensionMethod</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>System.Boolean</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="element" Type="Xamarin.Forms.VisualElement" RefType="this" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<param name="element">To be added.</param>
|
||||
<summary>To be added.</summary>
|
||||
</Docs>
|
||||
<Link Type="Xamarin.Forms.VisualStateManager" Member="M:Xamarin.Forms.VisualStateManager.HasVisualStateGroups(Xamarin.Forms.VisualElement)" />
|
||||
</Member>
|
||||
</ExtensionMethod>
|
||||
</ExtensionMethods>
|
||||
</Overview>
|
||||
|
|
Загрузка…
Ссылка в новой задаче