CustomComboControl.xaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <UserControl
  2. x:Class="PDF_Master.CustomControl.CompositeControl.CustomComboControl"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:convert="clr-namespace:PDF_Master.DataConvert"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:PDF_Master.CustomControl.CompositeControl"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. x:Name="usercontrol"
  10. d:DesignHeight="450"
  11. d:DesignWidth="800"
  12. Loaded="UserControl_Loaded"
  13. mc:Ignorable="d">
  14. <UserControl.Resources>
  15. <ResourceDictionary>
  16. <ResourceDictionary.MergedDictionaries>
  17. <ResourceDictionary Source="../../Styles/SliderStyle.xaml" />
  18. <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml" />
  19. </ResourceDictionary.MergedDictionaries>
  20. <convert:BoolToVisible x:Key="BoolToVisible" />
  21. <DataTemplate x:Key="numberData">
  22. <StackPanel Orientation="Horizontal">
  23. <!--<TextBlock
  24. HorizontalAlignment="Center"
  25. VerticalAlignment="Center"
  26. Text="*"
  27. Visibility="{Binding NeedFrontTag, Converter={StaticResource BoolToVisible}}" />-->
  28. <TextBlock
  29. HorizontalAlignment="Center"
  30. VerticalAlignment="Center"
  31. FontFamily="{Binding FontFamily}"
  32. Text="{Binding Content}" />
  33. </StackPanel>
  34. </DataTemplate>
  35. </ResourceDictionary>
  36. </UserControl.Resources>
  37. <Grid>
  38. <Grid>
  39. <Grid.ColumnDefinitions>
  40. <ColumnDefinition Width="*" />
  41. <ColumnDefinition Width="auto" />
  42. </Grid.ColumnDefinitions>
  43. <Border
  44. Height="32"
  45. HorizontalAlignment="Stretch"
  46. BorderBrush="#E2E3E6"
  47. BorderThickness="0">
  48. <Grid>
  49. <ComboBox
  50. Name="comBox"
  51. Padding="10"
  52. BorderBrush="#FFE2E3E6"
  53. BorderThickness="1"
  54. ItemTemplate="{StaticResource numberData}"
  55. MaxDropDownHeight="200"
  56. VirtualizingStackPanel.IsVirtualizing="True"
  57. VirtualizingStackPanel.VirtualizationMode="Standard">
  58. <ComboBox.ItemsPanel>
  59. <ItemsPanelTemplate>
  60. <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" />
  61. </ItemsPanelTemplate>
  62. </ComboBox.ItemsPanel>
  63. </ComboBox>
  64. <TextBox
  65. x:Name="title"
  66. Height="20"
  67. Margin="10,0,30,0"
  68. VerticalAlignment="Center"
  69. Background="White"
  70. BorderThickness="0"
  71. FontFamily="Segoe UI"
  72. FontSize="14"
  73. IsReadOnly="True"
  74. TextAlignment="Left" />
  75. </Grid>
  76. </Border>
  77. </Grid>
  78. </Grid>
  79. </UserControl>