Click here to Skip to main content
15,350,704 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: ViewModel Locator Pin
Richard Deeming5-Apr-22 21:42
mveRichard Deeming5-Apr-22 21:42 
GeneralRe: ViewModel Locator Pin
Kevin Marois6-Apr-22 6:11
professionalKevin Marois6-Apr-22 6:11 
QuestionIs it possible to share SQL Server database between WPF application and Ionic application Pin
Alex Dunlop28-Mar-22 7:03
MemberAlex Dunlop28-Mar-22 7:03 
AnswerRe: Is it possible to share SQL Server database between WPF application and Ionic application Pin
Dave Kreskowiak28-Mar-22 10:11
mveDave Kreskowiak28-Mar-22 10:11 
AnswerRe: Is it possible to share SQL Server database between WPF application and Ionic application Pin
Mycroft Holmes28-Mar-22 12:28
professionalMycroft Holmes28-Mar-22 12:28 
QuestionDataTrigger not working Pin
Kevin Marois7-Mar-22 8:35
professionalKevin Marois7-Mar-22 8:35 
AnswerRe: DataTrigger not working Pin
Dave Kreskowiak7-Mar-22 10:27
mveDave Kreskowiak7-Mar-22 10:27 
AnswerRe: DataTrigger not working Pin
Richard Deeming7-Mar-22 21:15
mveRichard Deeming7-Mar-22 21:15 
The Visibility property set directly on the control overrides the value set by the style.

You also have the trigger on the password box the wrong way round - you want to hide it when the checkbox is checked, not unchecked.

And you have a typo in the binding for the textbox - IsCheckd instead of IsChecked.

Change your code to:
XAML
<PasswordBox 
    Grid.Row="0" 
    Grid.Column="0"
    TabIndex="2"
    cls:PasswordBoxAssistant.BindPassword="True"
    cls:PasswordBoxAssistant.BoundPassword="{Binding Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
    Width="400"
>
    <PasswordBox.Style>
        <Style TargetType="PasswordBox">
            <Setter Property="Visibility" Value="Visible" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding ElementName=chkShowPassword, Path=IsChecked}" Value="True">
                    <Setter Property="Visibility" Value="Hidden"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </PasswordBox.Style>
</PasswordBox>

<TextBox 
    Grid.Row="0" 
    Grid.Column="0"
    Text="{Binding Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
    TabIndex="2"
    Width="400"
>
    <TextBox.Style>
        <Style TargetType="TextBox" BasedOn="{StaticResource textBoxStyle}">
            <Setter Property="Visibility" Value="Hidden" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding ElementName=chkShowPassword, Path=IsChecked}"  Value="True">
                    <Setter Property="Visibility" Value="Visible"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </TextBox.Style>
</TextBox>




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: DataTrigger not working Pin
Kevin Marois8-Mar-22 5:32
professionalKevin Marois8-Mar-22 5:32 
QuestionQuestion about NotifyCollectionChangedEventArgs Pin
Super Lloyd1-Mar-22 12:12
MemberSuper Lloyd1-Mar-22 12:12 
AnswerRe: Question about NotifyCollectionChangedEventArgs Pin
Richard Deeming1-Mar-22 21:42
mveRichard Deeming1-Mar-22 21:42 
QuestionAnimation on DataGridRow jumps to wrong row when scrolling Pin
Mc_Topaz27-Feb-22 23:31
MemberMc_Topaz27-Feb-22 23:31 
AnswerRe: Animation on DataGridRow jumps to wrong row when scrolling Pin
Gerry Schmitz28-Feb-22 8:11
mveGerry Schmitz28-Feb-22 8:11 
GeneralRe: Animation on DataGridRow jumps to wrong row when scrolling Pin
Mc_Topaz28-Feb-22 20:28
MemberMc_Topaz28-Feb-22 20:28 
QuestionLabelprint on Thermotransfer Pin
Member 118002289-Feb-22 0:34
MemberMember 118002289-Feb-22 0:34 
QuestionRe: Labelprint on Thermotransfer Pin
Eddy Vluggen9-Feb-22 3:13
professionalEddy Vluggen9-Feb-22 3:13 
QuestionWPF c# onStartUp() view model problem with multiple data inputs Pin
StealthRT5-Feb-22 7:31
MemberStealthRT5-Feb-22 7:31 
AnswerRe: WPF c# onStartUp() view model problem with multiple data inputs Pin
Gerry Schmitz5-Feb-22 18:16
mveGerry Schmitz5-Feb-22 18:16 
AnswerRe: WPF c# onStartUp() view model problem with multiple data inputs Pin
Kevin Marois21-Feb-22 11:29
professionalKevin Marois21-Feb-22 11:29 
QuestionWpf System.Windows.Media.ImageSourcesConverter cannot be applied Pin
StealthRT1-Feb-22 16:08
MemberStealthRT1-Feb-22 16:08 
AnswerRe: Wpf System.Windows.Media.ImageSourcesConverter cannot be applied Pin
Richard Deeming1-Feb-22 21:49
mveRichard Deeming1-Feb-22 21:49 
GeneralRe: Wpf System.Windows.Media.ImageSourcesConverter cannot be applied Pin
StealthRT2-Feb-22 2:39
MemberStealthRT2-Feb-22 2:39 
GeneralRe: Wpf System.Windows.Media.ImageSourcesConverter cannot be applied Pin
Richard Deeming2-Feb-22 2:44
mveRichard Deeming2-Feb-22 2:44 
Question(beginner) There must be a better way (TextBlock properties) Pin
Maximilien26-Jan-22 5:08
MemberMaximilien26-Jan-22 5:08 
AnswerRe: (beginner) There must be a better way (TextBlock properties) Pin
Richard Deeming26-Jan-22 5:33
mveRichard Deeming26-Jan-22 5:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.