MassiveKnob/Windows/MassiveKnob.Plugin.CoreAudio/OSD/OSDWindow.xaml

56 lines
3.0 KiB
XML

<Window x:Class="MassiveKnob.Plugin.CoreAudio.OSD.OSDWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:osd="clr-namespace:MassiveKnob.Plugin.CoreAudio.OSD"
mc:Ignorable="d"
Title="Massive Knob OSD" Height="60" Width="360"
WindowStartupLocation="Manual" WindowStyle="None" AllowsTransparency="True" ShowInTaskbar="False" Topmost="True"
Loaded="OSDWindow_OnLoaded" Closing="OSDWindow_OnClosing"
d:DataContext="{d:DesignInstance osd:OSDWindowViewModel}">
<Window.Triggers>
<EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.250" FillBehavior="HoldEnd" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Window.Triggers>
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="SpeakerIcon.xaml" />
</ResourceDictionary.MergedDictionaries>
<!-- ReSharper disable once Xaml.RedundantResource - used in runtime -->
<Storyboard x:Key="CloseStoryboard" Completed="CloseStoryboard_Completed">
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.250" FillBehavior="HoldEnd" />
</Storyboard>
<Style TargetType="DockPanel" x:Key="OSDWindow">
<Setter Property="Background" Value="#2d2d30" />
</Style>
<Style TargetType="TextBlock" x:Key="DeviceName">
<Setter Property="Foreground" Value="White" />
<Setter Property="Margin" Value="8,4,8,4" />
<Setter Property="FontSize" Value="14" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="TextTrimming" Value="CharacterEllipsis"></Setter>
</Style>
<Style x:Key="SpeakerIconStyle">
<Setter Property="Control.Margin" Value="8,4,8,4" />
</Style>
</ResourceDictionary>
</Window.Resources>
<DockPanel Style="{StaticResource OSDWindow}">
<TextBlock DockPanel.Dock="Top" Text="{Binding DeviceName}" Style="{StaticResource DeviceName}"></TextBlock>
<ContentControl DockPanel.Dock="Left" Content="{StaticResource SpeakerIcon}" Style="{StaticResource SpeakerIconStyle}" />
<Canvas Width="300" Height="20" Margin="8,0,8,0">
<Line X1="0" X2="300" Y1="10" Y2="10" Stroke="#80FFFFFF" StrokeThickness="2" />
<Line X1="{Binding VolumeIndicatorLeft}" X2="{Binding VolumeIndicatorLeft}" Y1="0" Y2="20" Stroke="White" StrokeThickness="2" />
</Canvas>
</DockPanel>
</Window>