zoukankan      html  css  js  c++  java
  • WPF UpdateSourceTrigger的使用

    <Window x:Class="XamlTest.Window8"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="Window8" Height="300" Width="300">
        <Grid>
            <StackPanel>

                <TextBox Text="{Binding ElementName=slider, Path=Value, UpdateSourceTrigger=PropertyChanged}"></TextBox>    

    //      PropertyChanged:更改后直接更新源 

     <!--<TextBox Text="{Binding ElementName=slider, Path=Value, UpdateSourceTrigger=LostFocus}"></TextBox>-->

    //      LostFocus:失去焦点后更新源 

    <!--<TextBox Text="{Binding ElementName=slider, Path=Value, UpdateSourceTrigger=Explicit}"></TextBox>-->

    //      Explicit:不更新源 

     <Slider Name="slider" Minimum="1" Maximum="100" TickPlacement="BottomRight" TickFrequency="1"></Slider>
            </StackPanel>
        </Grid>
    </Window>
  • 相关阅读:
    [概率论]2017.5.9
    [概率论] 2017 5.2
    [离散数学II]2017.5.2
    [离散数学II]2017.4.25
    [概率论]2017.4.19
    [概率论] 2017.4.18
    [离散数学II]2017.4.18
    [离散数学II]2017.4.11
    [概率论]2017.4.12
    [概率论]2017.4.5
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9434629.html
Copyright © 2011-2022 走看看