I have the following struct
:
public struct StreamContainer
{
public string Name { get; set; }
public bool IsVisible { get; set; }
public Canvas Canvas { get; set; }
}
The following private member:
private ObservableCollection <StreamContainer> m_listOfStreams = new ObservableCollection<StreamContainer>();
An the following property:
public ObservableCollection<StreamContainer> ListOfStreams
{
get { return m_listOfStreams; }
set
{
m_listOfStreams = value;
OnPropertyChanged();
}
}
In my 'Xaml', I have this:
<MenuItem x:Name="StreamsMenu" Header="Streams" Foreground="DarkRed" Focusable="False">
<MenuItem x:Name="ColorStream" Header="Color" IsCheckable="True" IsChecked="True" Foreground="DarkRed" Click="SelectStream_OnClick"/>
<MenuItem x:Name="GrayStream" Header="Depth" IsCheckable="True" Foreground="DarkRed" Click="SelectStream_OnClick"/>
</MenuItem>
Is it possible to bind each of the MenuItems
IsChecked
property (ColorStream
and GrayStream
) to their matching IsVisible
property? Meaning, for example, that the IsChecked
property of the ColorStream
will be binded to the 'IsVisible' property of first item in the ObservableCollection
.