MainPage.xaml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <UserControl x:Class="SLTest.MainPage"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:SLTest"
  7. xmlns:MpegTs="clr-namespace:MatrixIO.IO.MpegTs;assembly=MatrixIO.IO.MPEGTS"
  8. xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" mc:Ignorable="d"
  9. DataContext="{Binding RelativeSource={RelativeSource Self}}"
  10. d:DesignHeight="300" d:DesignWidth="400">
  11. <UserControl.Resources>
  12. <Style TargetType="sdk:TreeViewItem">
  13. <Setter Property="IsExpanded" Value="true" />
  14. </Style>
  15. <DataTemplate x:Key="StreamNode">
  16. <StackPanel Orientation="Horizontal">
  17. <TextBlock Text="{Binding Path=Type}"/>
  18. <TextBlock Text=" (PID "/>
  19. <TextBlock Text="{Binding Path=PacketIdentifier}"/>
  20. <TextBlock Text=")"/>
  21. </StackPanel>
  22. </DataTemplate>
  23. <sdk:HierarchicalDataTemplate x:Key="ProgramNode" ItemsSource="{Binding Path=Streams}" ItemTemplate="{StaticResource StreamNode}">
  24. <StackPanel Orientation="Horizontal">
  25. <TextBlock Text="{Binding}"/>
  26. </StackPanel>
  27. </sdk:HierarchicalDataTemplate>
  28. <sdk:HierarchicalDataTemplate x:Key="SourceNode" ItemsSource="{Binding Path=Demuxer.Programs}" ItemTemplate="{StaticResource ProgramNode}">
  29. <StackPanel Orientation="Horizontal">
  30. <TextBlock Text="{Binding Path=Url}"/>
  31. </StackPanel>
  32. </sdk:HierarchicalDataTemplate>
  33. </UserControl.Resources>
  34. <Grid x:Name="LayoutRoot" Background="White">
  35. <Grid.ColumnDefinitions>
  36. <ColumnDefinition Width="200"/>
  37. <ColumnDefinition Width="*"/>
  38. </Grid.ColumnDefinitions>
  39. <sdk:TreeView Name="SourceTreeView" ItemsSource="{Binding Sources}" ItemTemplate="{StaticResource SourceNode}" Margin="0,0,4,0" SelectedItemChanged="SourceTreeView_SelectedItemChanged" />
  40. <sdk:GridSplitter Width="4"/>
  41. <Grid Grid.Column="1" Background="#FF525252">
  42. <Grid.RowDefinitions>
  43. <RowDefinition Height="*"/>
  44. <RowDefinition Height="Auto"/>
  45. </Grid.RowDefinitions>
  46. <MediaElement Name="mediaElement" AutoPlay="True" MediaFailed="mediaElement_MediaFailed" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BufferingProgressChanged="mediaElement_BufferingProgressChanged" />
  47. <ProgressBar Grid.Row="1" Name="bufferingProgress" Height="20" Minimum="0" Maximum="1"/>
  48. </Grid>
  49. </Grid>
  50. </UserControl>