windows phone 1

上课讲的好多啊根本看不懂;

我觉得应该先写一篇windows phone;

接下来内容都是我看着视频手打的;

<Grid>
        
        
        <Grid>
            
            <Grid.RowDefinitions>
                
                <RowDefinition Height="50" /> //第一块的高度50
                <RowDefinition Height="100" />
                <RowDefinition Height="*" /> //剩余部分都是第三块
            </Grid.RowDefinitions>
            
            
            
            <TextBlock Margin="20, 0, 20, 0" //距边框的距离
                       Grid.Row="0"                    //第一块
                       Style="{StaticResource TitleTextBlockStyle}">
                Tip Calculator
                
            </TextBlock>

            <TextBlock Margin="20, 0, 20, 0"
                       Grid.Row="1"
                       Style="{StaticResource TitleTextBlockStyle}"
                       FontSize="48">                  //字体大小
                Enter the Bill Amount

            </TextBlock>



            <StackPanel Name="myStackPanel"
                        Grid.Row="2"
                        Margin="20, 0, 20, 0">
                
                <TextBlock HorizontalAlignment="Left"  //block左对齐
                           TextWrapping="Wrap"                //自动换行
                           Text="Bill Amount"
                           FontSize="24"/>

                
                <TextBox Name="billAmountTextBox"
                         Text="$0.00"
                         TextAlignment="Right"                   //text右对齐
                         HorizontalAlignment="Left"
                         TextWrapping="Wrap"
                         VerticalAlignment="Top"
                         InputScope="Number"                    //点击是出现数字键盘
                         Width="100"
                         FontSize="24"
                         LostFocus="amountTextBox_LostFocus"    //移开
                         TextChanged="billAmountTextBox_TextChanged"  //文本改变
                         GotFocus="billAmountTextBox_GotFocus"/>    //点击



                <TextBlock HorizontalAlignment="Left"
                           TextWrapping="Wrap"
                           Text="Percent To Tip"
                           FontSize="24"
                           Margin="0, 20, 0, 0"/>
                
                <RadioButton Content="10% - Horrible Service"
                             Tag="0.1"
                             GroupName="percentRadio"
                             Click="RadioButton_Click"/>
                
                <RadioButton Content="18% - Acceptable Service"
                             Tag="0.18"
                             GroupName="percentRadio"
                             Click="RadioButton_Click"/>

                <RadioButton Content="25% - Great Service"
                             Tag="0.25"
                             GroupName="percentRadio"
                             IsChecked="True"                                  //初始
                             Click="RadioButton_Click"/>



                <TextBlock HorizontalAlignment="Left"
                           TextWrapping="Wrap"
                           Text="Amount To Tip"
                           FontSize="24"
                           Margin="0, 20, 0, 0"/>

                <TextBlock Name="amountToTipTextBlock"
                           HorizontalAlignment="Left"
                           VerticalAlignment="Top"
                           TextWrapping="Wrap"
                           Text="$0.00"
                           FontSize="36"
                           Margin="0, 20, 0, 0"/>




                <TextBlock HorizontalAlignment="Left"
                           TextWrapping="Wrap"
                           Text="Total Bill"
                           FontSize="24"
                           Margin="0, 20, 0, 0"/>

                <TextBlock Name="totalTextBlock"
                           HorizontalAlignment="Left"
                           VerticalAlignment="Top"
                           TextWrapping="Wrap"
                           Text="$0.00"
                           FontSize="36"
                           Margin="0, 20, 0, 0"/>

            </StackPanel>


        </Grid>
        
        
    </Grid>

  

函数部分我们下期再见 //因为我还没有看懂

posted @ 2015-04-20 18:14  一边挖鼻屎一边  阅读(100)  评论(0编辑  收藏  举报