Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Wouterdek/NodeNetwork
Browse files Browse the repository at this point in the history
  • Loading branch information
Wouterdek committed Dec 6, 2020
2 parents 843653c + 43dfe09 commit 88e3c03
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 9 additions & 0 deletions ExampleShaderEditorApp/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ExampleShaderEditorApp"
StartupUri="Views/MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<!--There is a timing issue in WPF when setting the ItemsSource of a Menu (in this case ContextMenu) to a collection. It leads to WPF binding error 'System.Windows.Data Error: 4'. The following workaround gets rid of those falsely reported errors.-->
<Style TargetType="MenuItem">
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
<Setter Property="CommandParameter" Value="{Binding CommandParameter}"/>
</Style.Setters>
</Style>
</ContextMenu.Resources>
<ContextMenu.ItemTemplate>
<DataTemplate DataType="{x:Type local:LabeledCommand}">
<TextBlock><Run Text="{Binding Label}"/></TextBlock>
</DataTemplate>
</ContextMenu.ItemTemplate>
</ContextMenu.Resources>
<ContextMenu.ItemsSource>
<CompositeCollection>
<MenuItem x:Name="SearchMenuItem" StaysOpenOnClick="True">
Expand Down

0 comments on commit 88e3c03

Please sign in to comment.