New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MacOS #650
Conversation
* [macOS] Fixed Tab NSImage crash in TabbedPageRenderer * Coding Style * Coding Style
@@ -13,6 +13,7 @@ | |||
[assembly: AssemblyConfiguration("")] | |||
[assembly: AssemblyCulture("")] | |||
[assembly: NeutralResourcesLanguage("en")] | |||
[assembly: InternalsVisibleTo("Xamarin.Forms.Maps.macOS")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:(
var textCell = (TextCell)tvc.Cell; | ||
if (args.PropertyName == TextCell.TextProperty.PropertyName) | ||
{ | ||
tvc.TextLabel.StringValue = ((TextCell)tvc.Cell).Text ?? ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you use textCell
here instead of casting again?
} | ||
else if (args.PropertyName == TextCell.DetailProperty.PropertyName) | ||
{ | ||
tvc.DetailTextLabel.StringValue = ((TextCell)tvc.Cell).Detail ?? ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you use textCell
here instead of casting again?
|
||
internal NSViewController ViewController => PlatformRenderer; | ||
|
||
internal static void DisposeModelAndChildrenRenderers(Element view) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it's really Model like yourself and children (this is the same on iOS)
if (rendererToRemove == null || rendererToRemove.Element == null) | ||
return; | ||
|
||
if (rendererToRemove.Element != null && GetRenderer(rendererToRemove.Element) == rendererToRemove) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already null check rendererToRemove.Element
just above this.
|
||
ITemplatedItemsView<Cell> TemplatedItemsView => Element; | ||
|
||
public const int DefaultRowHeight = 44; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This says 16 is the default row height for macOS.
_disposed = true; | ||
if (Element != null) | ||
{ | ||
//((ObservableList<string>)Element.Items).CollectionChanged -= RowsCollectionChanged; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a todo?
|
||
protected override void SetBackgroundColor(Color color) | ||
{ | ||
//base.SetBackgroundColor(color); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a todo?
[Export(nameof(UpdateScrollPosition))] | ||
void UpdateScrollPosition() | ||
{ | ||
System.Diagnostics.Debug.WriteLine("need to fix this math"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be a todo instead of a debug writeline?
else | ||
{ | ||
Control.StringValue = (string)values[1] ?? ""; | ||
// default value of color documented to be black in iOS docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about mac docs? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum.. didn't found it.
I'd recommend putting TODOs on all commented code to make it easier to find. |
Support was added in xamarin#650 (xamarin@52fc047)
@samhouts you were so right and i forgot , but did it now :) |
Description of Change
This PR adds support for MacOS backend on Xamarin.Forms.
All the controls are implemented expect OpenGLView, but not all features are present.
We have UITest rudimentary support on CI.
Opening the PR to prepare for review and merge in the following weeks. As well as get general feedback.
Take in mind most renderers are ported from the iOS counterpart and might have some incongruences that we can now fix in this new implementation , please point them out if see them.
Xamarin.Forms.Maps.MacOS.Extra is a extra lib that is only needed to support Cycle 8, it has some missing APIS that were only added to Xamarin.Mac in Cycle9.
Behavioral Changes
Add MacOS backend
PR Checklist