示例#1
0
 /// <summary>
 /// An extension method that applies all of the current properties defined by the passed
 /// <see cref="T:XFGloss.ISwitchGloss"/> interface implementation to the Android SwitchCompat control
 /// </summary>
 /// <param name="control">Control.</param>
 /// <param name="properties">Properties.</param>
 /// <param name="propertyName">Property name.</param>
 public static void UpdateColorProperty(this Android.Support.V7.Widget.SwitchCompat control,
                                        ISwitchGloss properties,
                                        string propertyName)
 {
     // Use the internal ApplyColorProperty method in XFGlossSwitchExtensions to handle our color updates
     XFGlossSwitchExtensions.ApplyColorProperty(control, properties, propertyName);
 }
        protected override void OnAttached()
        {
            try
            {
                if (Control == null)
                {
                    return;
                }

                NativeControl = (Android.Support.V7.Widget.SwitchCompat)Control;

                UpdateSwitchState();
            }
            catch (Exception)
            {
                throw;
            }
        }