-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renaming public APIs Native --> Platform (#4599)
* Rename NativeView --> PlatformView * Rename NativeImage --> PlatformImage * Rename NativeArrange --> PlatformArrange * Rename NativeTicker --> PlatformTicker * Rename CreateNativeElement --> CreativePlatformElement * Rename CreateNativeWindow --> CreatePlatformWindow * Rename ToNative --> ToPlatform * Rename "Native" properties in IVisualElementController * Rename GetNativeSize --> GetPlatformSize * Rename Slider NativeMaxValue --> PlatformMaxValue * Rename CreateNativeControl --> CreatePlatformControl * Rename GetNativeRecognizer --> GetPlatformRecognizer * Rename ManageNativeControlLifetime --> ManagePlatformControlLifetime * Rename UpdateNativeSelection --> UpdatePlatformSelection * Rename UpdateNativeWidget --> UpdatePlatformWidget * Rename NativeControl --> PlatformControl * Rename NativeSelection --> PlatformSelection * Rename CreateNativePullToRefresh --> CreatePlatformPullToRefresh * Rename NativeHandler --> PlatformHandler * Rename NativeVersion --> PlatformVersion, NativeApis --> PlatformApis * Rename NativeElement --> PlatformElement and update related gradlew + generated code * Rename files using NativeElement --> PlatformElement * Rename NativeBinding --> PlatformBinding * Rename NativeWrapper --> PlatformWrapper * Rename NativeValue --> PlatformValue * Rename NativeShape --> PlatformShape * Rename NativeTicker --> PlatformTicker files * Rename nativeApplication --> platformApplication * Rename nativeWindow --> platformWindow * Rename nativeButton --> platformButton * Rename nativeCheckBox --> platformCheckBox * Rename nativeDatePicker --> platformDatePicker * Rename nativeLabel --> platformLabel * Rename nativePicker --> platformPicker * Rename nativeProgressBar --> platformProgressBar * Rename nativeStepper --> platformStepper * Rename nativeWebView --> platformWebView * Rename nativeText --> platformText * Rename nativeValue --> platformValue * Rename nativeRadioButton --> platformRadioButton * Rename nativePaint --> platformPaint * Rename nativeControl --> platformControl * Rename nativeApi --> platformApi * Rename nativeCell --> platformCell * Rename nativeView --> platformView * Fix renames that were missed in previous commits * Fix a couple more renames and bad merges * Rebase and rename again * Rename NativeView --> PlatformView * Rename ToNative --> ToPlatform * Rename nativeStepper --> platformStepper * Rename nativeRadioButton --> platformRadioButton * Rename nativeControl --> platformControl * Rename nativeView --> platformView * Fix a couple more renames and bad merges * Add missing parenthesis * Rename NativeColor --> PlatformColor * Rename NativeLabel --> PlatformLabel * Rename NativeCell --> PlatformCell * - fix merge * - rollback compatibility changes * - fix gallery and test cases * - fix XAML Unit Tests * - fix ui tests Co-authored-by: Shane Neuville <[email protected]>
- Loading branch information
1 parent
e168918
commit 3717ce0
Showing
784 changed files
with
5,799 additions
and
5,684 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
src/Compatibility/ControlGallery/src/Core/ControlGalleryPages/PlatformBindingGalleryPage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
using System; | ||
using Microsoft.Maui.Controls.Internals; | ||
using Microsoft.Maui.Graphics; | ||
|
||
namespace Microsoft.Maui.Controls.Compatibility.ControlGallery | ||
{ | ||
public class PlatformBindingGalleryPage : ContentPage | ||
{ | ||
public new StackLayout Layout { get; set; } | ||
public bool PlatformControlsAdded { get; set; } | ||
|
||
NestedPlatformViewModel ViewModel { get; set; } | ||
|
||
public const string ReadyForPlatformBindingsMessage = "ReadyForPlatformBindings"; | ||
|
||
protected override void OnAppearing() | ||
{ | ||
base.OnAppearing(); | ||
MessagingCenter.Send(this, ReadyForPlatformBindingsMessage); | ||
} | ||
|
||
public PlatformBindingGalleryPage() | ||
{ | ||
|
||
var vm = new NestedPlatformViewModel(); | ||
vm.FormsLabel = "Forms Label Binding"; | ||
vm.PlatformLabel = "Native Label Binding"; | ||
vm.PlatformLabelColor = Colors.Red; | ||
vm.Age = 45; | ||
|
||
Layout = new StackLayout { Padding = 20, VerticalOptions = LayoutOptions.FillAndExpand }; | ||
|
||
var buttonNav = new Button { Text = "New Page" }; | ||
buttonNav.Clicked += (object sender, EventArgs e) => | ||
{ | ||
App.Current.MainPage = new ContentPage { Content = new Label { Text = "New page" } }; | ||
}; | ||
|
||
var button = new Button { Text = "Change BindingContext " }; | ||
button.Clicked += (object sender, EventArgs e) => | ||
{ | ||
vm = new NestedPlatformViewModel(); | ||
vm.FormsLabel = "Forms Label Binding Changed"; | ||
vm.PlatformLabel = "Native Label Binding Changed"; | ||
vm.PlatformLabelColor = Colors.Pink; | ||
vm.Age = 10; | ||
BindingContext = ViewModel = vm; | ||
; | ||
}; | ||
|
||
var boxView = new BoxView { HeightRequest = 50 }; | ||
boxView.SetBinding(BoxView.BackgroundColorProperty, "PlatformLabelColor"); | ||
|
||
var label = new Label(); | ||
label.SetBinding(Label.TextProperty, "FormsLabel"); | ||
var labelAge = new Label(); | ||
labelAge.SetBinding(Label.TextProperty, nameof(vm.Age)); | ||
|
||
Layout.Children.Add(buttonNav); | ||
Layout.Children.Add(label); | ||
Layout.Children.Add(boxView); | ||
Layout.Children.Add(button); | ||
Layout.Children.Add(labelAge); | ||
|
||
BindingContext = ViewModel = vm; | ||
; | ||
|
||
Content = new ScrollView { Content = Layout }; | ||
} | ||
} | ||
|
||
|
||
[Preserve(AllMembers = true)] | ||
public class NestedPlatformViewModel : ViewModelBase | ||
{ | ||
string _formsLabel; | ||
public string FormsLabel | ||
{ | ||
get { return _formsLabel; } | ||
set { if (_formsLabel == value) return; _formsLabel = value; OnPropertyChanged(); } | ||
} | ||
|
||
string _platformLabel; | ||
public string PlatformLabel | ||
{ | ||
get { return _platformLabel; } | ||
set { if (_platformLabel == value) return; _platformLabel = value; OnPropertyChanged(); } | ||
} | ||
|
||
Color _platformLabelColor; | ||
public Color PlatformLabelColor | ||
{ | ||
get { return _platformLabelColor; } | ||
set { if (_platformLabelColor == value) return; _platformLabelColor = value; OnPropertyChanged(); } | ||
} | ||
|
||
int _age; | ||
public int Age | ||
{ | ||
get { return _age; } | ||
set { if (_age == value) return; _age = value; OnPropertyChanged(); } | ||
} | ||
|
||
bool _selected; | ||
public bool Selected | ||
{ | ||
get { return _selected; } | ||
set { if (_selected == value) return; _selected = value; OnPropertyChanged(); } | ||
} | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
src/Compatibility/ControlGallery/src/Issues.Shared/Controls/IPlatformColorService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Microsoft.Maui.Graphics; | ||
|
||
namespace Microsoft.Maui.Controls.Compatibility.ControlGallery | ||
{ | ||
public interface IPlatformColorService | ||
{ | ||
Color GetConvertedColor(bool shouldCrash); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.