<Type Name="BindableObjectExtensions" FullName="Microsoft.Maui.Controls.BindableObjectExtensions">
  <TypeSignature Language="C#" Value="public static class BindableObjectExtensions" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit BindableObjectExtensions extends System.Object" />
  <TypeSignature Language="DocId" Value="T:Microsoft.Maui.Controls.BindableObjectExtensions" />
  <TypeSignature Language="F#" Value="type BindableObjectExtensions = class" />
  <AssemblyInfo>
    <AssemblyName>Microsoft.Maui.Controls.Core</AssemblyName>
    <AssemblyVersion>0.0.0.0</AssemblyVersion>
    <AssemblyVersion>1.0.0.0</AssemblyVersion>
    <AssemblyVersion>1.1.0.0</AssemblyVersion>
    <AssemblyVersion>1.2.0.0</AssemblyVersion>
    <AssemblyVersion>1.3.0.0</AssemblyVersion>
    <AssemblyVersion>1.4.0.0</AssemblyVersion>
    <AssemblyVersion>1.5.0.0</AssemblyVersion>
    <AssemblyVersion>2.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>System.Object</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>
    <summary>Contains convenience extension methods for <see cref="T:Microsoft.Maui.Controls.BindableObject" />.</summary>
    <remarks>
    </remarks>
  </Docs>
  <Members>
    <Member MemberName="GetPropertyIfSet&lt;T&gt;">
      <MemberSignature Language="C#" Value="public static T GetPropertyIfSet&lt;T&gt; (this Microsoft.Maui.Controls.BindableObject bindableObject, Microsoft.Maui.Controls.BindableProperty bindableProperty, T returnIfNotSet);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig !!T GetPropertyIfSet&lt;T&gt;(class Microsoft.Maui.Controls.BindableObject bindableObject, class Microsoft.Maui.Controls.BindableProperty bindableProperty, !!T returnIfNotSet) cil managed" />
      <MemberSignature Language="DocId" Value="M:Microsoft.Maui.Controls.BindableObjectExtensions.GetPropertyIfSet``1(Microsoft.Maui.Controls.BindableObject,Microsoft.Maui.Controls.BindableProperty,``0)" />
      <MemberSignature Language="F#" Value="static member GetPropertyIfSet : Microsoft.Maui.Controls.BindableObject * Microsoft.Maui.Controls.BindableProperty * 'T -&gt; 'T" Usage="Microsoft.Maui.Controls.BindableObjectExtensions.GetPropertyIfSet (bindableObject, bindableProperty, returnIfNotSet)" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyName>Microsoft.Maui.Controls.Core</AssemblyName>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>T</ReturnType>
      </ReturnValue>
      <TypeParameters>
        <TypeParameter Name="T" />
      </TypeParameters>
      <Parameters>
        <Parameter Name="bindableObject" Type="Microsoft.Maui.Controls.BindableObject" RefType="this" />
        <Parameter Name="bindableProperty" Type="Microsoft.Maui.Controls.BindableProperty" />
        <Parameter Name="returnIfNotSet" Type="T" />
      </Parameters>
      <Docs>
        <typeparam name="T">To be added.</typeparam>
        <param name="bindableObject">To be added.</param>
        <param name="bindableProperty">To be added.</param>
        <param name="returnIfNotSet">To be added.</param>
        <summary>To be added.</summary>
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="SetAppThemeColor">
      <MemberSignature Language="C#" Value="public static void SetAppThemeColor (this Microsoft.Maui.Controls.BindableObject self, Microsoft.Maui.Controls.BindableProperty targetProperty, Microsoft.Maui.Controls.Color light, Microsoft.Maui.Controls.Color dark);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetAppThemeColor(class Microsoft.Maui.Controls.BindableObject self, class Microsoft.Maui.Controls.BindableProperty targetProperty, valuetype Microsoft.Maui.Controls.Color light, valuetype Microsoft.Maui.Controls.Color dark) cil managed" />
      <MemberSignature Language="DocId" Value="M:Microsoft.Maui.Controls.BindableObjectExtensions.SetAppThemeColor(Microsoft.Maui.Controls.BindableObject,Microsoft.Maui.Controls.BindableProperty,Microsoft.Maui.Controls.Color,Microsoft.Maui.Controls.Color)" />
      <MemberSignature Language="F#" Value="static member SetAppThemeColor : Microsoft.Maui.Controls.BindableObject * Microsoft.Maui.Controls.BindableProperty * Microsoft.Maui.Controls.Color * Microsoft.Maui.Controls.Color -&gt; unit" Usage="Microsoft.Maui.Controls.BindableObjectExtensions.SetAppThemeColor (self, targetProperty, light, dark)" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyName>Microsoft.Maui.Controls.Core</AssemblyName>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="self" Type="Microsoft.Maui.Controls.BindableObject" RefType="this" />
        <Parameter Name="targetProperty" Type="Microsoft.Maui.Controls.BindableProperty" />
        <Parameter Name="light" Type="Microsoft.Maui.Controls.Color" />
        <Parameter Name="dark" Type="Microsoft.Maui.Controls.Color" />
      </Parameters>
      <Docs>
        <param name="self">To be added.</param>
        <param name="targetProperty">To be added.</param>
        <param name="light">To be added.</param>
        <param name="dark">To be added.</param>
        <summary>To be added.</summary>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="SetBinding">
      <MemberSignature Language="C#" Value="public static void SetBinding (this Microsoft.Maui.Controls.BindableObject self, Microsoft.Maui.Controls.BindableProperty targetProperty, string path, Microsoft.Maui.Controls.BindingMode mode = Microsoft.Maui.Controls.BindingMode.Default, Microsoft.Maui.Controls.IValueConverter converter = default, string stringFormat = default);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetBinding(class Microsoft.Maui.Controls.BindableObject self, class Microsoft.Maui.Controls.BindableProperty targetProperty, string path, valuetype Microsoft.Maui.Controls.BindingMode mode, class Microsoft.Maui.Controls.IValueConverter converter, string stringFormat) cil managed" />
      <MemberSignature Language="DocId" Value="M:Microsoft.Maui.Controls.BindableObjectExtensions.SetBinding(Microsoft.Maui.Controls.BindableObject,Microsoft.Maui.Controls.BindableProperty,System.String,Microsoft.Maui.Controls.BindingMode,Microsoft.Maui.Controls.IValueConverter,System.String)" />
      <MemberSignature Language="F#" Value="static member SetBinding : Microsoft.Maui.Controls.BindableObject * Microsoft.Maui.Controls.BindableProperty * string * Microsoft.Maui.Controls.BindingMode * Microsoft.Maui.Controls.IValueConverter * string -&gt; unit" Usage="Microsoft.Maui.Controls.BindableObjectExtensions.SetBinding (self, targetProperty, path, mode, converter, stringFormat)" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
        <AssemblyVersion>1.2.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.0.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
        <AssemblyName>Microsoft.Maui.Controls.Core</AssemblyName>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="self" Type="Microsoft.Maui.Controls.BindableObject" RefType="this" />
        <Parameter Name="targetProperty" Type="Microsoft.Maui.Controls.BindableProperty" />
        <Parameter Name="path" Type="System.String" />
        <Parameter Name="mode" Type="Microsoft.Maui.Controls.BindingMode" />
        <Parameter Name="converter" Type="Microsoft.Maui.Controls.IValueConverter" />
        <Parameter Name="stringFormat" Type="System.String" />
      </Parameters>
      <Docs>
        <param name="self">The <see cref="T:Microsoft.Maui.Controls.BindableObject" />.</param>
        <param name="targetProperty">The BindableProperty on which to set a binding.</param>
        <param name="path">A <see cref="T:System.String" /> indicating the property path to bind to.</param>
        <param name="mode">The <see cref="T:Microsoft.Maui.Controls.BindingMode" /> for the binding. This parameter is optional. Default is <see cref="F:Microsoft.Maui.Controls.BindingMode.Default" />.</param>
        <param name="converter">An <see cref="T:Microsoft.Maui.Controls.IValueConverter" /> for the binding. This parameter is optional. Default is <see langword="null" />.</param>
        <param name="stringFormat">A string used as stringFormat for the binding. This parameter is optional. Default is <see langword="null" />.</param>
        <summary>Creates and applies a binding to a property.</summary>
        <remarks>
          <para>The following example shows how to use the extension method to set a binding.</para>
          <example>
            <code lang="csharp lang-csharp"><![CDATA[
public class PersonViewModel
{
    public string Name { get; set; }
    public string Company { get; set; }
}

// ...

var vm = new PersonViewModel {
    Name = "John Doe", 
    Company = "Xamarin"
}

var label = new Label ();
label.SetBinding (Label.TextProperty, "Name"); // "Name" is the property on the view model
label.BindingContext = vm;

Debug.WriteLine (label.Text); // prints "John Doe"
      ]]></code>
          </example>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="SetBinding&lt;TSource&gt;">
      <MemberSignature Language="C#" Value="public static void SetBinding&lt;TSource&gt; (this Microsoft.Maui.Controls.BindableObject self, Microsoft.Maui.Controls.BindableProperty targetProperty, System.Linq.Expressions.Expression&lt;Func&lt;TSource,object&gt;&gt; sourceProperty, Microsoft.Maui.Controls.BindingMode mode = Microsoft.Maui.Controls.BindingMode.Default, Microsoft.Maui.Controls.IValueConverter converter = default, string stringFormat = default);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetBinding&lt;TSource&gt;(class Microsoft.Maui.Controls.BindableObject self, class Microsoft.Maui.Controls.BindableProperty targetProperty, class System.Linq.Expressions.Expression`1&lt;class System.Func`2&lt;!!TSource, object&gt;&gt; sourceProperty, valuetype Microsoft.Maui.Controls.BindingMode mode, class Microsoft.Maui.Controls.IValueConverter converter, string stringFormat) cil managed" />
      <MemberSignature Language="DocId" Value="M:Microsoft.Maui.Controls.BindableObjectExtensions.SetBinding``1(Microsoft.Maui.Controls.BindableObject,Microsoft.Maui.Controls.BindableProperty,System.Linq.Expressions.Expression{System.Func{``0,System.Object}},Microsoft.Maui.Controls.BindingMode,Microsoft.Maui.Controls.IValueConverter,System.String)" />
      <MemberSignature Language="F#" Value="static member SetBinding : Microsoft.Maui.Controls.BindableObject * Microsoft.Maui.Controls.BindableProperty * System.Linq.Expressions.Expression&lt;Func&lt;'Source, obj&gt;&gt; * Microsoft.Maui.Controls.BindingMode * Microsoft.Maui.Controls.IValueConverter * string -&gt; unit" Usage="Microsoft.Maui.Controls.BindableObjectExtensions.SetBinding (self, targetProperty, sourceProperty, mode, converter, stringFormat)" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
        <AssemblyVersion>1.1.0.0</AssemblyVersion>
        <AssemblyVersion>1.2.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.0.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
        <AssemblyName>Microsoft.Maui.Controls.Core</AssemblyName>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
        </Attribute>
        <Attribute>
          <AttributeName>System.Obsolete</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <TypeParameters>
        <TypeParameter Name="TSource" />
      </TypeParameters>
      <Parameters>
        <Parameter Name="self" Type="Microsoft.Maui.Controls.BindableObject" RefType="this" />
        <Parameter Name="targetProperty" Type="Microsoft.Maui.Controls.BindableProperty" />
        <Parameter Name="sourceProperty" Type="System.Linq.Expressions.Expression&lt;System.Func&lt;TSource,System.Object&gt;&gt;" />
        <Parameter Name="mode" Type="Microsoft.Maui.Controls.BindingMode" />
        <Parameter Name="converter" Type="Microsoft.Maui.Controls.IValueConverter" />
        <Parameter Name="stringFormat" Type="System.String" />
      </Parameters>
      <Docs>
        <typeparam name="TSource">The source type.</typeparam>
        <param name="self">The BindableObject.</param>
        <param name="targetProperty">The BindableProperty to bind to</param>
        <param name="sourceProperty">An expression used to retrieve the source path.</param>
        <param name="mode">The BindingMode for the binding. This parameter is optional. Default is <see cref="F:Microsoft.Maui.Controls.BindingMode.Default" />.</param>
        <param name="converter">An IValueConverter for the binding. This parameter is optional. Default is <see langword="null" />.</param>
        <param name="stringFormat">A string used as stringFormat for the binding. This parameter is optional. Default is <see langword="null" />.</param>
        <summary>Creates and applies a binding from an expression.</summary>
        <remarks>
          <para>This extension method uses Expression instead of path to creates and sets bindings. Using Expressions is more refactoring friendly.</para>
          <para>This following example illustrates the setting of a binding using the extension method.</para>
          <example>
            <code lang="csharp lang-csharp"><![CDATA[
public class PersonViewModel
{
    public string Name { get; set; }
    public string Company { get; set; }
}

// ...

var vm = new PersonViewModel {
    Name = "John Doe", 
    Company = "Xamarin"
};
    
var label = new Label ();
label.SetBinding<PersonViewModel> (Label.TextProperty, vm => vm.Name);  // "Name" is the property on the view model
label.BindingContext = vm;

Debug.WriteLine (label.Text); // prints "John Doe"
      ]]></code>
          </example>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="SetAppTheme&lt;T&gt;">
      <MemberSignature Language="C#" Value="public static void SetAppTheme&lt;T&gt; (this Microsoft.Maui.Controls.BindableObject self, Microsoft.Maui.Controls.BindableProperty targetProperty, T light, T dark);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetAppTheme&lt;T&gt;(class Microsoft.Maui.Controls.BindableObject self, class Microsoft.Maui.Controls.BindableProperty targetProperty, !!T light, !!T dark) cil managed" />
      <MemberSignature Language="DocId" Value="M:Microsoft.Maui.Controls.BindableObjectExtensions.SetAppTheme``1(Microsoft.Maui.Controls.BindableObject,Microsoft.Maui.Controls.BindableProperty,``0,``0)" />
      <MemberSignature Language="F#" Value="static member SetAppTheme : Microsoft.Maui.Controls.BindableObject * Microsoft.Maui.Controls.BindableProperty * 'T * 'T -&gt; unit" Usage="Microsoft.Maui.Controls.BindableObjectExtensions.SetAppTheme (self, targetProperty, light, dark)" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyName>Microsoft.Maui.Controls.Core</AssemblyName>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <TypeParameters>
        <TypeParameter Name="T" />
      </TypeParameters>
      <Parameters>
        <Parameter Name="self" Type="Microsoft.Maui.Controls.BindableObject" RefType="this" />
        <Parameter Name="targetProperty" Type="Microsoft.Maui.Controls.BindableProperty" />
        <Parameter Name="light" Type="T" />
        <Parameter Name="dark" Type="T" />
      </Parameters>
      <Docs>
        <typeparam name="T">To be added.</typeparam>
        <param name="self">To be added.</param>
        <param name="targetProperty">To be added.</param>
        <param name="light">To be added.</param>
        <param name="dark">To be added.</param>
        <summary>To be added.</summary>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>
