<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                button有很多和wpf一樣,可以看《深入淺出WPF》 我們可以在button的click寫上 ~~~ <Button Content="確定" Click="Button_Click"/> ~~~ 在Button_Click按F12到代碼寫上點擊按鈕需要運行 ~~~ private void Button_Click(object sender, RoutedEventArgs e) { } ~~~ 也可以用viewModel的一個方法 viewModel有一個方法 ce 可以在Click寫 ~~~ Click="{x:Bind view.ce}" ~~~ 在用view需要在MainPage.xaml.cs寫 ~~~ viewModel view {set;get;}= new viewModel(); ~~~ button content可以使用一個元素,這個元素可以是Grid,我們可以做一個圓形頭像 先找出一張圖,我們把這張圖做頭像 把圖放到項目 ~~~ <Button Height="100" Width="100" Margin="10,10,10,10" Padding="0" Foreground="{x:Null}" BorderBrush="{x:Null}" Background="{x:Null}"> <Button.Content> <Ellipse Margin="0,0,0,0" Height="90" Width="90"> <Ellipse.Fill> <ImageBrush ImageSource="Assets/20151226160608688.jpg" /> </Ellipse.Fill> </Ellipse> </Button.Content> </Button> ~~~ 我們可以修改鼠標在按鈕上的樣子 button可以設置屬性,使用資源 資源可以寫在頁面 ~~~ <Page.Resources> </Page.Resources> ~~~ 所有按鈕使用同樣式 ~~~ <Page.Resources> <Style TargetType="Button"> </Style> </Page.Resources> ~~~ 按鈕的屬性用`<Setter Property="屬性" Value="值"/>` 按鈕的背景 ~~~ <Page.Resources> <Style TargetType="Button"> <Setter Property="Background" Value="White"/> </Style> </Page.Resources> ~~~ 指定一個樣式,key ~~~ <Page.Resources> <Style TargetType="Button"> <Setter Property="Background" Value="White"/> <Setter Property="Width" Value="100"/> <Setter Property="Height" Value="100"/> </Style> <Style x:Key="button" TargetType="Button"> <Setter Property="Background" Value="White"/> <Setter Property="Width" Value="50"/> <Setter Property="Height" Value="50"/> </Style> </Page.Resources> ~~~ ~~~ <Button Content="默認"/> <Button Style="{StaticResource button}" Content="確定"/> ~~~ ![這里寫圖片描述](https://box.kancloud.cn/2016-04-08_5707636ca07b0.jpg) 在設計,點按鈕,右擊,編輯模板副本,選擇當前頁![這里寫圖片描述](https://box.kancloud.cn/2016-04-08_5707636caedc9.png) 可以看到 ~~~ <Page.Resources> <Style x:Key="ButtonStyle1" TargetType="Button"> <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}"/> <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/> <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundTransparentBrush}"/> <Setter Property="BorderThickness" Value="{ThemeResource ButtonBorderThemeThickness}"/> <Setter Property="Padding" Value="8,4,8,4"/> <Setter Property="HorizontalAlignment" Value="Left"/> <Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/> <Setter Property="FontWeight" Value="Normal"/> <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/> <Setter Property="UseSystemFocusVisuals" Value="True"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid x:Name="RootGrid" Background="{TemplateBinding Background}"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"> <Storyboard> <PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/> </Storyboard> </VisualState> <VisualState x:Name="PointerOver"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ContentPresenter"> <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseMediumLowBrush}"/> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter"> <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseHighBrush}"/> </ObjectAnimationUsingKeyFrames> <PointerUpThemeAnimation Storyboard.TargetName="RootGrid"/> </Storyboard> </VisualState> <VisualState x:Name="Pressed"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="RootGrid"> <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundBaseMediumLowBrush}"/> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ContentPresenter"> <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}"/> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter"> <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseHighBrush}"/> </ObjectAnimationUsingKeyFrames> <PointerDownThemeAnimation Storyboard.TargetName="RootGrid"/> </Storyboard> </VisualState> <VisualState x:Name="Disabled"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="RootGrid"> <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}"/> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter"> <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseLowBrush}"/> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ContentPresenter"> <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledTransparentBrush}"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" Content="{TemplateBinding Content}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </Page.Resources> ~~~ 在`<VisualState x:Name="Pressed">`可以把里面寫成這個狀態的樣子,按鈕有正常,按下,鼠標在按鈕上,可以對每個修改 ![這里寫圖片描述](https://box.kancloud.cn/2016-04-08_5707636cc6607.png) 點擊Pressed更改pressed![點擊Pressed更改pressed](https://box.kancloud.cn/2016-04-08_5707636cdc52f.png) 看到這里按鈕有背景![看到這里按鈕有背景](https://box.kancloud.cn/2016-04-08_5707636d0c8d1.png) 去掉背景,按F4把背景無畫筆![去掉背景,按F4把背景無畫筆](https://box.kancloud.cn/2016-04-08_5707636d1c9db.png) 添加過度![添加過度](https://box.kancloud.cn/2016-04-08_5707636d2ea24.png) 記錄關鍵幀![記錄關鍵幀](https://box.kancloud.cn/2016-04-08_5707636d493de.png "記錄關鍵幀") 選時間0.5改變背景![選時間0.5改變背景](https://box.kancloud.cn/2016-04-08_5707636d5c7f5.png "選時間0.5改變背景") 選時間,改變背景![](https://box.kancloud.cn/2016-04-08_5707636d7381f.png) 點播放可以看到我們做出來的 可以運行 移動到button顯示文字 在裝機必備移動到搜狐顯示搜狐 參考:[http://blog.csdn.net/lindexi_gd/article/details/50166161](http://blog.csdn.net/lindexi_gd/article/details/50166161) ~~~ <Button Click="souhu_Click" ToolTipService.ToolTip="搜狐視頻" Padding="0" > <Button.Content> <Grid> <Grid.RowDefinitions> <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> </Grid.RowDefinitions> <Image Source="ms-appx:///Assets/搜狐.png" Grid.Row="0" ScrollViewer.VerticalScrollBarVisibility="Disabled" /> <TextBlock Text="搜狐視頻" Grid.Row="1" HorizontalAlignment="Center" /> </Grid> </Button.Content> </Button> ~~~ ![這里寫圖片描述](https://box.kancloud.cn/2016-04-08_5707636d92e4a.jpg) 顯示圖片 ~~~ <Button Click="souhu_Click" Padding="0" > <Button.Content> <Grid> <Grid.RowDefinitions> <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> </Grid.RowDefinitions> <Image Source="ms-appx:///Assets/搜狐.png" Grid.Row="0" ScrollViewer.VerticalScrollBarVisibility="Disabled" /> <TextBlock Text="搜狐視頻" Grid.Row="1" HorizontalAlignment="Center" /> </Grid> </Button.Content> <ToolTipService.ToolTip> <Image Height="50" Width="50" Source="ms-appx:///Assets/搜狐.png"/> </ToolTipService.ToolTip> </Button> ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看