Note that there are some explanatory texts on larger screens.

plurals
  1. PObind the date of the DatePicker to ConverterParameter
    text
    copied!<p>I'm trying to mark Names in a ComboBox based on a Date from a DatePicker using a converter class.</p> <p>My current problem is I don't know how to bind the date of the DatePicker to the "ConverterParameter". Any suggestions?</p> <p>(probably more errors in my code but i'm stuck at this point)</p> <pre><code>&lt;Page.Resources&gt; &lt;Style TargetType="ComboBoxItem" x:Key="combostyle"&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="ComboBoxItem"&gt; &lt;ControlTemplate.Resources&gt; &lt;src:ColorFromMagazijnierIdConverter x:Key="conv" /&gt; &lt;/ControlTemplate.Resources&gt; &lt;Grid ToolTip="{Binding Converter={StaticResource conv}, ConverterParameter={ BIND THIS TO THE DATEPICKER DATE }, Mode=OneWay}"&gt; &lt;Rectangle x:Name="MarkedItemBackground" IsHitTestVisible="False" Fill="#80FF0000" /&gt; &lt;!--...--&gt; &lt;/Grid&gt; &lt;ControlTemplate.Triggers&gt; &lt;DataTrigger Binding="{Binding Converter={StaticResource conv}}" Value="{x:Null}"&gt; &lt;Setter TargetName="MarkedItemBackground" Property="Visibility" Value="Hidden" /&gt; &lt;/DataTrigger&gt; &lt;/ControlTemplate.Triggers&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; &lt;/Page.Resources&gt; &lt;Grid Margin="10,10,10,0" Name="rootGrid"&gt; &lt;ComboBox Name="collectMagazijnierComboBox" DisplayMemberPath="User.Name" ItemContainerStyle="{DynamicResource ResourceKey=combostyle}"/&gt; &lt;DatePicker Name="collectDatePicker" /&gt; &lt;/Grid&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload