Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CreateResourceWindow.xaml « Xamarin.PropertyEditing.Windows - github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d5950f4762c43d13d6bc6920587183713b4c0f9e (plain)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<local:WindowEx x:Class="Xamarin.PropertyEditing.Windows.CreateResourceWindow"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:local="clr-namespace:Xamarin.PropertyEditing.Windows"
	xmlns:prop="clr-namespace:Xamarin.PropertyEditing.Properties;assembly=Xamarin.PropertyEditing"
	mc:Ignorable="d" x:ClassModifier="internal"
	Background="{DynamicResource DialogBackgroundBrush}" Foreground="{DynamicResource DialogForegroundBrush}"
	Height="270" Width="500" ResizeMode="NoResize" ShowMaximize="False" ShowIcon="False" ShowMinimize="False"
	WindowStartupLocation="CenterOwner">
	<local:WindowEx.Title>
		<Binding StringFormat="{x:Static prop:Resources.CreateResourceTitle}" Path="Property.TypeName" Mode="OneTime" />
	</local:WindowEx.Title>
	<local:WindowEx.Resources>
		<Style TargetType="RadioButton">
			<Setter Property="Margin" Value="24,4,0,0" />
			<Setter Property="Foreground" Value="{DynamicResource DialogForegroundBrush}" />
			<Setter Property="FocusVisualStyle" Value="{DynamicResource GenericVisualFocusStyle}" />
			<Setter Property="VerticalAlignment" Value="Center" />
			<Style.Triggers>
				<Trigger Property="IsEnabled" Value="False">
					<Setter Property="Foreground" Value="#FFA2A4A5" />
				</Trigger>
			</Style.Triggers>
		</Style>
	</local:WindowEx.Resources>
	<Grid Margin="12">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>

		<GroupBox Grid.Row="0" Header="{x:Static prop:Resources.ResourceNameLabel}" Margin="0,4,0,0" BorderThickness="0">
			<StackPanel>
				<RadioButton HorizontalContentAlignment="Stretch" IsChecked="{Binding IsKeyed,Mode=TwoWay}">
					<local:TextBoxEx x:Name="resourceKey" Text="{Binding ResourceKey,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource ValidationTextBox}" />
				</RadioButton>
				<RadioButton IsEnabled="{Binding CanApplyToAll,Mode=OneTime}" IsChecked="{Binding IsAppliedToAll,Mode=TwoWay}">Apply to all</RadioButton>
			</StackPanel>
		</GroupBox>

		<GroupBox Grid.Row="1" Header="{x:Static prop:Resources.DefineIn}" Margin="0,4,0,0" BorderThickness="0">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="27" />
					<RowDefinition Height="27" />
					<RowDefinition Height="27" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
				</Grid.ColumnDefinitions>

				<RadioButton Grid.Column="0" Grid.Row="0" Content="{x:Static prop:Resources.Application}" IsEnabled="{Binding HasApplicationSource}" IsChecked="{Binding DefineInApplication,Mode=TwoWay}" />
				<RadioButton Grid.Column="0" Grid.Row="1" Content="{x:Static prop:Resources.ThisDocument}" IsEnabled="{Binding HasDocumentSources}" IsChecked="{Binding DefineInDocument,Mode=TwoWay}" />
				<RadioButton Grid.Column="0" Grid.Row="2" Content="{x:Static prop:Resources.ResourceDictionary}" IsEnabled="{Binding HasApplicationSources}" IsChecked="{Binding DefineInApplicationSource,Mode=TwoWay}" />

				<ComboBox Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" Width="160" Margin="25,4,25,0" IsEnabled="{Binding DefineInDocument}" ItemsSource="{Binding DocumentSources}" SelectedItem="{Binding SelectedDocumentSource,Mode=TwoWay}" DisplayMemberPath="Name" />
				<ComboBox Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" Width="160" Margin="25,4,25,0" IsEnabled="{Binding DefineInApplicationSource}" ItemsSource="{Binding ApplicationSources}" SelectedItem="{Binding SelectedApplicationSource,Mode=TwoWay}" DisplayMemberPath="Name" />
			</Grid>
		</GroupBox>

		<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,4,0,0">
			<Button Name="ok" MinHeight="23" MinWidth="75" Content="{x:Static prop:Resources.OK}" IsDefault="True" Command="{Binding CreateResourceCommand,Mode=OneTime}" Click="OnOkClicked" />
			<Button MinHeight="23" MinWidth="75" Margin="4,0,0,0" Content="{x:Static prop:Resources.Cancel}" IsCancel="True" Click="OnCancelClicked" />
		</StackPanel>

		<Border Background="{DynamicResource DialogBackgroundBrush}" Grid.Row="0" Grid.RowSpan="2">
			<Border.Visibility>
				<Binding Path="HasFatalError">
					<Binding.Converter>
						<BooleanToVisibilityConverter />
					</Binding.Converter>
				</Binding>
			</Border.Visibility>
			<TextBlock Text="{Binding FatalError}" HorizontalAlignment="Center" VerticalAlignment="Center" />
		</Border>
	</Grid>
</local:WindowEx>