PageRenderTime 17ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 1ms

/Application/GUI/Windows/PropertiesWindow.xaml

http://yet-another-music-application.googlecode.com/
XAML | 237 lines | 191 code | 26 blank | 20 comment | 0 complexity | 16219449dd7d28b7b5b2d752ff483183 MD5 | raw file
  1<!--Information.xaml
  2	
  3	The dialog showing information about one or several
  4	tracks.
  5	
  6	= = = = = = = = = =
  7	
  8	This code is part of the Stoffi Music Player Project.
  9	Visit our website at: stoffiplayer.com
 10	
 11	This program is free software; you can redistribute it and/or
 12	modify it under the terms of the GNU General Public License
 13	as published by the Free Software Foundation; either version
 14	3 of the License, or (at your option) any later version.
 15	
 16	See stoffiplayer.com/license for more information.
 17	-->
 18<Window x:Class="Stoffi.PropertiesWindow"
 19		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 20		xmlns:loc="http://schemas.tomer.com/winfx/2006/xaml/presentation"
 21		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 22		xmlns:Stoffi="clr-namespace:Stoffi"
 23		loc:Translate.Uid="PropertiesTitle"
 24		Title="{loc:Translate Title}"
 25		MinHeight="400" MinWidth="400"
 26		Width="400" Height="500"
 27		Icon="../../Stoffi.ico"
 28		WindowStartupLocation="CenterScreen"
 29		Background="#D4D0C8"
 30		TextOptions.TextFormattingMode="Display">
 31	<Window.Resources>
 32		<Stoffi:BoolToVisibilityConverter x:Key="boolToVis" />
 33		
 34		<Style TargetType="{x:Type TextBlock}"
 35			   x:Key="GridBlockStyle">
 36			<Setter Property="VerticalAlignment" Value="Center" />
 37			<Style.Triggers>
 38				<DataTrigger Binding="{Binding Path=Edit}" Value="False">
 39					<Setter Property="Visibility" Value="Visible"/>
 40				</DataTrigger>
 41				<DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor,
 42					AncestorType={x:Type ListViewItem}}, Path=DataContext.Edit}" Value="True">
 43					<Setter Property="Visibility" Value="Hidden"/>
 44				</DataTrigger>
 45			</Style.Triggers>
 46		</Style>
 47		<Style TargetType="{x:Type FrameworkElement}" 
 48			   x:Key="GridEditStyle">
 49			<Setter Property="VerticalAlignment" Value="Center" />
 50			<Style.Triggers>
 51				<DataTrigger Binding="{Binding Path=Edit}" Value="True">
 52					<Setter Property="Visibility" Value="Visible"/>
 53				</DataTrigger>
 54				<DataTrigger Binding="{Binding Path=Edit}" Value="False">
 55					<Setter Property="Visibility" Value="Hidden"/>
 56				</DataTrigger>
 57			</Style.Triggers>
 58		</Style>
 59
 60		<Style x:Key="PropertyRowStyle" TargetType="{x:Type ListViewItem}">
 61			<Setter Property="Background" Value="Transparent"/>
 62			<Setter Property="BorderBrush" Value="Transparent"/>
 63			<Setter Property="BorderThickness" Value="1"/>
 64			<Setter Property="Margin" Value="0,0,0,1"/>
 65			<Setter Property="Padding" Value="5,13,5,3"/>
 66			<Setter Property="VerticalContentAlignment" Value="Center"/>
 67			<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
 68			<Setter Property="Template">
 69				<Setter.Value>
 70					<ControlTemplate TargetType="{x:Type ListViewItem}">
 71						<Border Background="Transparent" Name="Border1">
 72							<GridViewRowPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="2" />
 73						</Border>
 74						<ControlTemplate.Triggers>
 75							<Trigger Property="IsSelected" Value="true">
 76								<Setter Property="Background" TargetName="Border1" Value="DodgerBlue"/>
 77								<Setter Property="Foreground" Value="White"/>
 78							</Trigger>
 79						</ControlTemplate.Triggers>
 80					</ControlTemplate>
 81				</Setter.Value>
 82			</Setter>
 83		</Style>
 84	</Window.Resources>
 85	<Grid Margin="5">
 86		<Grid.RowDefinitions>
 87			<RowDefinition Height="*"    Name="TabsRow"/>
 88			<RowDefinition Height="Auto" Name="ButtonRow"/>
 89		</Grid.RowDefinitions>
 90		
 91		<TabControl Name="Tabs"  Grid.Row="0">
 92			<!-- General tab -->
 93			<TabItem loc:Translate.Uid="PropertiesGeneral" Header="{loc:Translate Header}">
 94				<ScrollViewer Padding="5"
 95							  Margin="-5"
 96							  HorizontalScrollBarVisibility="Disabled"
 97							  VerticalScrollBarVisibility="Auto"
 98							  HorizontalContentAlignment="Stretch"
 99							  HorizontalAlignment="Stretch">
100					<Grid HorizontalAlignment="Stretch">
101						<Grid.RowDefinitions>
102							<RowDefinition Height="Auto"/>
103							<RowDefinition Height="Auto"/>
104							<RowDefinition Height="Auto"/>
105							<RowDefinition Height="Auto"/>
106							<RowDefinition Height="Auto"/>
107							<RowDefinition Height="Auto"/>
108							<RowDefinition Height="Auto"/>
109							<RowDefinition Height="Auto"/>
110							<RowDefinition Height="Auto"/>
111							<RowDefinition Height="Auto"/>
112							<RowDefinition Height="Auto"/>
113							<RowDefinition Height="Auto"/>
114							<RowDefinition Height="Auto"/>
115							<RowDefinition Height="Auto"/>
116							<RowDefinition Height="Auto"/>
117							<RowDefinition Height="Auto"/>
118							<RowDefinition Height="Auto"/>
119							<RowDefinition Height="Auto"/>
120						</Grid.RowDefinitions>
121
122						<Grid.ColumnDefinitions>
123							<ColumnDefinition Width="Auto"/>
124							<ColumnDefinition Width="*"/>
125						</Grid.ColumnDefinitions>
126
127						<Border Margin="0 0 10 0" Grid.Row="0" Grid.Column="0"
128								Width="50" Height="50" Padding="0" SnapsToDevicePixels="True">
129							<Border.Background>
130								<VisualBrush>
131									<VisualBrush.Visual>
132										<Grid>
133											<Image Source="../Images/AlbumArt/BackgroundMultiple.png" x:Name="ArtBackgroundMultiple" SnapsToDevicePixels="True"/>
134											<Image Source="../Images/AlbumArt/BackgroundSingle.png" x:Name="ArtBackgroundSingle" SnapsToDevicePixels="True" Visibility="Collapsed"/>
135										</Grid>
136									</VisualBrush.Visual>
137								</VisualBrush>
138							</Border.Background>
139							<Image Source="../Images/AlbumArt/Default.jpg" x:Name="AlbumArt" Width="46" Height="46"/>
140						</Border>
141
142						<TextBox Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="Filename" KeyUp="Filename_KeyUp"/>
143						<TextBlock Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Name="Filecount" Visibility="Collapsed"/>
144
145						<Separator Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Background="SlateGray" Margin="5 10"/>
146
147						<TextBlock Grid.Row="2" Grid.Column="0" Margin="10 5" loc:Translate.Uid="PropertiesGeneralType" Text="{loc:Translate Text}" />
148						<TextBlock Grid.Row="2" Grid.Column="1" Margin="0  5" Name="Filetype" TextTrimming="CharacterEllipsis"/>
149
150						<Separator Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Background="Gray" Margin="5 10"/>
151
152						<TextBlock Grid.Row="4" Grid.Column="0" Margin="10 5" loc:Translate.Uid="PropertiesGeneralLength" Text="{loc:Translate Text}"/>
153						<TextBlock Grid.Row="4" Grid.Column="1" Margin="0  5" Name="Length" TextTrimming="CharacterEllipsis"/>
154
155						<TextBlock Grid.Row="5" Grid.Column="0" Margin="10 5" loc:Translate.Uid="PropertiesGeneralChannels" Text="{loc:Translate Text}"/>
156						<TextBlock Grid.Row="5" Grid.Column="1" Margin="0  5" Name="Channels" TextTrimming="CharacterEllipsis"/>
157
158						<TextBlock Grid.Row="6" Grid.Column="0" Margin="10 5" loc:Translate.Uid="PropertiesGeneralCodec" Text="{loc:Translate Text}"/>
159						<TextBlock Grid.Row="6" Grid.Column="1" Margin="0  5" Name="Codec" TextTrimming="CharacterEllipsis"/>
160
161						<TextBlock Grid.Row="7" Grid.Column="0" Margin="10 5" loc:Translate.Uid="PropertiesGeneralBitrate" Text="{loc:Translate Text}"/>
162						<TextBlock Grid.Row="7" Grid.Column="1" Margin="0  5" Name="Bitrate" TextTrimming="CharacterEllipsis"/>
163
164						<TextBlock Grid.Row="8" Grid.Column="0" Margin="10 5" loc:Translate.Uid="PropertiesGeneralSamplerate" Text="{loc:Translate Text}"/>
165						<TextBlock Grid.Row="8" Grid.Column="1" Margin="0  5" Name="SampleRate" TextTrimming="CharacterEllipsis"/>
166
167						<Separator Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2" Background="Gray" Margin="5 10"/>
168
169						<TextBlock Grid.Row="10" Grid.Column="0" Margin="10 5" loc:Translate.Uid="PropertiesGeneralLocation" Text="{loc:Translate Text}"/>
170						<TextBlock Grid.Row="10" Grid.Column="1" Margin="0  5" Name="Filepath" TextTrimming="CharacterEllipsis"/>
171
172						<TextBlock Grid.Row="11" Grid.Column="0" Margin="10 5" loc:Translate.Uid="PropertiesGeneralSize" Text="{loc:Translate Text}"/>
173						<TextBlock Grid.Row="11" Grid.Column="1" Margin="0  5" Name="Filesize" TextTrimming="CharacterEllipsis"/>
174
175						<Separator Grid.Row="12" Grid.Column="0" Grid.ColumnSpan="2" Background="Gray" Margin="5 10"/>
176
177						<TextBlock Grid.Row="13" Grid.Column="0" Margin="10 5" loc:Translate.Uid="PropertiesGeneralPlayCount" Text="{loc:Translate Text}"/>
178						<TextBlock Grid.Row="13" Grid.Column="1" Margin="0  5" Name="PlayCount" TextTrimming="CharacterEllipsis"/>
179
180						<TextBlock Grid.Row="14" Grid.Column="0" Margin="10 5" loc:Translate.Uid="PropertiesGeneralLastPlayed" Text="{loc:Translate Text}" Name="LastPlayedLabel"/>
181						<TextBlock Grid.Row="14" Grid.Column="1" Margin="0  5" Name="LastPlayed" TextTrimming="CharacterEllipsis"/>
182
183						<TextBlock Grid.Row="15" Grid.Column="0" Margin="10 5" loc:Translate.Uid="PropertiesGeneralCreated" Text="{loc:Translate Text}" Name="CreatedAtLabel"/>
184						<TextBlock Grid.Row="15" Grid.Column="1" Margin="0  5" Name="CreatedAt" TextTrimming="CharacterEllipsis"/>
185
186						<TextBlock Grid.Row="16" Grid.Column="0" Margin="10 5" loc:Translate.Uid="PropertiesGeneralModified" Text="{loc:Translate Text}" Name="ModifiedAtLabel"/>
187						<TextBlock Grid.Row="16" Grid.Column="1" Margin="0  5" Name="ModifiedAt" TextTrimming="CharacterEllipsis"/>
188
189						<TextBlock Grid.Row="17" Grid.Column="0" Margin="10 5" loc:Translate.Uid="PropertiesGeneralAccessed" Text="{loc:Translate Text}" Name="AccessedAtLabel"/>
190						<TextBlock Grid.Row="17" Grid.Column="1" Margin="0  5" Name="AccessedAt" TextTrimming="CharacterEllipsis"/>
191					</Grid>
192				</ScrollViewer>
193			</TabItem>
194
195			<!-- Details tab-->
196			<TabItem loc:Translate.Uid="PropertiesDetails" Header="{loc:Translate Header}">
197				<ListView x:Name="DetailsList" Margin="5" BorderBrush="Gray" BorderThickness="1" SelectionMode="Single" Foreground="Black" SnapsToDevicePixels="True" ItemContainerStyle="{StaticResource PropertyRowStyle}">
198					<ListView.View>
199						<GridView>
200							<GridViewColumn Width="140" DisplayMemberBinding="{Binding Name}">
201								<GridViewColumnHeader loc:Translate.Uid="PropertiesDetailsProperty" Content="{loc:Translate Content}" HorizontalContentAlignment="Left"
202													  Margin="-2,0,0,0" Padding="5,3"/>
203							</GridViewColumn>
204							<GridViewColumn Width="200">
205								<GridViewColumnHeader Tag="Value" loc:Translate.Uid="PropertiesDetailsValue" Content="{loc:Translate Content}" HorizontalContentAlignment="Left"
206													  Padding="5,3" />
207								<GridViewColumn.CellTemplate>
208									<DataTemplate>
209										<Stoffi:EditableTextBlock Tag="{Binding Path=Name}" ClickToEdit="True" SimpleHover="False" Text="{Binding Path=Value}" Edited="EditableTextBlock_Edited" />
210									</DataTemplate>
211								</GridViewColumn.CellTemplate>
212							</GridViewColumn>
213						</GridView>
214					</ListView.View>
215				</ListView>
216			</TabItem>
217			
218		</TabControl>
219		
220		<!-- Buttons -->
221		<DockPanel Name="Buttons" HorizontalAlignment="Stretch" Grid.Row="1" LastChildFill="False">
222			<Button DockPanel.Dock="Left" Width="25" Margin="0  5" Name="Prev" Click="Previous_Click">
223				<Button.Content>
224					<Image Name="PrevImage"/>
225				</Button.Content>
226			</Button>
227			<Button DockPanel.Dock="Left" Width="25" Margin="10 5" Name="Next" Click="Next_Click">
228				<Button.Content>
229					<Image Name="NextImage"/>
230				</Button.Content>
231			</Button>
232			<Button DockPanel.Dock="Right" loc:Translate.Uid="ButtonApply" Content="{loc:Translate Content}"   Visibility="Collapsed" MinWidth="80" Margin="5 5 0 5" Name="Apply"    Click="Apply_Click"/>
233			<Button DockPanel.Dock="Right" loc:Translate.Uid="ButtonClose" Content="{loc:Translate Content}"   Visibility="Visible"   MinWidth="80" Margin="0 5"     Name="Cancel"   Click="CloseCancel_Click"/>
234			<Button DockPanel.Dock="Right" loc:Translate.Uid="ButtonOK"    Content="{loc:Translate Content}"   Visibility="Collapsed" MinWidth="80" Margin="5 5"     Name="OK"       Click="OK_Click"/>
235		</DockPanel>
236	</Grid>
237</Window>