2020-12-05 18:27:54 +08:00
|
|
|
<Application
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
2021-02-27 13:24:18 +08:00
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
2020-12-05 18:27:54 +08:00
|
|
|
xmlns:local="clr-namespace:BililiveRecorder.WPF"
|
|
|
|
xmlns:ui="http://schemas.modernwpf.com/2019"
|
2021-01-15 17:40:34 +08:00
|
|
|
xmlns:l="https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension"
|
|
|
|
xmlns:m="clr-namespace:BililiveRecorder.WPF.Models"
|
2020-12-05 18:27:54 +08:00
|
|
|
x:Class="BililiveRecorder.WPF.App"
|
2021-03-18 23:05:48 +08:00
|
|
|
Startup="Application_Startup"
|
|
|
|
Exit="Application_Exit"
|
2020-12-05 18:27:54 +08:00
|
|
|
SessionEnding="Application_SessionEnding"
|
|
|
|
StartupUri="NewMainWindow.xaml">
|
2020-11-27 18:51:02 +08:00
|
|
|
<Application.Resources>
|
|
|
|
<ResourceDictionary>
|
|
|
|
<ResourceDictionary.MergedDictionaries>
|
|
|
|
<ui:ThemeResources />
|
|
|
|
<ui:XamlControlsResources />
|
|
|
|
<!-- Other merged dictionaries here -->
|
2020-12-10 17:02:56 +08:00
|
|
|
<ResourceDictionary Source="Resources/IconResources.xaml" />
|
|
|
|
<ResourceDictionary Source="Resources/ConverterResources.xaml" />
|
2020-11-27 18:51:02 +08:00
|
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
<!-- Other app resources here -->
|
2020-11-28 13:02:57 +08:00
|
|
|
<FontFamily x:Key="ContentControlThemeFontFamily">Microsoft YaHei</FontFamily>
|
2021-01-15 17:40:34 +08:00
|
|
|
<ContextMenu x:Key="CopyTextContextMenu" DataContext="{Binding RelativeSource={RelativeSource Mode=Self},Path=PlacementTarget}"
|
|
|
|
l:ResxLocalizationProvider.DefaultDictionary="Strings">
|
|
|
|
<MenuItem Header="{l:Loc Global_Copy}" Command="{x:Static m:Commands.Copy}" CommandParameter="{Binding Text}"/>
|
|
|
|
</ContextMenu>
|
2021-05-04 15:18:06 +08:00
|
|
|
<DataTemplate x:Key="RoomCardStatsPopup"
|
|
|
|
xmlns:core="clr-namespace:BililiveRecorder.Core;assembly=BililiveRecorder.Core"
|
|
|
|
DataType="{x:Type core:Room}">
|
|
|
|
<Grid l:ResxLocalizationProvider.DefaultDictionary="Strings">
|
|
|
|
<TextBlock Visibility="{Binding Stats.DuraionRatio,Converter={StaticResource IsNaNToVisibilityCollapsedConverter}}"
|
|
|
|
TextAlignment="Center" Text="{l:Loc RoomCard_Status_SpeedIndicator_NoData}"/>
|
|
|
|
<StackPanel Visibility="{Binding Stats.DuraionRatio,Converter={StaticResource InvertIsNaNToVisibilityCollapsedConverter}}">
|
|
|
|
<TextBlock>
|
|
|
|
<TextBlock.Text>
|
|
|
|
<MultiBinding Converter="{l:StringFormatConverter}">
|
|
|
|
<l:BLoc Key="RoomCard_Status_SpeedIndicator_SpeedInPercentage"/>
|
|
|
|
<Binding Path="Stats.DuraionRatio" Mode="OneWay"/>
|
|
|
|
</MultiBinding>
|
|
|
|
</TextBlock.Text>
|
|
|
|
</TextBlock>
|
|
|
|
<TextBlock>
|
|
|
|
<TextBlock.Text>
|
|
|
|
<MultiBinding Converter="{l:StringFormatConverter}">
|
|
|
|
<l:BLoc Key="RoomCard_Status_SpeedIndicator_CurrentFileDuration"/>
|
|
|
|
<Binding Path="Stats.FileMaxTimestamp" Mode="OneWay"/>
|
|
|
|
</MultiBinding>
|
|
|
|
</TextBlock.Text>
|
|
|
|
</TextBlock>
|
|
|
|
<TextBlock>
|
|
|
|
<TextBlock.Text>
|
|
|
|
<MultiBinding Converter="{l:StringFormatConverter}">
|
|
|
|
<l:BLoc Key="RoomCard_Status_SpeedIndicator_TotalFileDuration"/>
|
|
|
|
<Binding Path="Stats.SessionMaxTimestamp" Mode="OneWay"/>
|
|
|
|
</MultiBinding>
|
|
|
|
</TextBlock.Text>
|
|
|
|
</TextBlock>
|
|
|
|
<TextBlock>
|
|
|
|
<TextBlock.Text>
|
|
|
|
<MultiBinding Converter="{l:StringFormatConverter}">
|
|
|
|
<l:BLoc Key="RoomCard_Status_SpeedIndicator_SessionDuration"/>
|
|
|
|
<Binding Path="Stats.SessionDuration" Mode="OneWay"/>
|
|
|
|
</MultiBinding>
|
|
|
|
</TextBlock.Text>
|
|
|
|
</TextBlock>
|
|
|
|
<TextBlock>
|
|
|
|
<TextBlock.Text>
|
|
|
|
<MultiBinding Converter="{l:StringFormatConverter}">
|
|
|
|
<l:BLoc Key="RoomCard_Status_SpeedIndicator_TotalnputBytes"/>
|
|
|
|
<Binding Path="Stats.TotalInputBytes" Converter="{StaticResource ByteUnitsConverter}" Mode="OneWay"/>
|
|
|
|
</MultiBinding>
|
|
|
|
</TextBlock.Text>
|
|
|
|
</TextBlock>
|
|
|
|
<TextBlock>
|
|
|
|
<TextBlock.Text>
|
|
|
|
<MultiBinding Converter="{l:StringFormatConverter}">
|
|
|
|
<l:BLoc Key="RoomCard_Status_SpeedIndicator_TotalOutputBytes"/>
|
|
|
|
<Binding Path="Stats.TotalOutputBytes" Converter="{StaticResource ByteUnitsConverter}" Mode="OneWay"/>
|
|
|
|
</MultiBinding>
|
|
|
|
</TextBlock.Text>
|
|
|
|
</TextBlock>
|
|
|
|
<TextBlock Margin="0,5,0,0" Text="{l:Loc RoomCard_Status_SpeedIndicator_Description}"/>
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
2021-02-23 18:03:37 +08:00
|
|
|
</DataTemplate>
|
2021-05-01 23:18:22 +08:00
|
|
|
<DataTemplate x:Key="RoomDialogHeader">
|
2021-02-27 13:24:18 +08:00
|
|
|
<StackPanel>
|
|
|
|
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Style="{DynamicResource SubtitleTextBlockStyle}"
|
|
|
|
FontFamily="Microsoft Yahei" TextWrapping="NoWrap" TextAlignment="Center" TextTrimming="CharacterEllipsis"
|
|
|
|
Text="{Binding Name,Mode=OneWay}" ToolTip="{Binding Name,Mode=OneWay}"/>
|
|
|
|
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal">
|
|
|
|
<ui:PathIcon Height="10" Style="{StaticResource PathIconDataUpperCaseIdentifier}" />
|
|
|
|
<TextBlock Text="{Binding RoomConfig.RoomId, StringFormat=\{0\},Mode=OneWay}" Margin="4,0"/>
|
|
|
|
<ui:PathIcon Height="10" Style="{StaticResource PathIconDataLowerCaseIdentifier}" Margin="3,0"
|
|
|
|
Visibility="{Binding ShortId,Converter={StaticResource ShortRoomIdToVisibilityConverter}}"/>
|
|
|
|
<TextBlock Text="{Binding ShortId, StringFormat=\{0\},Mode=OneWay}"
|
|
|
|
Visibility="{Binding ShortId,Converter={StaticResource ShortRoomIdToVisibilityConverter}}"/>
|
|
|
|
</StackPanel>
|
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
2020-11-27 18:51:02 +08:00
|
|
|
</ResourceDictionary>
|
|
|
|
</Application.Resources>
|
|
|
|
</Application>
|