2
Answers

How to bind wait cursor using mvvm in wpf?

Sumit Kumawat

Sumit Kumawat

12y
6.8k
1
Hi all ,
I am using one Convertor class to show waiting cursor while login here is my code :


 public class BoolToCursor : IValueConverter
    {
        private static readonly BoolToCursor defaultInstance = new BoolToCursor();
        public static BoolToCursor Default { get { return defaultInstance; } }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return (bool)value ? Cursors.Wait : Cursors.Arrow;
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return (bool)value ? Cursors.Arrow : Cursors.Wait;
        }
    }



and im writing one Bool property in my MVVM which im binding in my XAML code but my waiting cursor is not coming plz help

Answers (2)