1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
<XmlDataProvider x:Key="LanguagesProvider" Source="Languages.xml" XPath="/Languages" />
<CollectionViewSource x:Key="SortedLanguagesView" Source="{Binding Source={StaticResource LanguagesProvider}, XPath=Language}">
<CollectionViewSource.SortDescriptions >
<cm:SortDescription PropertyName="@title" Direction="Ascending" />
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
<DataTemplate x:Key="mEditableLocalizedDataTemplate">
<Grid Background="Transparent" >
<Border BorderBrush="{StaticResource ML_GradientBrush}" BorderThickness="4" CornerRadius="10,10,10,10" Background="{StaticResource ML_DarkBlue}" Margin="5,5,5,5" >
<Grid Background="Transparent" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="25" />
<ColumnDefinition Width="30*" />
<ColumnDefinition Width="30*" />
<ColumnDefinition Width="30*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Grid.Column="1" Grid.Row="0" Margin="10,5,0,0" >Language</TextBlock>
<ComboBox Name="mComboLanguages" SelectionChanged="mComboLanguages_SelectionChanged" Grid.Column="2" Grid.Row="0" Margin="5,5,10,5" Width="150" ItemsSource="{Binding Source={StaticResource SortedLanguagesView}}" >
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding XPath=@title}" />
<TextBlock Text=" (" />
<TextBlock Text="{Binding XPath=@code}" />
<TextBlock Text=")" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Margin="10,5,0,0" Grid.Column="1" Grid.Row="1">Property A</TextBlock>
<TextBox Style="{StaticResource TextBoxStyle}" Grid.Column="2" Grid.Row="1" Background="{DynamicResource ML_LightBlue}" Text="{Binding Path=PropertyA}" Margin="5,5,10,5" ></TextBox>
<TextBlock Margin="10,5,0,0" Grid.Column="1" Grid.Row="3" >Property B</TextBlock>
<TextBox Style="{StaticResource TextBoxStyle}" Grid.Column="2" Grid.Row="3" Text="{Binding Path=PropertyB}" Margin="5,5,10,5" ></TextBox>
<TextBlock Margin="10,5,0,0" Grid.Column="1" Grid.Row="2" >Property C</TextBlock>
<TextBox Style="{StaticResource TextBoxStyle}" Grid.Column="2" Grid.Row="2" Text="{Binding Path=Property C}" Margin="5,5,10,5" AcceptsReturn="True" ></TextBox>
<StackPanel Grid.Row="4" Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right" >
<Image Source="/MetaDataManagerControl;component/Resources/database_remove.ico" Height="15" ToolTip="Deny changes" Margin="0,0,0,10" Style="{StaticResource ML_ImageStyle}" MouseLeftButtonDown="onCancelNewLanguage" />
<Image Source="/MetaDataManagerControl;component/Resources/database_accept.ico" Height="15" ToolTip="Accept changes" Margin="40,0,40,10" Style="{StaticResource ML_ImageStyle}" MouseLeftButtonDown="onValidateNewLanguage" />
</StackPanel>
</Grid>
</Border>
</Grid>
</DataTemplate> |
Partager