This project has moved. For the latest updates, please go here.

TimePicker + Binding Validation Rules

May 24, 2011 at 6:25 PM

Is it possible to setup Binding Validation Rules in XAML when using the TimePicker control? When I try to do something like the following I get an error that it does not suppor "Direct Content". Does anyone know if there is way to do this?

 

<extToolkit:TimePicker>
     <Binding>
          <Binding.Validation>
          </Binding.Validation>
     </Binding>
</TimePicker>
Steve
May 24, 2011 at 7:10 PM

I think you are looking for something like this:

        <extToolkit:TimePicker>
            <extToolkit:TimePicker.Value>
                <Binding Path="Date">
                    <Binding.ValidationRules>
                        <ExceptionValidationRule/>
                    </Binding.ValidationRules>
                </Binding>
            </extToolkit:TimePicker.Value>
        </extToolkit:TimePicker>
May 24, 2011 at 10:41 PM

It was the PATH=Date that I could not figure out. Now that I see it, kinda obvious.

I'm new to WPF and .NET and development in general. How should I have been able to find that out? Is there a way to browse objects to find things like that?

 

Thanks for the quick response,

Steve