Files
BeWoPlaner/BeWo/View/VarFieldEditControl.xaml

116 lines
4.8 KiB
Plaintext
Raw Permalink Normal View History

<UserControl
x:Class="BeWo.View.VarFieldEditControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:localcore="clr-namespace:BeWo.Core"
xmlns:shared="clr-namespace:BS.Shared;assembly=BS.Shared"
HorizontalAlignment="Stretch"
VerticalAlignment="Top">
2016-06-27 01:45:38 +02:00
<UserControl.Resources>
2016-06-27 01:45:38 +02:00
<dxe:DateEdit
x:Key="{x:Static shared:ControlType.DatePicker}"
Grid.Column="1"
Margin="3"
VerticalAlignment="Top"
AllowNullInput="True"
EditValue="{Binding VarFieldValue, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
MaskType="DateTimeAdvancingCaret" />
<CheckBox
x:Key="{x:Static shared:ControlType.CheckBox}"
Grid.Column="1"
Margin="3,6,3,3"
Foreground="Black"
IsChecked="{Binding VarFieldValueBoolean}"
IsThreeState="False" />
<TextBox
x:Key="{x:Static shared:ControlType.TextBox}"
Grid.Column="1"
Height="{Binding Height, Mode=OneWay}"
Margin="3"
VerticalContentAlignment="Center"
Foreground="Black"
Text="{Binding VarFieldValue, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
<TextBox
x:Key="{x:Static shared:ControlType.MemoBox}"
Grid.Column="1"
Height="{Binding Height, Mode=OneWay}"
Margin="3"
AcceptsReturn="True"
AutoWordSelection="True"
Foreground="Black"
HorizontalScrollBarVisibility="Hidden"
Text="{Binding VarFieldValue, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
TextWrapping="Wrap"
VerticalScrollBarVisibility="Auto" />
<dxe:TextEdit
x:Key="{x:Static shared:ControlType.NumericTextBox}"
x:Name="tb_numeric"
Grid.Column="1"
Height="{Binding Height, Mode=OneWay}"
Margin="3"
EditValue="{Binding VarFieldValue}"
Mask="########0.00"
MaskType="Numeric"
MaskUseAsDisplayFormat="True" />
<ComboBox
x:Key="{x:Static shared:ControlType.ComboBox}"
Grid.Column="1"
Margin="3"
Foreground="Black"
ItemsSource="{Binding PossibleItems}"
SelectedItem="{Binding VarFieldValue}" />
2016-06-27 01:45:38 +02:00
<ListBox
x:Key="{x:Static shared:ControlType.CheckBoxList}"
Grid.Column="1"
Height="{Binding Height, Mode=OneWay}"
Margin="3"
localcore:BeWoWpfUtils.SelectedItemsList="{Binding VarFieldValue}"
Foreground="Black"
ItemsSource="{Binding PossibleItems}"
SelectionMode="Multiple">
<ListBox.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
<Style TargetType="ListBoxItem">
<Setter Property="Background" Value="Transparent" />
</Style>
</ListBox.Resources>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel MaxHeight="{Binding ElementName=ItemsControlScroller, Path=ActualHeight}" Orientation="Vertical" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<DockPanel Margin="4,0,4,0">
<CheckBox VerticalAlignment="Center" IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}, Path=IsSelected, Mode=TwoWay}" />
<Label Content="{Binding}" />
</DockPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</UserControl.Resources>
2016-06-27 01:45:38 +02:00
<Grid
x:Name="grid_root"
Grid.Row="{Binding YCoordinate}"
Grid.Column="{Binding XCoordinate}"
HorizontalAlignment="Stretch"
VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="{Binding XCoordinate, StringFormat=lblCol{0}}" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock
Margin="3,6,3,3"
Foreground="Black"
Text="{Binding Label}" />
</Grid>
2016-06-27 01:45:38 +02:00
</UserControl>