<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Add form validation to ProWindow in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/add-form-validation-to-prowindow/m-p/1690195#M13467</link>
    <description>&lt;P&gt;I am trying to add form validation to a custom ProWindow in my add-in. I implemented the IDataErrorInfo interface on my viewmodel, and added a style to controls that I want to validate, e.g.&lt;/P&gt;&lt;PRE class="lia-code-sample language-markup"&gt;&lt;CODE&gt;&amp;lt;Style TargetType="{x:Type FrameworkElement}" x:Key="ValidatingControl"&amp;gt;
    &amp;lt;Style.Triggers&amp;gt;
        &amp;lt;Trigger Property="Validation.HasError" Value="True"&amp;gt;
            &amp;lt;Setter Property="ToolTip" Value="{Binding Path=(Validation.Errors)[0].ErrorContent, RelativeSource={x:Static RelativeSource.Self}}" /&amp;gt;
        &amp;lt;/Trigger&amp;gt;
    &amp;lt;/Style.Triggers&amp;gt;
&amp;lt;/Style&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This adds a red border and sets a tooltip on the control if validation fails, so that all works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But there is one thing that I haven't been able to solve: When setting the style on the control, the colors do no longer match the ArcGIS Pro theme, but revert to the default black text on grey background (for combo boxes).&lt;/P&gt;&lt;P&gt;I tried setting the BasedOn property on the style, and also explicitly adding&amp;nbsp;&lt;EM&gt;Background="{DynamicResource Esri_BackgroundPressedBrush}" &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Foreground="{DynamicResource Esri_TextMenuBrush}"&lt;/EM&gt; to the style, or to the control itself, but both do not seem to do anything.&lt;/P&gt;&lt;P&gt;Does anyone have a working example of how to implement form validation?&lt;/P&gt;</description>
    <pubDate>Thu, 12 Mar 2026 13:22:44 GMT</pubDate>
    <dc:creator>ShareUser</dc:creator>
    <dc:date>2026-03-12T13:22:44Z</dc:date>
    <item>
      <title>Add form validation to ProWindow</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/add-form-validation-to-prowindow/m-p/1690195#M13467</link>
      <description>&lt;P&gt;I am trying to add form validation to a custom ProWindow in my add-in. I implemented the IDataErrorInfo interface on my viewmodel, and added a style to controls that I want to validate, e.g.&lt;/P&gt;&lt;PRE class="lia-code-sample language-markup"&gt;&lt;CODE&gt;&amp;lt;Style TargetType="{x:Type FrameworkElement}" x:Key="ValidatingControl"&amp;gt;
    &amp;lt;Style.Triggers&amp;gt;
        &amp;lt;Trigger Property="Validation.HasError" Value="True"&amp;gt;
            &amp;lt;Setter Property="ToolTip" Value="{Binding Path=(Validation.Errors)[0].ErrorContent, RelativeSource={x:Static RelativeSource.Self}}" /&amp;gt;
        &amp;lt;/Trigger&amp;gt;
    &amp;lt;/Style.Triggers&amp;gt;
&amp;lt;/Style&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This adds a red border and sets a tooltip on the control if validation fails, so that all works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But there is one thing that I haven't been able to solve: When setting the style on the control, the colors do no longer match the ArcGIS Pro theme, but revert to the default black text on grey background (for combo boxes).&lt;/P&gt;&lt;P&gt;I tried setting the BasedOn property on the style, and also explicitly adding&amp;nbsp;&lt;EM&gt;Background="{DynamicResource Esri_BackgroundPressedBrush}" &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Foreground="{DynamicResource Esri_TextMenuBrush}"&lt;/EM&gt; to the style, or to the control itself, but both do not seem to do anything.&lt;/P&gt;&lt;P&gt;Does anyone have a working example of how to implement form validation?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 13:22:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/add-form-validation-to-prowindow/m-p/1690195#M13467</guid>
      <dc:creator>ShareUser</dc:creator>
      <dc:date>2026-03-12T13:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Add form validation to ProWindow</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/add-form-validation-to-prowindow/m-p/1690568#M13468</link>
      <description>&lt;P&gt;I think it's best to apply a separate style for each control type that requires validation. For example, here's a ComboBox. Keep the BasedOn so it inherits the control's default style.&lt;/P&gt;&lt;PRE class="lia-code-sample language-csharp"&gt;&lt;CODE&gt;    &amp;lt;Style x:Key="ValidatingComboBox" TargetType="ComboBox" BasedOn="{StaticResource {x:Type ComboBox}}"&amp;gt;
      &amp;lt;Style.Triggers&amp;gt;
        &amp;lt;Trigger Property="Validation.HasError" Value="True"&amp;gt;
          &amp;lt;Setter Property="ToolTip" 
                  Value="{Binding (Validation.Errors)[0].ErrorContent,
                  RelativeSource={RelativeSource Self}}" /&amp;gt;
        &amp;lt;/Trigger&amp;gt;
      &amp;lt;/Style.Triggers&amp;gt;
    &amp;lt;/Style&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2026 18:33:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/add-form-validation-to-prowindow/m-p/1690568#M13468</guid>
      <dc:creator>ShareUser</dc:creator>
      <dc:date>2026-03-13T18:33:10Z</dc:date>
    </item>
  </channel>
</rss>

