12345678910111213141516171819202122232425262728293031323334353637383940 |
- <UserControl
- x:Class="PDF_Office.CustomControl.WritableComboBox"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:PDF_Office.CustomControl"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- d:DesignHeight="24"
- d:DesignWidth="200"
- mc:Ignorable="d">
- <Grid>
- <ComboBox
- x:Name="writableComboBox"
- Grid.Column="1"
- MinWidth="58"
- MinHeight="24"
- VerticalContentAlignment="Center"
- SelectionChanged="writableComboBox_SelectionChanged"
- SelectedIndex="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=SelectedIndex}"
- Visibility="Visible">
- <ComboBoxItem Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=IsAllPageVisible}">全部页面</ComboBoxItem>
- <ComboBoxItem>奇数页</ComboBoxItem>
- <ComboBoxItem IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=EvenPageIsEnabled}">偶数页</ComboBoxItem>
- <ComboBoxItem>自定义页面</ComboBoxItem>
- </ComboBox>
- <TextBox
- x:Name="writableTextBox"
- Grid.Column="0"
- Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=Text}"
- MinHeight="{Binding ElementName=writableComboBox, Path=MinHeight}"
- HorizontalAlignment="Left"
- VerticalContentAlignment="Center"
- TextChanged="writableTextBox_TextChange"
- Visibility="Hidden"
- Panel.ZIndex="1"
- />
- </Grid>
- </UserControl>
|