WANT TO SHOW/HIDE CONTROL FROM VIEWMODEL IN WPF

Ankit Singh

Total Post:341

Points:2389
Posted by  Ankit Singh
WPF 
WPF
 1378  View(s)
Ratings:
Rate this:

I want to show/hide control from ViewModel in wpf. But NotifyingProperty not working fine here is my code.

This is my control on design View

<ZuneWithCtrls_UserControls:SmallClock Visibility="{Binding IsProcessStart, Converter={StaticResource BooleanToVisibilityConverter}}"

                Height="Auto" Width="Auto" VerticalAlignment="Center" HorizontalAlignment="Center" Canvas.Top="150"/>

ViewModel

    private readonly NotifyingProperty IsProcessStartProperty =

      new NotifyingProperty("IsProcessStart", typeof(bool), default(bool));

    public bool IsProcessStart

    {

        get { return (bool)GetValue(IsProcessStartProperty); }

        set { SetValue(IsProcessStartProperty, value); }

    }

On Constructor of ViewModel I set

public AdvanceSearchViewModel()

    {

       IsProcessStart = false;

    }

And I am changing this property on button click command but it's not working. 
Please help

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!