<StackPanel Orientation="Horizontal"> <Grid Margin="25,0,0,0" HorizontalAlignment="Center"> <TextBlock Text="اسم المستخدم" FontWeight="Light" FontSize="18" Foreground="White" Background="Transparent" Width="230" Opacity="0.5" Height="28" Visibility="{Binding Path=VisbTbU , Mode=TwoWay}"/> <TextBox FontFamily="Helvetica" FontWeight="Light" FontSize="18" HorizontalAlignment="Center" Foreground="White" Background="Transparent" BorderThickness="0" Width="235" HorizontalContentAlignment="Left" Opacity="0.5" Height="25" Text="{Binding UserLog}" /> </Grid> <iconPacks:PackIconMaterial Kind="Account" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" /> </StackPanel>
public VmWinLogin() { VisbTbp = Visibility.Visible; VisbTbp = Visibility.Visible; UserLog = ""; UserPass = ""; } private Visibility _VisbTbU ; public Visibility VisbTbU { get => _VisbTbU; set { _VisbTbU = value; // OnPropertyChanging(); OnPropertyChanging(); } } private string _UserLog ; public string UserLog { get => _UserLog .Trim(); set { _UserLog = value .Trim(); OnPropertyChanging(); if (_UserLog == "") { VisbTbU = Visibility.Visible; } else { VisbTbU = Visibility.Hidden; } } }
public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; [NotifyPropertyChangedInvocator] protected virtual void OnPropertyChanging([CallerMemberName] string propertyName = null) { PropertyChanging?.Invoke(this, new PropertyChangingEventArgs(propertyName)); }
OnPropertyChanging
OnPropertyChanged
PropertyChanged
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)