Стартовый комплект от Microsoft для своего телефона с Windows 7 генерирует клавиатуру с воспроизведенным ниже XAML.Очевидно, что это тонны копирования и вставки.
Вопросы:
1) Серьезно ли MSFT пишет об этом таким образом?здравый способ написать что-то подобное?
4) Кто-нибудь знает пример кода, который иллюстрирует упомянутый разумный путь?
<StackPanel Orientation="Vertical">
<TextBlock x:Name="textBlockCategory"
Text="{Binding Path=UppercasedCategory}"
Margin="23,24,0,0"
FontSize="{StaticResource PhoneFontSizeMedium}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Foreground="{StaticResource PhoneForegroundBrush}" />
<StackPanel x:Name="spInput"
Orientation="Vertical"
Margin="0,0,24,0" >
<TextBlock x:Name="textBlockInputValue"
Text="{Binding Path=UpperUnitValue}"
Height="80" Margin="0,2,0,0"
TextAlignment="Right"
FontSize="{StaticResource PhoneFontSizeExtraExtraLarge}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Foreground="{StaticResource PhoneForegroundBrush}" />
<TextBlock x:Name="textBlockInputUnit"
Text="{Binding Path=UpperUnitName}"
Height="34" TextAlignment="Right" Margin="0,2,0,0"
FontSize="{StaticResource PhoneFontSizeMediumLarge}"
Foreground="{StaticResource PhoneAccentBrush}"
FontFamily="{StaticResource PhoneFontFamilySemiBold}" />
</StackPanel>
<StackPanel x:Name="spResult"
Orientation="Vertical"
Margin="0,-4,24,0" >
<TextBlock x:Name="textBlockResultValue"
Text="{Binding Path=LowerUnitValue}"
Height="80" TextAlignment="Right" Margin="0,-4,0,0"
FontSize="{StaticResource PhoneFontSizeExtraExtraLarge}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Foreground="{StaticResource PhoneSubtleBrush}"/>
<TextBlock x:Name="textBlockResultUnit"
Text="{Binding Path=LowerUnitName}"
Height="34" TextAlignment="Right" Margin="0,2,0,0"
FontSize="{StaticResource PhoneFontSizeMediumLarge}"
Foreground="{StaticResource PhoneAccentBrush}"
FontFamily="{StaticResource PhoneFontFamilySemiBold}" />
</StackPanel>
<StackPanel x:Name="spSummary" >
<TextBlock x:Name="textBlockSummary"
Text="{Binding Path=Summary}"
Height="30" TextAlignment="Center" Margin="0,18,0,0"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneSubtleBrush}"
FontFamily="{StaticResource PhoneFontFamilyNormal}" />
</StackPanel>
<StackPanel x:Name="spKeypad" Orientation="Vertical" HorizontalAlignment="Right">
<StackPanel x:Name="spKeypadRow1" Orientation="Horizontal">
<Button x:Name="btnKeypadKey7"
Content="7"
Background="{StaticResource PhoneInactiveBrush}"
Foreground="{StaticResource PhoneForegroundBrush}"
Height="84" Margin="6" Width="108"
Style="{StaticResource KeypadButtonStyle}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource KeypadButtonFontSize}"
Click="OnClickNumber" />
<Button x:Name="btnKeypadKey8"
Content="8"
Background="{StaticResource PhoneInactiveBrush}"
Foreground="{StaticResource PhoneForegroundBrush}"
Height="84" Margin="6" Width="108"
Style="{StaticResource KeypadButtonStyle}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource KeypadButtonFontSize}"
Click="OnClickNumber" />
<Button x:Name="btnKeypadKey9"
Content="9"
Background="{StaticResource PhoneInactiveBrush}"
Foreground="{StaticResource PhoneForegroundBrush}"
Height="84" Margin="6" Width="108"
Style="{StaticResource KeypadButtonStyle}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource KeypadButtonFontSize}"
Click="OnClickNumber" />
<Button x:Name="btnKeypadKeyCancel"
Height="84" Margin="6" Width="108"
Style="{StaticResource btnKeypadKeyCancelStyle}"
Background="{StaticResource PhoneDisabledBrush}"
FontSize="{StaticResource PhoneFontSizeExtraLarge}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Click="OnClickClear" />
</StackPanel>
<StackPanel x:Name="spKeypadRow2" Orientation="Horizontal">
<Button x:Name="btnKeypadKey4"
Content="4"
Background="{StaticResource PhoneInactiveBrush}"
Foreground="{StaticResource PhoneForegroundBrush}"
Height="84" Margin="6" Width="108"
Style="{StaticResource KeypadButtonStyle}"
FontSize="{StaticResource KeypadButtonFontSize}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Click="OnClickNumber" />
<Button x:Name="btnKeypadKey5"
Content="5"
Background="{StaticResource PhoneInactiveBrush}"
Foreground="{StaticResource PhoneForegroundBrush}"
Height="84" Margin="6" Width="108"
Style="{StaticResource KeypadButtonStyle}"
FontSize="{StaticResource KeypadButtonFontSize}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Click="OnClickNumber" />
<Button x:Name="btnKeypadKey6"
Content="6"
Background="{StaticResource PhoneInactiveBrush}"
Foreground="{StaticResource PhoneForegroundBrush}"
Height="84" Margin="6" Width="108"
Style="{StaticResource KeypadButtonStyle}"
FontSize="{StaticResource KeypadButtonFontSize}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Click="OnClickNumber" />
<Button x:Name="btnKeypadKeyBack"
Height="84" Margin="6" Width="108"
Style="{StaticResource btnKeypadKeyBackStyle}"
Background="{StaticResource PhoneDisabledBrush}"
FontSize="{StaticResource PhoneFontSizeExtraLarge}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Click="OnClickBack" />
</StackPanel>
<StackPanel x:Name="spKeypadRow3" Orientation="Horizontal">
<Button x:Name="btnKeypadKey1"
Background="{StaticResource PhoneInactiveBrush}"
Foreground="{StaticResource PhoneForegroundBrush}"
Height="84" Margin="6" Width="108"
Content="1"
Style="{StaticResource KeypadButtonStyle}"
FontSize="{StaticResource KeypadButtonFontSize}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Click="OnClickNumber" />
<Button x:Name="btnKeypadKey2"
Content="2"
Background="{StaticResource PhoneInactiveBrush}"
Foreground="{StaticResource PhoneForegroundBrush}"
Height="84" Margin="6" Width="108"
Style="{StaticResource KeypadButtonStyle}"
FontSize="{StaticResource KeypadButtonFontSize}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Click="OnClickNumber" />
<Button x:Name="btnKeypadKey3"
Content="3"
Background="{StaticResource PhoneInactiveBrush}"
Foreground="{StaticResource PhoneForegroundBrush}"
Height="84" Margin="6" Width="108"
Style="{StaticResource KeypadButtonStyle}"
FontSize="{StaticResource KeypadButtonFontSize}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Click="OnClickNumber" />
<Button x:Name="btnKeypadKeyPlusMinus"
Height="84" Margin="6" Width="108"
Style="{StaticResource btnKeypadPlusMinusStyle}"
Background="{StaticResource PhoneDisabledBrush}"
FontSize="{StaticResource PhoneFontSizeExtraLarge}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Click="OnClickSign" />
</StackPanel>
<StackPanel x:Name="spKeypadRow4" Orientation="Horizontal">
<Button x:Name="btnKeypadKey0"
Content="0"
Background="{StaticResource PhoneInactiveBrush}"
Foreground="{StaticResource PhoneForegroundBrush}"
Height="84" Margin="6" Width="228"
Style="{StaticResource KeypadButtonStyle}"
FontSize="{StaticResource KeypadButtonFontSize}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Click="OnClickNumber" />
<Button x:Name="btnKeypadKeyPoint"
Content="{Binding Path=CurrentCulture.NumberFormat.NumberDecimalSeparator, Source={StaticResource Resources}}"
Background="{StaticResource PhoneInactiveBrush}"
Foreground="{StaticResource PhoneForegroundBrush}"
Height="84" Margin="6" Width="108"
Style="{StaticResource btnKeypadPointStyle}"
FontSize="{StaticResource KeypadButtonFontSize}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Click="OnClickNumber" />
<Button x:Name="btnKeypadSwitchSourceTargetUnit"
Height="84" Margin="6" Width="108"
Style="{StaticResource KeypadButtonStyle}"
Background="{StaticResource PhoneDisabledBrush}"
FontSize="{StaticResource PhoneFontSizeExtraLarge}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Click="OnClickSourceTargetUnit">
<Image Source= "{Binding ConversionImageSource}"/>
</Button>
</StackPanel>
</StackPanel>
</StackPanel>