Commit 3f2501e4 by liulongfei

添加NDI本地源筛选

parent 8a97931a
...@@ -41,8 +41,14 @@ ...@@ -41,8 +41,14 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- 输入源 --> <!-- 输入源 -->
<TextBlock Text="输入源" Foreground="White" FontSize="18" VerticalAlignment="Center"></TextBlock> <TextBlock Text="输入源" Foreground="White" FontSize="18" VerticalAlignment="Center"></TextBlock>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right">
<TextBlock Text="仅显示本机输入源" Foreground="#aaffffff" VerticalAlignment="Center"></TextBlock>
<CheckBox Style="{StaticResource CheckBox_Setting}" VerticalAlignment="Center"
HorizontalAlignment="Right" Margin="10,0,0,0"
IsChecked="{Binding Path=IsShowLocalStream,Mode=TwoWay}"></CheckBox>
</StackPanel>
<ComboBox Grid.Row="1" Style="{StaticResource ComboBox_Setting}" Height="40" <ComboBox Grid.Row="1" Style="{StaticResource ComboBox_Setting}" Height="40"
ItemsSource="{Binding Path=NDIStreamInfos,Mode=OneWay}" ItemsSource="{Binding Path=NDIStreamInfosView,Mode=OneWay}"
SelectedValue="{Binding Path=SelectedNDIStreamInfo,Mode=TwoWay}"> SelectedValue="{Binding Path=SelectedNDIStreamInfo,Mode=TwoWay}">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Data;
using VIZ.Framework.Common; using VIZ.Framework.Common;
using VIZ.Framework.Core; using VIZ.Framework.Core;
using VIZ.H2V.Domain; using VIZ.H2V.Domain;
...@@ -73,6 +75,20 @@ namespace VIZ.H2V.Module ...@@ -73,6 +75,20 @@ namespace VIZ.H2V.Module
#endregion #endregion
#region NDIStreamInfosView -- NDI流信息视图
private ICollectionView ndiStreamInfosView;
/// <summary>
/// NDI流信息视图
/// </summary>
public ICollectionView NDIStreamInfosView
{
get { return ndiStreamInfosView; }
set { ndiStreamInfosView = value; this.RaisePropertyChanged(nameof(NDIStreamInfosView)); }
}
#endregion
#region SelectedNDIStreamInfo -- 选中的NDI流信息 #region SelectedNDIStreamInfo -- 选中的NDI流信息
private NDIStreamInfoModel selectedNDIStreamInfo; private NDIStreamInfoModel selectedNDIStreamInfo;
...@@ -148,6 +164,25 @@ namespace VIZ.H2V.Module ...@@ -148,6 +164,25 @@ namespace VIZ.H2V.Module
#endregion #endregion
#region IsShowLocalStream -- 是否显示本地流
private bool isShowLocalStream = true;
/// <summary>
/// 是否显示本地流
/// </summary>
public bool IsShowLocalStream
{
get { return isShowLocalStream; }
set
{
isShowLocalStream = value;
this.RaisePropertyChanged(nameof(IsShowLocalStream));
this.RaisePropertyChanged(nameof(NDIStreamInfosView));
}
}
#endregion
// ====================================================================================== // ======================================================================================
// === Command === // === Command ===
// ====================================================================================== // ======================================================================================
...@@ -213,6 +248,8 @@ namespace VIZ.H2V.Module ...@@ -213,6 +248,8 @@ namespace VIZ.H2V.Module
} }
this.NDIStreamInfos = list; this.NDIStreamInfos = list;
this.NDIStreamInfosView = CollectionViewSource.GetDefaultView(this.NDIStreamInfos);
this.NDIStreamInfosView.Filter = o => this.NDIStreamInfosViewFilter(o as NDIStreamInfoModel);
this.SelectedNDIStreamInfo = selected; this.SelectedNDIStreamInfo = selected;
} }
...@@ -377,5 +414,21 @@ namespace VIZ.H2V.Module ...@@ -377,5 +414,21 @@ namespace VIZ.H2V.Module
return false; return false;
} }
/// <summary>
/// NDI流视图筛选器
/// </summary>
/// <param name="model">NDI流模型</param>
/// <returns>是否通过筛选</returns>
private bool NDIStreamInfosViewFilter(NDIStreamInfoModel model)
{
if (model == null)
return false;
if (!this.IsShowLocalStream)
return true;
return model.IsLocalStream;
}
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment