12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <UserControl
- x:Class="PDF_Master.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_Master.CustomControl"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- d:DesignHeight="24"
- d:DesignWidth="200"
- Loaded="UserControl_Loaded"
- mc:Ignorable="d">
- <Grid>
- <ComboBox
- x:Name="writableComboBox"
- Grid.Column="1"
- MinWidth="58"
- MinHeight="24"
- VerticalContentAlignment="Center"
- SelectedIndex="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=SelectedIndex}"
- SelectionChanged="writableComboBox_SelectionChanged"
- Visibility="Visible">
- <ComboBoxItem x:Name="AllPageItem" Tag="AllPage" Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=IsAllPageVisible}"/>
- <ComboBoxItem x:Name="OddPageItem" Tag="OddPage"/>
- <ComboBoxItem x:Name="EvenPageItem" IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=EvenPageIsEnabled}" Tag="EvenPage"/>
- <ComboBoxItem x:Name="CustomPageItem" Tag="CustomPage"/>
- </ComboBox>
- <TextBox
- x:Name="writableTextBox"
- Grid.Column="0"
- MinHeight="{Binding ElementName=writableComboBox, Path=MinHeight}"
- BorderBrush="{x:Null}"
- BorderThickness="0"
- Margin="2"
- HorizontalAlignment="Left"
- VerticalContentAlignment="Center"
- Panel.ZIndex="1"
- LostFocus="writableTextBox_LostFocus"
- PreviewKeyDown="writableTextBox_PreviewKeyDown"
- Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=Text}"
- TextChanged="writableTextBox_TextChange"
- Visibility="Hidden" />
- </Grid>
- </UserControl>
|