This commit is contained in:
ShabOl 2024-04-18 15:08:30 +04:00
parent 84195a9499
commit 2c165dfd04
4 changed files with 128 additions and 44 deletions

View File

@ -6,7 +6,7 @@
xmlns:local="clr-namespace:WPFApplication"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
Title="MainWindow"
Title="Asset Viewer"
Height="850"
Width="1440">
@ -20,47 +20,34 @@
<Setter Property="Padding" Value="8, 5"></Setter>
<Setter Property="Foreground" Value="{StaticResource MenuButtonForeground}"></Setter>
</Style>
<Style x:Key="ListBoxStyle" TargetType="ListBox">
<Setter Property="Background" Value="{StaticResource ListBoxBrush}"></Setter>
<Style x:Key="ButtonStyle" TargetType="MenuItem">
<Setter Property="FontSize" Value="12"></Setter>
<Setter Property="Padding" Value="12, 8"></Setter>
<Setter Property="Background" Value="{StaticResource MenuBackgroundColor}"></Setter>
<Setter Property="Foreground" Value="White"></Setter>
<Setter Property="BorderThickness" Value="0"></Setter>
</Style>
<Style x:Key="VideoButtonStyle" TargetType="Button">
<Setter Property="FontSize" Value="12"></Setter>
<Setter Property="Padding" Value="12, 8"></Setter>
<Setter Property="Background" Value="{StaticResource MenuBackgroundColor}"></Setter>
<Setter Property="Foreground" Value="White"></Setter>
<Setter Property="BorderThickness" Value="0"></Setter>
</Style>
<Style x:Key="CommandMenuItem" TargetType="MenuItem">
<Setter Property="Foreground" Value="Black"></Setter>
</Style>
<Style x:Key="CommandsTextBox" TargetType="TextBox">
<Setter Property="Background" Value="LightGray"></Setter>
<Setter Property="BorderBrush" Value="Black"></Setter>
</Style>
<Style x:Key="LabelStyle" TargetType="Label">
<Setter Property="FontSize" Value="16"></Setter>
<Setter Property="FontFamily" Value="Times New Roman"></Setter>
<Setter Property="FontWeight" Value="Bold"></Setter>
</Style>
<Style x:Key="ExpandCollapseToggleStyle" TargetType="ToggleButton">
<Setter Property="Focusable" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid Width="14" Height="14">
<Rectangle Fill="White" />
<Border Name="ExpandBorder" RenderOptions.EdgeMode="Aliased" BorderBrush="Black" BorderThickness="2">
<Path RenderOptions.EdgeMode="Aliased" Name="ExpandPath" Stroke="Black" Margin="0" StrokeThickness="2" Data="M 5 1 L 5 9 M 1 5 L 9 5" />
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Data" TargetName="ExpandPath" Value="M 1 5 L 9 5"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ExpandBorder" Property="BorderBrush" Value="Gray" />
<Setter TargetName="ExpandPath" Property="Stroke" Value="Gray" />
<Setter Property="Data" TargetName="ExpandPath" Value=""/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Padding" Value="3"></Setter>
<Setter Property="Margin" Value="8, 0"></Setter>
</Style>
</Window.Resources>
<Grid Background="{StaticResource MainBackgroundColor}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="8" />
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
@ -72,7 +59,7 @@
<MenuItem Header="Help" Style="{StaticResource MenuButtonTextStyle}"></MenuItem>
</Menu>
<Grid Grid.Row="2">
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="400" />
<ColumnDefinition Width="Auto" />
@ -89,20 +76,118 @@
</ControlTemplate>
</TabControl.Template>
<TabItem Header="Archives">
<TabItem Header="Commands">
<StackPanel Margin="0, 15">
<TextBox x:Name="CommandTextBox" Style="{StaticResource CommandsTextBox}"/>
<Menu HorizontalAlignment="Center" Margin="10">
<MenuItem x:Name="CommandsButton" Header="Choose command.." Style="{StaticResource ButtonStyle}">
<MenuItem Header="Копировать" CommandTarget="{Binding ElementName=CommandTextBox}" Command="Copy" Style="{StaticResource CommandMenuItem}"/>
<MenuItem Header="Вставить" CommandTarget="{Binding ElementName=CommandTextBox}" Command="Paste" Style="{StaticResource CommandMenuItem}" />
<MenuItem Header="Вырезать" CommandTarget="{Binding ElementName=CommandTextBox}" Command="Cut" Style="{StaticResource CommandMenuItem}" />
</MenuItem>
</Menu>
</StackPanel>
</TabItem>
<TabItem Header="Folders">
<TabItem Header="Video">
<StackPanel Grid.Column="1">
<StackPanel.Triggers>
<EventTrigger RoutedEvent="Button.Click" SourceName="play_video">
<EventTrigger.Actions>
<BeginStoryboard Name="MediaStoryboard">
<Storyboard>
<MediaTimeline Storyboard.TargetName="video" Source="videos/video2.mp4" AutoReverse="False">
</MediaTimeline>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="Button.Click" SourceName="pause_video">
<EventTrigger.Actions>
<StopStoryboard BeginStoryboardName="MediaStoryboard"></StopStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</StackPanel.Triggers>
<Label Content="Video Playback" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="16" Foreground="White" Margin="8"/>
<Grid HorizontalAlignment="Center">
<Rectangle x:Name="video_bg"
Stroke="Black"
Grid.Column="1"
HorizontalAlignment="Center"
MinHeight="250"
MinWidth="377"
/>
<MediaElement x:Name="video"
UnloadedBehavior="Close"
LoadedBehavior="Manual"
MaxWidth="{Binding ElementName=video_bg, Path=ActualWidth}"
MaxHeight="{Binding ElementName=video_bg, Path=ActualHeight}"
Stretch="Fill"/>
</Grid>
<Button x:Name="play_video" Margin="10,10,10,0" Content="Play from start" Style="{StaticResource VideoButtonStyle}" />
<Button x:Name="pause_video" Margin="10,10,10,0" Style="{StaticResource VideoButtonStyle}" >
<Button.Content>Pause</Button.Content>
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Click"></EventTrigger>
</Button.Triggers>
</Button>
</StackPanel>
</TabItem>
<TabItem Header="Assets">
<TabItem Header="Other">
<StackPanel>
<Button x:Name="animated_button" Margin="10" Style="{StaticResource VideoButtonStyle}">
<Button.Content>Hover over me ^_^ :33 !! :))</Button.Content>
<Button.RenderTransform>
<TranslateTransform/>
</Button.RenderTransform>
<Button.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard Name="MouseEnter_BeginStoryboard">
<Storyboard>
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetProperty="RenderTransform.(TranslateTransform.X)">
<SplineDoubleKeyFrame KeyTime="0:0:0" Value="0" />
<SplineDoubleKeyFrame KeyTime="0:0:0.50" Value="5" />
<SplineDoubleKeyFrame KeyTime="0:0:1" Value="5" />
<SplineDoubleKeyFrame KeyTime="0:0:1.50" Value="-5" />
<SplineDoubleKeyFrame KeyTime="0:0:2" Value="-5" />
<SplineDoubleKeyFrame KeyTime="0:0:2.50" Value="0" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetProperty="RenderTransform.(TranslateTransform.Y)">
<SplineDoubleKeyFrame KeyTime="0:0:0" Value="0" />
<SplineDoubleKeyFrame KeyTime="0:0:0.50" Value="-5" />
<SplineDoubleKeyFrame KeyTime="0:0:1" Value="5" />
<SplineDoubleKeyFrame KeyTime="0:0:1.50" Value="5" />
<SplineDoubleKeyFrame KeyTime="0:0:2" Value="-5" />
<SplineDoubleKeyFrame KeyTime="0:0:2.50" Value="0" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave">
<StopStoryboard BeginStoryboardName="MouseEnter_BeginStoryboard"/>
</EventTrigger>
</Button.Triggers>
</Button>
<Button Margin="10" Style="{StaticResource VideoButtonStyle}">
<Button.Content>Play sound effect</Button.Content>
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<EventTrigger.Actions>
<SoundPlayerAction Source="C:\Users\Oleg\source\repos\WPFApplication\WPFApplication\sounds\sound_effect.wav"></SoundPlayerAction>
</EventTrigger.Actions>
</EventTrigger>
</Button.Triggers>
</Button>
</StackPanel>
</TabItem>
</TabControl>
<GridSplitter Grid.Column="1" ResizeDirection="Columns" Width="4" VerticalAlignment="Stretch"
<GridSplitter Grid.Column="1" ResizeDirection="Columns" MinWidth="4" VerticalAlignment="Stretch"
ResizeBehavior="PreviousAndNext" Background="{StaticResource MenuBackgroundColor}" />
<Grid Margin="0 0 3 0" Grid.Column="2">
@ -112,16 +197,15 @@
</Grid.RowDefinitions>
<TabControl Grid.Row="0" x:Name="TabControlName" Background="Transparent" BorderThickness="0" />
<!-- Style="{StaticResource GameFilesTabControl}" -->
<Expander Grid.Row="1" Padding="0, 3" Background="{StaticResource MenuBackgroundColor}">
<TextBox MinHeight="150" Background="{StaticResource MainBackgroundColor}" BorderThickness="0">
</TextBox>
</Expander>
</Grid>
</Grid>
<StatusBar Grid.Row="3" MinHeight="28" MaxHeight="28" Background="{StaticResource StatusBarBackroundColor}">
<StatusBar Grid.Row="2" MinHeight="28" MaxHeight="28" Background="{StaticResource StatusBarBackroundColor}">
<TextBlock Text="Completed" Foreground="White" />
</StatusBar>
</Grid>

Binary file not shown.

Binary file not shown.

Binary file not shown.