So this problem seems awkwardly simple, but somehow I can't figure it out, so I will ask anyway ...
I want to use Visibilitythis way in CommandParameter KeyBinding(note the section <!--THIS LINE-->):
<Window ...
xmlns:sys="clr-namespace:System;assembly=System"
...>
...
<Window.InputBindings>
</Window.InputBindings>
<Grid DataContext="{StaticResource MainWindowVM}">
...
<ScrollViewer Grid.Column="0" Grid.Row="1" Background="Gray">
<ScrollViewer.InputBindings>
...
<KeyBinding Key="OemOpenBrackets" Command="{Binding EditLeftBarLineVisibilityCommand}" CommandParameter="{x:Static sys:Visibility.Visible}"/>
<KeyBinding Key="OemCloseBrackets" Command="{Binding EditRightBarLineVisibilityCommand}" CommandParameter="{x:Static sys:Visibility.Visible}"/>
</ScrollViewer.InputBindings>
...
</ScrollViewer>
</Grid>
But it seemed that:
The name "Visibility" does not exist in the namespace "clr: System namespace; assembly = System"
I look Visibilityin my virtual machine and is in System.Windows, but I can’t find that on XAML above ( System) is the closest I found, and it didn’t work out very well.
- , XAML? ( System.Windows XAML, , , , VM ?)
, ObjectDataProvider System Enum? ( ObjectDataProvider, )
P.S. MSDN: http://msdn.microsoft.com/en-us/library/system.windows.uielement.visibility%28v=vs.95%29.aspx