Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't know of any existing controls. However you could try using a calendar control with a behaviour to translate a selection into a range selection of of the entire week.</p> <p>For example:</p> <pre><code>&lt;sdk:Calendar HorizontalAlignment="Left" Margin="8,8,0,120" Width="187"&gt; &lt;i:Interaction.Behaviors&gt; &lt;local:SelectWeekBehaviour /&gt; &lt;/i:Interaction.Behaviors&gt; &lt;/sdk:Calendar&gt; </code></pre> <p>With the behaviour being:</p> <pre><code>public class SelectWeekBehaviour : Behavior&lt;Calendar&gt; { private void DateChanged(object sender, SelectionChangedEventArgs e) { UnsubscribeFromSelectionNotifications(); var selectedDate = AssociatedObject.SelectedDate; if (selectedDate.HasValue) { var dayOfWeek = (int)selectedDate.Value.DayOfWeek; var firstDate = selectedDate.Value.AddDays(-dayOfWeek); var lastDate = selectedDate.Value.AddDays(6 - dayOfWeek); AssociatedObject.SelectedDates.Clear(); AssociatedObject.SelectedDates.AddRange(firstDate, lastDate); } SubscribeToSelectionNotifications(); } protected override void OnAttached() { base.OnAttached(); AssociatedObject.SelectionMode = CalendarSelectionMode.SingleRange; AssociatedObject.FirstDayOfWeek = DayOfWeek.Sunday; SubscribeToSelectionNotifications(); } protected override void OnDetaching() { base.OnDetaching(); UnsubscribeFromSelectionNotifications(); } private void SubscribeToSelectionNotifications() { AssociatedObject.SelectedDatesChanged += DateChanged; } private void UnsubscribeFromSelectionNotifications() { AssociatedObject.SelectedDatesChanged -= DateChanged; } } </code></pre> <p>The behaviour is not quite production ready since I forced the week to start on sunday to make easy to figure out the start and end of the week.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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