Skip to content

Commit

Permalink
Merge pull request #99 from FabianNitsche/wpfBinding
Browse files Browse the repository at this point in the history
Fixed a WPF issue causing binding errors.
  • Loading branch information
Wouterdek authored Dec 6, 2020
2 parents b679be3 + c34191f commit 42c85aa
Showing 1 changed file with 9 additions and 0 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>

0 comments on commit 42c85aa

Please sign in to comment.