Guest User

Untitled

a guest
Jul 21st, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. <ComboBox Name="cboCombo" IsReadOnly="True" IsEditable="True" Foreground="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=Foreground}" DropDownOpened="cboCombo_DropDownOpened" DropDownClosed="cboCombo_DropDownClosed">
  2. <ComboBox.Text>
  3. <MultiBinding Converter="{StaticResource DateTimeTextConverter}" Mode="OneWay">
  4. <Binding RelativeSource="{RelativeSource FindAncestor,AncestorType={x:Type UserControl}}" Path="SelectedDateAndTime" Mode="OneWay" />
  5. <Binding RelativeSource="{RelativeSource FindAncestor,AncestorType={x:Type UserControl}}" Path="ShowTime" />
  6. </MultiBinding>
  7. </ComboBox.Text>
  8. <ComboBoxItem IsSelected="True">
  9. <ComboBoxItem.Template>
  10. <ControlTemplate>
  11. <Grid>
  12. <Grid.RowDefinitions>
  13. <RowDefinition Height="Auto" />
  14. <RowDefinition Height="Auto" />
  15. <RowDefinition Height="Auto" />
  16. <RowDefinition Height="Auto" />
  17. </Grid.RowDefinitions>
  18.  
  19. <Grid.ColumnDefinitions>
  20. <ColumnDefinition Width="*" />
  21. <ColumnDefinition Width="*" />
  22. </Grid.ColumnDefinitions>
  23.  
  24. <DatePicker Grid.Row="0" Grid.Column="0" SelectedDate="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=SelectedDateAndTime}" SelectedDateChanged="BCDatePicker_SelectedDateChanged" />
  25. <controls:TimePicker Grid.Row="0" Grid.Column="1" MouseUp="TimePicker_MouseUp" Loaded="TimePicker_Loaded" Time="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=SelectedDateAndTime,Mode=OneWay}" Visibility="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=ShowTime, Converter={StaticResource VisibilityConverter}}" />
  26.  
  27. <Button Grid.Row="1" Grid.Column="0" Content="Today" Click="Button_Click" />
  28. <Button Grid.Row="1" Grid.Column="1" Content="Clear" Click="Button_Click_1" />
  29.  
  30. <Button Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Content="View Date Calculator" Click="Button_Click_2" Visibility="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=ShowDateCalculator,Mode=OneWay,Converter={StaticResource VisibilityConverter}}" />
  31.  
  32. <Label Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Content="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=SelectedDateAndTime,Mode=OneWay,Converter={StaticResource HolidayDateConverter}}" Foreground="Red" />
  33. </Grid>
  34. </ControlTemplate>
  35. </ComboBoxItem.Template>
  36. </ComboBoxItem>
  37. </ComboBox>
Add Comment
Please, Sign In to add comment