# C1.Util.Util

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Util_Util" data-uid="C1.Util.Util" class="text-break">Util Class
</h1>
  <div class="markdown level0 summary"><p>General utilities.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">Util</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Util.html">C1.Util</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.FlexGrid.4.6.2.dll</h6>
  <h5 id="C1_Util_Util_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static class Util</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Module Util</code></pre>
  </div>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Util_Util_BlackBrush" data-uid="C1.Util.Util.BlackBrush">
          <a class="xref" href="C1.Util.Util.BlackBrush.html#C1_Util_Util_BlackBrush">BlackBrush</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a black brush.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_BlueBrush" data-uid="C1.Util.Util.BlueBrush">
          <a class="xref" href="C1.Util.Util.BlueBrush.html#C1_Util_Util_BlueBrush">BlueBrush</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a blue brush.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_ErrorBrush" data-uid="C1.Util.Util.ErrorBrush">
          <a class="xref" href="C1.Util.Util.ErrorBrush.html#C1_Util_Util_ErrorBrush">ErrorBrush</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the default error brush.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_OpaqueBrush" data-uid="C1.Util.Util.OpaqueBrush">
          <a class="xref" href="C1.Util.Util.OpaqueBrush.html#C1_Util_Util_OpaqueBrush">OpaqueBrush</a>
        </td>
        <td class="markdown level1 summary"><p>Gets an opaque brush.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_ThicknessEmpty" data-uid="C1.Util.Util.ThicknessEmpty">
          <a class="xref" href="C1.Util.Util.ThicknessEmpty.html#C1_Util_Util_ThicknessEmpty">ThicknessEmpty</a>
        </td>
        <td class="markdown level1 summary"><p>Gets an empty <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.thickness">Thickness</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_TransparentBrush" data-uid="C1.Util.Util.TransparentBrush">
          <a class="xref" href="C1.Util.Util.TransparentBrush.html#C1_Util_Util_TransparentBrush">TransparentBrush</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a transparent brush.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_WhiteBrush" data-uid="C1.Util.Util.WhiteBrush">
          <a class="xref" href="C1.Util.Util.WhiteBrush.html#C1_Util_Util_WhiteBrush">WhiteBrush</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a white brush.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Util_Util_CancelBindings_System_Windows_FrameworkElement_" data-uid="C1.Util.Util.CancelBindings(System.Windows.FrameworkElement)">
          <a class="xref" href="C1.Util.Util.CancelBindings.html#C1_Util_Util_CancelBindings_System_Windows_FrameworkElement_">CancelBindings(FrameworkElement)</a>
        </td>
        <td class="markdown level1 summary"><p>Removes all bindings from an element and its children, effectively
canceling any edits made using the element.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_CloneBinding_System_Windows_Data_Binding_" data-uid="C1.Util.Util.CloneBinding(System.Windows.Data.Binding)">
          <a class="xref" href="C1.Util.Util.CloneBinding.html#C1_Util_Util_CloneBinding_System_Windows_Data_Binding_">CloneBinding(Binding)</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a clone of a given binding.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_ContainsFocus_System_Windows_FrameworkElement_" data-uid="C1.Util.Util.ContainsFocus(System.Windows.FrameworkElement)">
          <a class="xref" href="C1.Util.Util.ContainsFocus.html#C1_Util_Util_ContainsFocus_System_Windows_FrameworkElement_">ContainsFocus(FrameworkElement)</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value that determines whether an element or any of its children
contains the focus.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_CreatePolygon_System_Windows_Media_Brush_System_Double___" data-uid="C1.Util.Util.CreatePolygon(System.Windows.Media.Brush,System.Double[])">
          <a class="xref" href="C1.Util.Util.CreatePolygon.html#C1_Util_Util_CreatePolygon_System_Windows_Media_Brush_System_Double___">CreatePolygon(Brush, params double[])</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a polygon (used to create sort and tree glyphs).</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_GetBindingExpression_System_Windows_FrameworkElement_System_Windows_FrameworkElement__System_Windows_DependencyProperty__" data-uid="C1.Util.Util.GetBindingExpression(System.Windows.FrameworkElement,System.Windows.FrameworkElement@,System.Windows.DependencyProperty@)">
          <a class="xref" href="C1.Util.Util.GetBindingExpression.html#C1_Util_Util_GetBindingExpression_System_Windows_FrameworkElement_System_Windows_FrameworkElement__System_Windows_DependencyProperty__">GetBindingExpression(FrameworkElement, out FrameworkElement, out DependencyProperty)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the BindingExpression associated with an editor.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_GetChildrenOfType__1_System_Windows_DependencyObject_" data-uid="C1.Util.Util.GetChildrenOfType``1(System.Windows.DependencyObject)">
          <a class="xref" href="C1.Util.Util.GetChildrenOfType.html#C1_Util_Util_GetChildrenOfType__1_System_Windows_DependencyObject_">GetChildrenOfType&lt;T&gt;(DependencyObject)</a>
        </td>
        <td class="markdown level1 summary"><p>Gets an element's children of a given type.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_GetEquivalentCulture_System_Windows_Markup_XmlLanguage_" data-uid="C1.Util.Util.GetEquivalentCulture(System.Windows.Markup.XmlLanguage)">
          <a class="xref" href="C1.Util.Util.GetEquivalentCulture.html#C1_Util_Util_GetEquivalentCulture_System_Windows_Markup_XmlLanguage_">GetEquivalentCulture(XmlLanguage)</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo">CultureInfo</a> to match a given <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.markup.xmllanguage">XmlLanguage</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_GetFirstChildOfType__1_System_Windows_FrameworkElement_" data-uid="C1.Util.Util.GetFirstChildOfType``1(System.Windows.FrameworkElement)">
          <a class="xref" href="C1.Util.Util.GetFirstChildOfType.html#C1_Util_Util_GetFirstChildOfType__1_System_Windows_FrameworkElement_">GetFirstChildOfType&lt;T&gt;(FrameworkElement)</a>
        </td>
        <td class="markdown level1 summary"><p>Gets an element's first child of a given type.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_GetParentOfType__1_System_Windows_DependencyObject_" data-uid="C1.Util.Util.GetParentOfType``1(System.Windows.DependencyObject)">
          <a class="xref" href="C1.Util.Util.GetParentOfType.html#C1_Util_Util_GetParentOfType__1_System_Windows_DependencyObject_">GetParentOfType&lt;T&gt;(DependencyObject)</a>
        </td>
        <td class="markdown level1 summary"><p>Gets an element's first ancestor of a given type.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_GetPosition_System_Windows_RoutedEventArgs_System_Windows_UIElement_" data-uid="C1.Util.Util.GetPosition(System.Windows.RoutedEventArgs,System.Windows.UIElement)">
          <a class="xref" href="C1.Util.Util.GetPosition.html#C1_Util_Util_GetPosition_System_Windows_RoutedEventArgs_System_Windows_UIElement_">GetPosition(RoutedEventArgs, UIElement)</a>
        </td>
        <td class="markdown level1 summary"><p>Similar to e.GetPosition, but works in zoomed popups.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_GetValueFromBindings_System_Windows_FrameworkElement_" data-uid="C1.Util.Util.GetValueFromBindings(System.Windows.FrameworkElement)">
          <a class="xref" href="C1.Util.Util.GetValueFromBindings.html#C1_Util_Util_GetValueFromBindings_System_Windows_FrameworkElement_">GetValueFromBindings(FrameworkElement)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the current value on a binding source so caller can update the target
explicitly (because Silverlight doesn't have binding.UpdateTarget)</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_IsPrimitive_System_Type_" data-uid="C1.Util.Util.IsPrimitive(System.Type)">
          <a class="xref" href="C1.Util.Util.IsPrimitive.html#C1_Util_Util_IsPrimitive_System_Type_">IsPrimitive(Type)</a>
        </td>
        <td class="markdown level1 summary"><p>Gets whether a type is a primitive type or a string.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_PositionPopup_System_Windows_Controls_Primitives_Popup_System_Windows_FrameworkElement_" data-uid="C1.Util.Util.PositionPopup(System.Windows.Controls.Primitives.Popup,System.Windows.FrameworkElement)">
          <a class="xref" href="C1.Util.Util.PositionPopup.html#C1_Util_Util_PositionPopup_System_Windows_Controls_Primitives_Popup_System_Windows_FrameworkElement_">PositionPopup(Popup, FrameworkElement)</a>
        </td>
        <td class="markdown level1 summary"><p>Position a popup below a FrameworkElement.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_SetBindingValidation_System_Windows_Data_Binding_System_Boolean_" data-uid="C1.Util.Util.SetBindingValidation(System.Windows.Data.Binding,System.Boolean)">
          <a class="xref" href="C1.Util.Util.SetBindingValidation.html#C1_Util_Util_SetBindingValidation_System_Windows_Data_Binding_System_Boolean_">SetBindingValidation(Binding, bool)</a>
        </td>
        <td class="markdown level1 summary"><p>Turns validation on or off for a new given binding.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_SetFocus_System_Windows_Controls_Control_" data-uid="C1.Util.Util.SetFocus(System.Windows.Controls.Control)">
          <a class="xref" href="C1.Util.Util.SetFocus.html#C1_Util_Util_SetFocus_System_Windows_Controls_Control_">SetFocus(Control)</a>
        </td>
        <td class="markdown level1 summary"><p>Attempts to set the focus to a given control.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Util_Util_UpdateBindingSource_System_Windows_FrameworkElement_" data-uid="C1.Util.Util.UpdateBindingSource(System.Windows.FrameworkElement)">
          <a class="xref" href="C1.Util.Util.UpdateBindingSource.html#C1_Util_Util_UpdateBindingSource_System_Windows_FrameworkElement_">UpdateBindingSource(FrameworkElement)</a>
        </td>
        <td class="markdown level1 summary"><p>Updates the binding source for an editor cell (without waiting for it to lose focus).</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
