0

我的standardstyles.xaml 中的滑块有一些问题。如何在滑块上添加可以在实现数据模板的页面上使用的事件?

<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>
4

0 回答 0