|
5 | 5 | <Grid>
|
6 | 6 | <Grid.ColumnDefinitions>
|
7 | 7 | <ColumnDefinition Width="*"/>
|
8 |
| - <ColumnDefinition Name="ValueColumn" Width="{Binding SelectedItem, Converter={StaticResource ValueColumnWidthConverter}, ElementName=DmxTree, Mode=OneWay}"/> |
| 8 | + <ColumnDefinition Width="*"/> |
9 | 9 | </Grid.ColumnDefinitions>
|
10 | 10 | <Grid.RowDefinitions>
|
11 | 11 | <RowDefinition Height="Auto" />
|
|
18 | 18 | MouseDown="ResetRoot_Click" ToolTip="Return to the root element"/>
|
19 | 19 | </Grid>
|
20 | 20 |
|
21 |
| - <c:TreeGridView x:Name="DmxTree" Grid.Row="1" Grid.Column="0" ItemsSource="{Binding}" ChildItemsSelector="{Binding Converter={StaticResource ChildPathConverter}}" |
22 |
| - UseLayoutRounding="True" d:DataContext="{Binding Path=AllElements}" TitleColumnHeader="Name"> |
| 21 | + <c:TreeGridView x:Name="DmxTree" Grid.Row="1" Grid.Column="0" ItemsSource="{Binding Converter={StaticResource EnsureElementConverter}}" ChildItemsSelector="{Binding Converter={StaticResource ChildPathConverter}}" |
| 22 | + UseLayoutRounding="True" d:DataContext="{Binding Path=AllElements}" TitleColumnHeader="Name" Loaded="DmxTree_Loaded"> |
23 | 23 | <c:TreeGridView.ColumnDefinitions>
|
24 | 24 | <c:TreeGridContentColumnDefinition Header="Type" Binding="{Binding Converter={StaticResource GetFriendlyTypeName}}">
|
25 | 25 | <c:TreeGridContentColumnDefinition.CellStyle>
|
26 |
| - <Style TargetType="c:TreeGridViewCell"> |
27 |
| - <Setter Property="Foreground" Value="Gray"/> |
| 26 | + <Style TargetType="Control"> |
| 27 | + <Setter Property="Control.Opacity" Value="0.5"/> |
| 28 | + <Setter Property="IsTabStop" Value="False"/> |
28 | 29 | </Style>
|
29 | 30 | </c:TreeGridContentColumnDefinition.CellStyle>
|
30 | 31 | </c:TreeGridContentColumnDefinition>
|
|
35 | 36 | <ContentControl Content="{Binding}"/>
|
36 | 37 | </DataTemplate>
|
37 | 38 | </c:TreeGridView.TitleTemplate>
|
38 |
| - |
| 39 | + |
39 | 40 | <c:TreeGridView.Resources>
|
40 | 41 | <DataTemplate DataType="{x:Type dm:Attribute}">
|
41 | 42 | <StackPanel Orientation="Horizontal" Margin="0,0,5,0" VerticalAlignment="Center">
|
|
58 | 59 | </c:TreeGridView>
|
59 | 60 |
|
60 | 61 | <GridSplitter Grid.Column="1" Grid.Row="1" Width="2" VerticalAlignment="Stretch" HorizontalAlignment="Left" ResizeDirection="Columns"/>
|
61 |
| - |
| 62 | + |
62 | 63 | <Grid Name="AttributeProperties" Grid.Column="1" Grid.Row="1" Margin="5,0" Background="{DynamicResource {x:Static SystemColors.WindowColor}}"
|
63 |
| - d:DataContext="{Binding Path=Root[model]}" DataContext="{Binding ElementName=DmxTree, Path=SelectedItem}" Visibility="{Binding ElementName=ValueColumn,Path=Width,Converter={StaticResource ValuePanelVisibilityConverter}}"> |
64 |
| - <ContentControl Content="{Binding Converter={StaticResource GetAttributeValue}}" ContentTemplateSelector="{StaticResource InspectPaneTemplateSelector}" /> |
| 64 | + Visibility="{Binding ElementName=DmxTree, Path=SelectedItem, Converter={StaticResource VisibleIfNotNull},FallbackValue=Visible}" |
| 65 | + d:DataContext="{Binding Path=Root}" DataContext="{Binding ElementName=DmxTree, Path=SelectedItem}"> |
| 66 | + <Grid.RowDefinitions> |
| 67 | + <RowDefinition Height="Auto" /> |
| 68 | + <RowDefinition Height="*" /> |
| 69 | + </Grid.RowDefinitions> |
| 70 | + <Grid.Resources> |
| 71 | + <Style TargetType="c:LabelledControl"> |
| 72 | + <Setter Property="LabelWidth" Value="45"/> |
| 73 | + <Setter Property="Margin" Value="3,0"/> |
| 74 | + </Style> |
| 75 | + <Style TargetType="GroupBox"> |
| 76 | + <Setter Property="Margin" Value="0,3"/> |
| 77 | + <Setter Property="Padding" Value="5"/> |
| 78 | + </Style> |
| 79 | + </Grid.Resources> |
| 80 | + <GroupBox Header="Element" DataContext="{Binding Converter={StaticResource EnsureElementConverter}}"> |
| 81 | + <StackPanel> |
| 82 | + <c:LabelledControl LabelText="Name:"> |
| 83 | + <TextBox Text="{Binding Path=Name}" /> |
| 84 | + </c:LabelledControl> |
| 85 | + |
| 86 | + <c:LabelledControl LabelText="Class:"> |
| 87 | + <TextBox Text="{Binding Path=ClassName}" /> |
| 88 | + </c:LabelledControl> |
| 89 | + |
| 90 | + <c:LabelledControl LabelText="GUID:"> |
| 91 | + <TextBox Text="{Binding Path=ID,Mode=OneWay}" IsReadOnly="True" BorderThickness="0" Background="Transparent" FontFamily="Consolas" /> |
| 92 | + </c:LabelledControl> |
| 93 | + </StackPanel> |
| 94 | + </GroupBox> |
| 95 | + |
| 96 | + <GroupBox Grid.Row="1" Header="Attribute"> |
| 97 | + <Grid> |
| 98 | + <Grid.RowDefinitions> |
| 99 | + <RowDefinition Height="Auto"/> |
| 100 | + <RowDefinition Height="Auto"/> |
| 101 | + <RowDefinition Height="*"/> |
| 102 | + <RowDefinition Height="Auto"/> |
| 103 | + </Grid.RowDefinitions> |
| 104 | + <c:LabelledControl LabelText="Name:" Grid.Row="0"> |
| 105 | + <TextBox Text="{Binding Path=Name}" /> |
| 106 | + </c:LabelledControl> |
| 107 | + <c:LabelledControl LabelText="Type:" Grid.Row="1"> |
| 108 | + <TextBlock Text="{Binding Converter={StaticResource GetFriendlyTypeName}}"/> |
| 109 | + <!--<ComboBox ItemsSource="{x:Static dm:Datamodel.AttributeTypes}" SelectedItem="{Binding Converter={StaticResource DebugConverter}}" ItemTemplate="{Binding Converter={StaticResource GetFriendlyTypeName}}"/>--> |
| 110 | + </c:LabelledControl> |
| 111 | + <c:LabelledControl LabelText="Value:" Grid.Row="2"> |
| 112 | + <ContentPresenter Content="{Binding}" ContentTemplateSelector="{StaticResource InspectPaneTemplateSelector}"/> |
| 113 | + </c:LabelledControl> |
| 114 | + <StackPanel Orientation="Horizontal" Grid.Row="3"> |
| 115 | + <Button Content="Delete" Click="DeleteButton_Click"/> |
| 116 | + </StackPanel> |
| 117 | + </Grid> |
| 118 | + </GroupBox> |
65 | 119 | </Grid>
|
66 | 120 | </Grid>
|
67 | 121 | </UserControl>
|
0 commit comments