DwightHyde

Badges

Name DropperFirst Anniversary10 CommentsPhotogenicFirst AnswerFirst Comment

About

Username
DwightHyde
Location
US
Joined
Visits
220
Last Active
Roles
Member
Points
33
Badges
6

DwightHyde ✭✭

About

Username
DwightHyde
Location
US
Joined
Visits
220
Last Active
Roles
Member
Points
33
Badges
6
  • Re: NSDictionary

    I worked with our Microsoft Xamarin rep and this is what ended up working:

            var keys = new[]
            {   
                new NSString("action"),
                new NSString("flow"),
                new NSString("rfvid"),
                new NSString("skip")
            };
    
            var objects = new NSString[]
            {
                // don't have to be strings... can be any NSObject.
                new NSString("scheduling"),
                new NSString("vt"),
                new NSString("2109000006"),
                new NSString("1")
            };
    
            var dictionary = new NSDictionary<NSString, NSString>(keys, objects);
    

    Thanks everyone for your feedback and help.

  • Re: Multiple Clicks on Xamarin Forms Button

    I ended up doing the following - thanks for your insights

       bool canExecute = true;
    
        public bool CanExecute
        {
            get
            {
                return canExecute;
            }
            set
            {
                canExecute = value;
                NotifyPropertyChanged(nameof(CanExecute));
            }
        }
        public Command Submit { get; private set; }
    
    
    
      public TechSupportViewModel()
        {
       .... 
            Submit = new Command(async () => await ExecuteSubmit(), () => canExecute);
        }
    
    
    
     public async Task<bool> ExecuteSubmit()
        {
       //disable the button so they can't click on it multiple times
            CanExecute = false;
    
            if (CheckRequiredFields())
            {
                //submit form all is good
            }
            else
            {
        //re-enable the button so they can fix errors
                CanExecute = true;
            }
    
            return true;
        }
    

    The XAML button now looks like this:
    Button Text="Submit" Style="{StaticResource UCHRedButton}" Command="{Binding Submit}" IsEnabled="{Binding CanExecute}" />