Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 772a48c

Browse files
Merge branch 'develop'
2 parents 8599750 + 992549f commit 772a48c

9 files changed

Lines changed: 96 additions & 2 deletions

File tree

MaterialDesignControls.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
33
<metadata minClientVersion="2.8.1">
44
<id>Plugin.MaterialDesignControls</id>
5-
<version>1.6.0</version>
5+
<version>1.6.1</version>
66
<title>MaterialDesignControls Plugin for Xamarin Forms</title>
77
<authors>Horus</authors>
88
<owners>AgustinBonillaHorus</owners>

example/ExampleMaterialDesignControls/Pages/MaterialPickerPage.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333
<Label x:Name="lblSelectedIndexes" Text="SelectedIndexes: -" />
3434
<material:MaterialButton Text="Save" Icon="save.png" Command="{Binding Tap2Command}" />
3535

36-
<material:MaterialDoublePicker Type="Filled" LabelText="Double Picker" Separator=" - "
36+
<material:MaterialDoublePicker x:Name="pckDoubleWithFocus" Type="Filled" LabelText="Double Picker" Separator=" - "
3737
ItemsSource="{Binding ItemsSource}" SecondaryItemsSource="{Binding SecondaryItemsSource}"
3838
SelectedItem="{Binding SelectedItem}" SecondarySelectedItem="{Binding SecondarySelectedItem}" />
39+
<material:MaterialButton Text="Focus" Command="{Binding Tap3Command}" />
3940
</StackLayout>
4041
</ScrollView>
4142
</ContentPage.Content>

example/ExampleMaterialDesignControls/Pages/MaterialPickerPage.xaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public MaterialPickerPage()
4242

4343
this.Tap2Command = new Command<string>(OnTap2);
4444

45+
this.Tap3Command = new Command<string>(OnTap3);
46+
4547
this.BindingContext = this;
4648
}
4749

@@ -76,5 +78,12 @@ public async void OnTap2(object parameter)
7678
{
7779
await this.DisplayAlert("Saved", $"{SelectedItem} - {SecondarySelectedItem}", "Ok");
7880
}
81+
82+
public ICommand Tap3Command { get; set; }
83+
84+
public async void OnTap3(object parameter)
85+
{
86+
this.pckDoubleWithFocus.Focus();
87+
}
7988
}
8089
}

src/MaterialDesignControls/Controls/MaterialDatePicker.xaml.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,11 @@ public Color PlaceholderColor
286286
set { SetValue(PlaceholderColorProperty, value); }
287287
}
288288

289+
public new bool IsFocused
290+
{
291+
get { return this.pckDate.IsFocused; }
292+
}
293+
289294
#endregion Properties
290295

291296
#region Methods
@@ -437,6 +442,15 @@ protected override void OnPropertyChanged([CallerMemberName] string propertyName
437442
}
438443
}
439444

445+
public new bool Focus()
446+
{
447+
Device.BeginInvokeOnMainThread(() =>
448+
{
449+
this.pckDate.Focus();
450+
});
451+
return true;
452+
}
453+
440454
private void Handle_Focused(object sender, FocusEventArgs e)
441455
{
442456
this.lblLabel.TextColor = this.FocusedLabelTextColor;

src/MaterialDesignControls/Controls/MaterialDoublePicker.xaml.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,11 @@ public Color PlaceholderColor
344344
set { SetValue(PlaceholderColorProperty, value); }
345345
}
346346

347+
public new bool IsFocused
348+
{
349+
get { return this.pckOptions.IsFocused; }
350+
}
351+
347352
#endregion Properties
348353

349354
#region Methods
@@ -565,6 +570,15 @@ protected override void OnPropertyChanged([CallerMemberName] string propertyName
565570
}
566571
}
567572

573+
public new bool Focus()
574+
{
575+
Device.BeginInvokeOnMainThread(() =>
576+
{
577+
this.pckOptions.Focus();
578+
});
579+
return true;
580+
}
581+
568582
private void Handle_Focused(object sender, FocusEventArgs e)
569583
{
570584
this.lblLabel.TextColor = this.FocusedLabelTextColor;

src/MaterialDesignControls/Controls/MaterialEditor.xaml.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ public bool AnimateError
294294
set { SetValue(AnimateErrorProperty, value); }
295295
}
296296

297+
public new bool IsFocused
298+
{
299+
get { return this.txtEditor.IsFocused; }
300+
}
301+
297302
#endregion Properties
298303

299304
#region Events
@@ -465,6 +470,15 @@ protected override void OnPropertyChanged([CallerMemberName] string propertyName
465470
}
466471
}
467472

473+
public new bool Focus()
474+
{
475+
Device.BeginInvokeOnMainThread(() =>
476+
{
477+
this.txtEditor.Focus();
478+
});
479+
return true;
480+
}
481+
468482
private void Handle_Focused(object sender, FocusEventArgs e)
469483
{
470484
this.lblLabel.TextColor = this.FocusedLabelTextColor;

src/MaterialDesignControls/Controls/MaterialEntry.xaml.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,11 @@ public bool AnimateError
348348
set { SetValue(AnimateErrorProperty, value); }
349349
}
350350

351+
public new bool IsFocused
352+
{
353+
get { return this.txtEntry.IsFocused; }
354+
}
355+
351356
#endregion Properties
352357

353358
#region Events
@@ -538,6 +543,15 @@ protected override void OnPropertyChanged([CallerMemberName] string propertyName
538543
}
539544
}
540545

546+
public new bool Focus()
547+
{
548+
Device.BeginInvokeOnMainThread(() =>
549+
{
550+
this.txtEntry.Focus();
551+
});
552+
return true;
553+
}
554+
541555
private void Handle_Focused(object sender, FocusEventArgs e)
542556
{
543557
this.lblLabel.TextColor = this.FocusedLabelTextColor;

src/MaterialDesignControls/Controls/MaterialPicker.xaml.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@ public Color PlaceholderColor
296296
set { SetValue(PlaceholderColorProperty, value); }
297297
}
298298

299+
public new bool IsFocused
300+
{
301+
get { return this.pckOptions.IsFocused; }
302+
}
303+
299304
#endregion Properties
300305

301306
#region Methods
@@ -471,6 +476,15 @@ protected override void OnPropertyChanged([CallerMemberName] string propertyName
471476
}
472477
}
473478

479+
public new bool Focus()
480+
{
481+
Device.BeginInvokeOnMainThread(() =>
482+
{
483+
this.pckOptions.Focus();
484+
});
485+
return true;
486+
}
487+
474488
private void Handle_Focused(object sender, FocusEventArgs e)
475489
{
476490
this.lblLabel.TextColor = this.FocusedLabelTextColor;

src/MaterialDesignControls/Controls/MaterialTimePicker.xaml.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ public Color PlaceholderColor
268268
set { SetValue(PlaceholderColorProperty, value); }
269269
}
270270

271+
public new bool IsFocused
272+
{
273+
get { return this.pckTime.IsFocused; }
274+
}
275+
271276
#endregion Properties
272277

273278
#region Methods
@@ -413,6 +418,15 @@ protected override void OnPropertyChanged([CallerMemberName] string propertyName
413418
}
414419
}
415420

421+
public new bool Focus()
422+
{
423+
Device.BeginInvokeOnMainThread(() =>
424+
{
425+
this.pckTime.Focus();
426+
});
427+
return true;
428+
}
429+
416430
private void Handle_Focused(object sender, FocusEventArgs e)
417431
{
418432
this.lblLabel.TextColor = this.FocusedLabelTextColor;

0 commit comments

Comments
 (0)