2017-10-19 8 views
0

私は、Windows 10 Creators Updateアプリのようにボタンの効果を得ようとしています。ボタンスタイルの作成者UWPを更新する

例ボタンイメージ

Example Button。私はすでにSDKを使用したアクリル効果を挿入した

MainPage.xamlをコード:

<Page 
x:Class="App1.MainPage" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:local="using:App1" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
mc:Ignorable="d"> 

<Grid x:Name="BaseGrid" Background="{ThemeResource SystemControlAcrylicElementBrush}"> 
    <Grid> 
     <Grid.ColumnDefinitions> 
      <ColumnDefinition Width="300"/> 
      <ColumnDefinition/> 
     </Grid.ColumnDefinitions> 
     <Grid Grid.Column="1" HorizontalAlignment="Stretch" Background="White"> 
     </Grid> 
    </Grid> 
</Grid> 

MainPage.xaml.csコード:

public sealed partial class MainPage : Page 
{ 
    public MainPage() 
    { 
     this.InitializeComponent(); 
     Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush(); 
     myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop; 
     myBrush.TintColor = Color.FromArgb(255, 202, 24, 37); 
     myBrush.FallbackColor = Color.FromArgb(255, 202, 24, 37); 
     myBrush.TintOpacity = 0.6; 
     BaseGrid.Background = myBrush; 
    } 
} 

しかし、どのようにしてマウスの「軽い」効果をその通過で得ることが可能であるか、クリック?

ユニークなスタイルにする必要がありますか?

ありがとうございます!

答えて

2

私はです。マップアプリから投稿した例に精通した極度のです。あなたが探している効果は、revealと呼ばれます。さまざまなコントロール(たとえば、ボタンの場合はButtonRevealStyle)で効果を有効にするために使用できるスタイルがいくつかあります。 AutoSuggestBoxの場合は、候補リスト内の項目に効果を有効にすることを検討しています。

ListViewを持ち、ListViewItem要素内にボタンまたは呼び出し可能なコンテンツがネストされている場合は、ネストされたアイテムに対してRevealを有効にする必要があります。

はこれを行うには、ListViewItemRevealStyleに基づくカスタムListViewItemスタイルにAutoSuggestBoxItemContainerStyleプロパティを設定する必要があります。そのスタイルで何が起こっているのか興味があれば、generic.xamlで調べることができます。

関連する問題