Skip to content

Commit ec3a97b

Browse files
committed
some change
1 parent 303bcf7 commit ec3a97b

17 files changed

+231
-94
lines changed

SimpleStateMachineNodeEditor/App.xaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
<ResourceDictionary Source="Styles/ErrorList/StyleExpander.xaml"/>
1616
<ResourceDictionary Source="Styles/ErrorList/StyleScrollBar.xaml"/>
1717
<ResourceDictionary Source="Styles/ErrorList/StyleScrollViewer.xaml"/>
18-
1918
<ResourceDictionary Source="Styles/ErrorList/TemplateListBox.xaml"/>
2019
<ResourceDictionary Source="Styles/ErrorList/StyleLabel.xaml"/>
2120
<ResourceDictionary Source="Styles/ErrorList/StyleListBoxItem.xaml"/>
2221
<ResourceDictionary Source="Styles/ErrorList/StyleLabelWithIcon.xaml"/>
23-
22+
23+
24+
<ResourceDictionary Source="Styles/TableOfTransitions/StyleListBoxTransitionsItem.xaml"/>
2425

2526

2627
<!--#region Test-->

SimpleStateMachineNodeEditor/Styles/ErrorList/StyleListBoxItem.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Setter Property="Template">
77
<Setter.Value>
88
<ControlTemplate TargetType="ListBoxItem">
9-
<Border Name="Border" SnapsToDevicePixels="true">
9+
<Border Name="Border" SnapsToDevicePixels="true" Background="#00000000">
1010
<ContentPresenter />
1111
</Border>
1212
<ControlTemplate.Triggers>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
3+
4+
<!--OpacityMask - Background on Selected-->
5+
<Style x:Key="StyleListBoxTransitionsItem" TargetType="{x:Type ListBoxItem}">
6+
<Setter Property="Template">
7+
<Setter.Value>
8+
<ControlTemplate TargetType="ListBoxItem">
9+
<Border Name="Border" SnapsToDevicePixels="true" Background="#00000000">
10+
<ContentPresenter />
11+
</Border>
12+
<ControlTemplate.Triggers>
13+
<!--<Trigger Property="ItemsControl.AlternationIndex" Value="0">
14+
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ColorNodesCanvasBackground}"></Setter>
15+
</Trigger>
16+
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
17+
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ColorMessagesBackground}"></Setter>
18+
</Trigger>-->
19+
<Trigger Property="IsSelected" Value="true">
20+
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ColorElementMouseOver}"/>
21+
<Setter Property="Foreground" Value="{DynamicResource ColorMessagesForegroundSelected}"/>
22+
</Trigger>
23+
</ControlTemplate.Triggers>
24+
</ControlTemplate>
25+
</Setter.Value>
26+
</Setter>
27+
</Style>
28+
</ResourceDictionary>

SimpleStateMachineNodeEditor/View/MainWindow.xaml

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,46 @@
179179
</TabItem>
180180
<!--<TabItem Header="Transitions table" ToolTip="" Style="{DynamicResource StyleTabItem}" Foreground="{DynamicResource ColorForeground}"/>-->
181181
<TabItem Header="Transitions table" Style="{DynamicResource StyleTabItem}" Background="{DynamicResource ColorWindowHeader}" Foreground="{DynamicResource ColorWindowHeaderTabItemForeground}" BorderBrush="{DynamicResource ColorElementMouseOver}" OpacityMask="{DynamicResource ColorElementMouseOver}">
182-
<DataGrid x:Name="TableOfTransitions">
183-
<DataGridTemplateColumn Header="Address">
184-
<DataGridTemplateColumn.CellTemplate>
185-
<DataTemplate>
186-
<TextBox Text="{Binding Path=Name}"/>
187-
</DataTemplate>
188-
</DataGridTemplateColumn.CellTemplate>
189-
</DataGridTemplateColumn>
190-
</DataGrid>
182+
183+
<ListBox x:Name="TableOfTransitions" Template="{DynamicResource TemplateListBox}" Background="{DynamicResource ColorWindowHeader}" BorderBrush="{DynamicResource ColorMessagesBorder}" Foreground="{DynamicResource ColorMessagesForeground}" ItemContainerStyle="{DynamicResource StyleListBoxTransitionsItem}" AlternationCount="2"
184+
VirtualizingStackPanel.IsVirtualizing="True"
185+
VirtualizingStackPanel.VirtualizationMode="Recycling"
186+
VirtualizingStackPanel.CacheLength="1"
187+
VirtualizingStackPanel.CacheLengthUnit="Page"
188+
VirtualizingStackPanel.ScrollUnit="Pixel">
189+
<ListBox.Resources>
190+
<ControlTemplate x:Key="GroupItemTemplate" TargetType="{x:Type GroupItem}">
191+
<DockPanel>
192+
<Separator DockPanel.Dock="Left" Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
193+
<StackPanel>
194+
<ContentPresenter />
195+
<!-- This will be automatically wired -->
196+
<ItemsPresenter Margin="5,0,0,0" />
197+
<!-- So will this -->
198+
</StackPanel>
199+
</DockPanel>
200+
</ControlTemplate>
201+
</ListBox.Resources>
202+
<ListBox.GroupStyle>
203+
<GroupStyle>
204+
<GroupStyle.HeaderTemplate>
205+
<DataTemplate>
206+
<TextBlock Text="{Binding Path=Name}" FontWeight="Bold" />
207+
</DataTemplate>
208+
</GroupStyle.HeaderTemplate>
209+
<GroupStyle.ContainerStyle>
210+
<Style TargetType="{x:Type GroupItem}">
211+
<Setter Property="Template" Value="{StaticResource GroupItemTemplate}" />
212+
</Style>
213+
</GroupStyle.ContainerStyle>
214+
</GroupStyle>
215+
</ListBox.GroupStyle>
216+
<ListBox.ItemTemplate>
217+
<DataTemplate>
218+
<view:ViewTableOfTransitionsItem ViewModel="{Binding}" />
219+
</DataTemplate>
220+
</ListBox.ItemTemplate>
221+
</ListBox>
191222
</TabItem>
192223
</TabControl>
193224
<!--#endregion Tabs-->

SimpleStateMachineNodeEditor/View/MainWindow.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ private void SetupBinding()
5959

6060
this.WhenActivated(disposable =>
6161
{
62-
this.OneWayBind(this.ViewModel, x => x.Tests, x => x.TableOfTransitions.ItemsSource).DisposeWith(disposable);
62+
//this.OneWayBind(this.ViewModel, x => x.Tests, x => x.TableOfTransitions.ItemsSource).DisposeWith(disposable);
6363

6464
var SelectedItem = this.ObservableForProperty(x => x.MessageList.SelectedItem).Select(x=>(x.Value as ViewModelMessage)?.Text);
6565
this.BindCommand(this.ViewModel, x => x.CommandCopyError, x => x.BindingCopyError, SelectedItem).DisposeWith(disposable);
6666
this.BindCommand(this.ViewModel, x => x.CommandCopyError, x => x.ItemCopyError, SelectedItem).DisposeWith(disposable);
6767

6868
this.OneWayBind(this.ViewModel, x => x.NodesCanvas.Dialog, x => x.Dialog.ViewModel).DisposeWith(disposable);
69-
69+
this.OneWayBind(this.ViewModel, x => x.Transitions, x => x.TableOfTransitions.ItemsSource).DisposeWith(disposable);
7070
this.OneWayBind(this.ViewModel, x => x.Messages, x => x.MessageList.ItemsSource).DisposeWith(disposable);
7171
this.OneWayBind(this.ViewModel, x => x.DebugEnable, x => x.LabelDebug.Visibility).DisposeWith(disposable);
7272

SimpleStateMachineNodeEditor/View/Test.xaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

SimpleStateMachineNodeEditor/View/Test.xaml.cs

Lines changed: 0 additions & 53 deletions
This file was deleted.

SimpleStateMachineNodeEditor/View/ViewMessage.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<ColumnDefinition Width="auto" SharedSizeGroup="Icons"/>
1212
<ColumnDefinition />
1313
</Grid.ColumnDefinitions>
14-
<Rectangle Grid.Column="0" x:Name="RectangleElement" Height="14" Width="14" VerticalAlignment="Center" Margin="5,2,0,0"/> <!---->
15-
<TextBlock Grid.Column="1" Text="TestTestTest" x:Name="TextBlockElement" Height="auto" VerticalAlignment="Center" TextWrapping="Wrap" Padding="5,3,3,3" /> <!--Margin="3"-->
14+
<Rectangle Grid.Column="0" x:Name="RectangleElement" Height="14" Width="14" VerticalAlignment="Center" Margin="5,2,0,0"/>
15+
<TextBlock Grid.Column="1" x:Name="TextBlockElement" Height="auto" VerticalAlignment="Center" TextWrapping="Wrap" Padding="5,3,3,3" />
1616
</Grid>
1717

1818
</UserControl>

SimpleStateMachineNodeEditor/View/ViewNode.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private void SetupBinding()
7979

8080
this.OneWayBind(this.ViewModel, x => x.Output, x => x.Output.ViewModel).DisposeWith(disposable);
8181

82-
this.OneWayBind(this.ViewModel, x => x.Transitions2, x => x.ItemsControlTransitions.ItemsSource).DisposeWith(disposable);
82+
this.OneWayBind(this.ViewModel, x => x.TransitionsForView, x => x.ItemsControlTransitions.ItemsSource).DisposeWith(disposable);
8383

8484
this.WhenAnyValue(v => v.NodeHeaderElement.ActualWidth).BindTo(this, v => v.ViewModel.HeaderWidth).DisposeWith(disposable);
8585

SimpleStateMachineNodeEditor/View/ViewNodesCanvas.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private void SetupBinding()
6464
this.WhenActivated(disposable =>
6565
{
6666

67-
this.OneWayBind(this.ViewModel, x => x.Nodes2, x => x.Nodes.Collection).DisposeWith(disposable);
67+
this.OneWayBind(this.ViewModel, x => x.NodesForView, x => x.Nodes.Collection).DisposeWith(disposable);
6868

6969
this.OneWayBind(this.ViewModel, x => x.Connects, x => x.Connects.Collection).DisposeWith(disposable);
7070

0 commit comments

Comments
 (0)