datatemplate中滑块上的事件

时间:2013-03-21 16:00:59

标签: c# xaml windows-8

我的standardstyles.xaml中有滑块出现问题。 如何在滑块上添加一个事件,我可以在实现datatemplate的页面上使用它?

<DataTemplate x:Key="DimmerItemTemplate">
        <Grid HorizontalAlignment="Left" Width="225" Height="70" Background="#FFECECEC">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="175"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="38"/>
            </Grid.ColumnDefinitions>
            <Grid Grid.Column="2">
                <Image x:Name="imgLow" Stretch="UniformToFill"  Source="ms-appx:///Assets/HubPage/TileLowIcon.png" Visibility="{Binding Low}"/>
                <Image x:Name="imgHigh" Stretch="UniformToFill"  Source="ms-appx:///Assets/HubPage/TileHighIcon.png" Visibility="{Binding High}"/>
            </Grid>
            <StackPanel Margin="10,0,0,15" VerticalAlignment="Bottom">
                <TextBlock Text="{Binding Title}" Foreground="#FF999999" Style="{StaticResource TitleTextStyle}" Margin="0,0,0,5" FontSize="13.333" VerticalAlignment="Top" LineHeight="13.333"/>
                <Slider Height="30" Width="160" Name="DimmerSlider" ValueChanged="slider2_ValueChanged">
                </Slider>

            </StackPanel>
            <StackPanel VerticalAlignment="Bottom" Margin="0,0,0,15" Grid.Column="1">
                <TextBlock TextWrapping="Wrap" Text="{Binding Level1}" FontFamily="Segoe UI" Foreground="Black" FontSize="13.333" FontWeight="SemiBold" Margin="0"/>
                <TextBlock TextWrapping="Wrap" Text="{Binding Level2}" FontFamily="Segoe UI" Foreground="Black" FontSize="13.333" FontWeight="SemiBold" Margin="0"/>
            </StackPanel>
        </Grid>
    </DataTemplate>

0 个答案:

没有答案