-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bind.xaml
34 lines (34 loc) · 2.42 KB
/
Bind.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<UserControl x:Class="SwitchableProperties.Bind"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SwitchableProperties"
xmlns:ui="clr-namespace:SimHub.Plugins.UI;assembly=SimHub.Plugins"
xmlns:styles="clr-namespace:SimHub.Plugins.Styles;assembly=SimHub.Plugins"
mc:Ignorable="d"
d:DesignHeight="30" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Bind Name" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<Label Grid.Row="0" Grid.Column="2" Content="Property Value" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<TextBox x:Name="txtBindName" Grid.Row="0" Grid.Column="1" TextWrapping="NoWrap" Text="{Binding NameTextBoxValue}" BorderBrush="{Binding BorderBrush}" Margin="5,2,20,2" VerticalContentAlignment="Center"/>
<TextBox x:Name="txtBindValue" Grid.Row="0" Grid.Column="3" TextWrapping="NoWrap" Text="{Binding PropertyValue}" Margin="5,2,6,2" VerticalContentAlignment="Center"/>
<ui:ControlsEditor Grid.Row="0" Grid.Column="4">
<ui:ControlsEditor.ActionName>
<MultiBinding StringFormat='SwitchablePropertiesPlugin.{0}_{1}'>
<Binding Path="DataContext.PropertyName" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type local:Property}}"/>
<Binding Path="ActionName"/>
</MultiBinding>
</ui:ControlsEditor.ActionName>
</ui:ControlsEditor>
<styles:SHButtonPrimary Grid.Row="0" Grid.Column="5" x:Name="btnDelete" Command="{x:Static local:Property.DeleteBindCommand}" CommandParameter="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Bind}}}" HorizontalAlignment="Right" VerticalAlignment="Center">Delete</styles:SHButtonPrimary>
</Grid>
</UserControl>