SlideShare ist ein Scribd-Unternehmen logo
1 von 33
.NET Conf
Learn. Imagine. Build.
.NET Conf
Xamarin – Building cross-platform apps
Tsvyatko Konov
.NET Conf
About me
2005 2009 2014-Today
.NET Conf
.NET Conf
.NET Conf
.NET STANDARD
LIBRARIES
INFRASTRUCTURE
Xamarin Forms
.NET Conf
.NET Conf
.NET Conf
Native User Interfaces Native API Access Native Performance
.NET Conf
.NET Conf
@implementation MSViewController
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (IBAction)OnButtonDown:(id)sender {
UIAlertView* view =
[[UIAlertView alloc]init];
[view setTitle:@"Hello World"];
[view setMessage: @"How are you?”];
[view addButtonWithTitle:@"OK"];
[view show];
}
@end
public partial class iOSAppViewController :
UIViewController
{
public iOSAppViewController (IntPtr handle) :
base (handle){
}
public override void ViewDidLoad (){
base.ViewDidLoad ();
}
partial void OnButtonDown (UIButton sender)
{
UIAlertView view = new UIAlertView();
view.Title = "Hello World" ;
view.Message = "How are you? " ;
view.AddButton ("OK");
view.Show();
}
}
.NET Conf
.NET Conf
public class MyActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
Button myBtn = (Button) this.findViewById( R.id.clickMe);
myBtn.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View view) {
AlertDialog.Builder builder = new
AlertDialog.Builder(MyActivity.this) ;
builder.setTitle( "Hello World")
.setMessage("How are you?")
.setPositiveButton( "OK", new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface
dialogInterface, int i) {
dialogInterface.dismiss();
}}) .show();
}});
}
}
[Activity (Label = "AndroidApp", MainLauncher = true, Icon =
"@drawable/icon")]
public class MainActivity : Activity {
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.Main);
Button button = FindViewById<Button> (Resource.Id.me);
button.Click += delegate {
AlertDialog.Builder builder = new AlertDialog.Builder
(this );
AlertDialog dialog = null ;
builder.SetTitle ( "Hello World")
.SetMessage ( "How are you")
.SetPositiveButton( "OK" , delegate {
dialog.Dismiss(); } );
dialog = builder.Show ();
} ;
}
}
.NET Conf
•
https://docs.microsoft.com/en-us/windows/uwp/get-
started/whats-a-uwp
developer.tizen.org
https://developer.xamarin.com/guides/mac/
.NET Conf
.NET Conf
.NET Conf
public class EntryRenderer : ViewRenderer<Entry, EntryEditText>
{
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
if (e.OldElement == null)
{
this._textView = this.CreateNativeControl();
}
}
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.get_PropertyName() == Entry.TextProperty.PropertyName)
{
if (base.Control.get_Text() != base.Element.Text)
{
base.Control.set_Text(base.Element.Text);
if (base.Control.get_IsFocused())
{
base.Control.SetSelection(base.Control.get_Text().get_Length());
base.Control.ShowKeyboard();
}
}
}
base.OnElementPropertyChanged(sender, e);
}
.NET Conf
[assembly:ExportEffect (typeof(FocusEffect), "FocusEffect")]
namespace EffectsDemo.iOS
{
public class FocusEffect : PlatformEffect
{
...
protected override void OnElementPropertyChanged(PropertyChangedEventArgs args)
{
base.OnElementPropertyChanged(args);
if (args.PropertyName == "IsFocused")
{
if (Control.BackgroundColor == backgroundColor)
{
Control.BackgroundColor = UIColor.White;
}
else
{
Control.BackgroundColor = backgroundColor;
}
}
}
}
.NET Conf
<Entry Text="Effect attached to an Entry">
<Entry.Effects>
<local:FocusEffect />
</Entry.Effects>
...
</Entry>
Consuming the effect
.NET Conf
<Label Text="Text" >
<Label.FontSize>
<OnPlatform x:TypeArguments="x:Double"
iOS="20"
Android="22" />
</Label.FontSize>
</Label>
.NET Conf
#if __ANDROID__
string libraryPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
#elif __IOS__
string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
string libraryPath = Path.Combine (documentsPath, "..", "Library");
#else
string libraryPath = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
#endif
.NET Conf
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:ios="clr-namespace:UIKit;assembly=Xamarin.iOS;targetPlatform=iOS"
xmlns:androidWidget="clr-
namespace:Android.Widget;assembly=Mono.Android;targetPlatform=Android"
xmlns:formsAndroid="clr-
namespace:Xamarin.Forms;assembly=Xamarin.Forms.Platform.Android;targetPlatform=Android"
xmlns:win="clr-namespace:Windows.UI.Xaml.Controls;assembly=Windows,
Version=255.255.255.255, Culture=neutral, PublicKeyToken=null,
ContentType=WindowsRuntime;targetPlatform=Windows"
x:Class="NativeViewDeclaration.NativeViewDeclarationPage">
<ContentPage.Content>
<ios:UISwitch OnTintColor="{x:Static ios:UIColor.Red}"/>
<androidWidget:Switch x:Arguments="{x:Static formsAndroid:Forms.Context}"
Text="Enable Entry?" />
<win:ToggleSwitch Header="Enable Entry?" OffContent="No" OnContent="Yes />
</ContentPage.Content>
</ContentPage>
.NET Conf
.NET Conf
// #1 Initialize
Forms.Init(this, null);
// #2 Use it
_history = new HistoryPage().CreateFragment(this);
// #1 Initialize
Forms.Init();
...
// #2 Use it
_historyViewController = new HistoryPage().CreateViewController();
.NET Conf
// #1 Initialize
Forms.Init();
...
// #2 Use it
var content = new HistoryPage().CreateFrameworkElement();
.NET Conf
.NET Conf
Xamarin Forms – Live player (Preview)
.NET Conf
.NET Conf
Fast Renderers
internal sealed class ButtonRenderer : AppCompatButton, IVisualElementRenderer,
AView.IOnAttachStateChangeListener, AView.IOnFocusChangeListener,
IEffectControlProvider, AView.IOnClickListener, AView.IOnTouchListener
public class ButtonRenderer : ViewRenderer<Button, AButton>,
AView.IOnAttachStateChangeListener
.NET Conf
What’s coming
https://github.com/Microsoft/xaml-standard
https://blog.xamarin.com/glimpse-future-xamarin-forms-3-0/
.NET Conf
.NET Conf
https://developer.xamarin.com/guides/xamarin-
forms/creating-mobile-apps-xamarin-forms/
https://channel9.msdn.com/Events/Build/2017/B80
99
.NET Conf
https://github.com/davidortinau/build2017-new-
in-xamarin-forms
https://developer.xamarin.com/samples/xamarin-
forms/UserInterface/CustomLayout/WrapLayout/
Build cross-platform apps with Xamarin

Weitere ähnliche Inhalte

Was ist angesagt?

Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11Kamil Augustynowicz
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Ontico
 
Angular 2.0 Dependency injection
Angular 2.0 Dependency injectionAngular 2.0 Dependency injection
Angular 2.0 Dependency injectionEyal Vardi
 
Introduction To Angular's reactive forms
Introduction To Angular's reactive formsIntroduction To Angular's reactive forms
Introduction To Angular's reactive formsNir Kaufman
 
The Road to Native Web Components
The Road to Native Web ComponentsThe Road to Native Web Components
The Road to Native Web ComponentsMike North
 
Routing And Navigation
Routing And NavigationRouting And Navigation
Routing And NavigationEyal Vardi
 
Angular 2 Architecture
Angular 2 ArchitectureAngular 2 Architecture
Angular 2 ArchitectureEyal Vardi
 
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and NavigationAngular 2.0 Routing and Navigation
Angular 2.0 Routing and NavigationEyal Vardi
 
Boosting Angular runtime performance
Boosting Angular runtime performanceBoosting Angular runtime performance
Boosting Angular runtime performanceNir Kaufman
 
Template syntax in Angular 2.0
Template syntax in Angular 2.0Template syntax in Angular 2.0
Template syntax in Angular 2.0Eyal Vardi
 
Building scalable applications with angular js
Building scalable applications with angular jsBuilding scalable applications with angular js
Building scalable applications with angular jsAndrew Alpert
 
Angular 2 NgModule
Angular 2 NgModuleAngular 2 NgModule
Angular 2 NgModuleEyal Vardi
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS InternalEyal Vardi
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsLudmila Nesvitiy
 

Was ist angesagt? (20)

Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
 
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
 
Angular 2.0 Dependency injection
Angular 2.0 Dependency injectionAngular 2.0 Dependency injection
Angular 2.0 Dependency injection
 
Introduction To Angular's reactive forms
Introduction To Angular's reactive formsIntroduction To Angular's reactive forms
Introduction To Angular's reactive forms
 
The Road to Native Web Components
The Road to Native Web ComponentsThe Road to Native Web Components
The Road to Native Web Components
 
AngularJS Framework
AngularJS FrameworkAngularJS Framework
AngularJS Framework
 
Routing And Navigation
Routing And NavigationRouting And Navigation
Routing And Navigation
 
Angular 2 Architecture
Angular 2 ArchitectureAngular 2 Architecture
Angular 2 Architecture
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
 
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and NavigationAngular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
 
Boosting Angular runtime performance
Boosting Angular runtime performanceBoosting Angular runtime performance
Boosting Angular runtime performance
 
Template syntax in Angular 2.0
Template syntax in Angular 2.0Template syntax in Angular 2.0
Template syntax in Angular 2.0
 
Building scalable applications with angular js
Building scalable applications with angular jsBuilding scalable applications with angular js
Building scalable applications with angular js
 
Solid angular
Solid angularSolid angular
Solid angular
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
Angular 2 NgModule
Angular 2 NgModuleAngular 2 NgModule
Angular 2 NgModule
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
 
AngularJs
AngularJsAngularJs
AngularJs
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applications
 

Ähnlich wie Build cross-platform apps with Xamarin

MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentanistar sung
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS DevelopmentJussi Pohjolainen
 
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo Ali Parmaksiz
 
MBLTDev15: Egor Tolstoy, Rambler&Co
MBLTDev15: Egor Tolstoy, Rambler&CoMBLTDev15: Egor Tolstoy, Rambler&Co
MBLTDev15: Egor Tolstoy, Rambler&Coe-Legion
 
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageabilityDaniel Fisher
 
Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Murat Yener
 
Android development with Scala and SBT
Android development with Scala and SBTAndroid development with Scala and SBT
Android development with Scala and SBTAnton Yalyshev
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsHassan Abid
 
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Eyal Vardi
 
Quick Intro to Android Development
Quick Intro to Android DevelopmentQuick Intro to Android Development
Quick Intro to Android DevelopmentJussi Pohjolainen
 
How to code to code less
How to code to code lessHow to code to code less
How to code to code lessAnton Novikau
 
Droidcon ES '16 - How to fail going offline
Droidcon ES '16 - How to fail going offlineDroidcon ES '16 - How to fail going offline
Droidcon ES '16 - How to fail going offlineJavier de Pedro López
 

Ähnlich wie Build cross-platform apps with Xamarin (20)

MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app development
 
Gwt and Xtend
Gwt and XtendGwt and Xtend
Gwt and Xtend
 
iOS
iOSiOS
iOS
 
Gwt.create
Gwt.createGwt.create
Gwt.create
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS Development
 
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
 
MBLTDev15: Egor Tolstoy, Rambler&Co
MBLTDev15: Egor Tolstoy, Rambler&CoMBLTDev15: Egor Tolstoy, Rambler&Co
MBLTDev15: Egor Tolstoy, Rambler&Co
 
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
 
Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15Android and the Seven Dwarfs from Devox'15
Android and the Seven Dwarfs from Devox'15
 
Android development with Scala and SBT
Android development with Scala and SBTAndroid development with Scala and SBT
Android development with Scala and SBT
 
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter LehtoJavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture Components
 
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
 
Quick Intro to Android Development
Quick Intro to Android DevelopmentQuick Intro to Android Development
Quick Intro to Android Development
 
Android development
Android developmentAndroid development
Android development
 
How to code to code less
How to code to code lessHow to code to code less
How to code to code less
 
Scala on Your Phone
Scala on Your PhoneScala on Your Phone
Scala on Your Phone
 
Droidcon ES '16 - How to fail going offline
Droidcon ES '16 - How to fail going offlineDroidcon ES '16 - How to fail going offline
Droidcon ES '16 - How to fail going offline
 
Hexagonal architecture in PHP
Hexagonal architecture in PHPHexagonal architecture in PHP
Hexagonal architecture in PHP
 
mobl
moblmobl
mobl
 

Kürzlich hochgeladen

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 

Kürzlich hochgeladen (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 

Build cross-platform apps with Xamarin

  • 1. .NET Conf Learn. Imagine. Build. .NET Conf Xamarin – Building cross-platform apps Tsvyatko Konov
  • 2. .NET Conf About me 2005 2009 2014-Today
  • 8. .NET Conf Native User Interfaces Native API Access Native Performance
  • 10. .NET Conf @implementation MSViewController - (void)viewDidLoad { [super viewDidLoad]; } - (IBAction)OnButtonDown:(id)sender { UIAlertView* view = [[UIAlertView alloc]init]; [view setTitle:@"Hello World"]; [view setMessage: @"How are you?”]; [view addButtonWithTitle:@"OK"]; [view show]; } @end public partial class iOSAppViewController : UIViewController { public iOSAppViewController (IntPtr handle) : base (handle){ } public override void ViewDidLoad (){ base.ViewDidLoad (); } partial void OnButtonDown (UIButton sender) { UIAlertView view = new UIAlertView(); view.Title = "Hello World" ; view.Message = "How are you? " ; view.AddButton ("OK"); view.Show(); } }
  • 12. .NET Conf public class MyActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { Button myBtn = (Button) this.findViewById( R.id.clickMe); myBtn.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { AlertDialog.Builder builder = new AlertDialog.Builder(MyActivity.this) ; builder.setTitle( "Hello World") .setMessage("How are you?") .setPositiveButton( "OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); }}) .show(); }}); } } [Activity (Label = "AndroidApp", MainLauncher = true, Icon = "@drawable/icon")] public class MainActivity : Activity { protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.Main); Button button = FindViewById<Button> (Resource.Id.me); button.Click += delegate { AlertDialog.Builder builder = new AlertDialog.Builder (this ); AlertDialog dialog = null ; builder.SetTitle ( "Hello World") .SetMessage ( "How are you") .SetPositiveButton( "OK" , delegate { dialog.Dismiss(); } ); dialog = builder.Show (); } ; } }
  • 16. .NET Conf public class EntryRenderer : ViewRenderer<Entry, EntryEditText> { protected override void OnElementChanged(ElementChangedEventArgs<Entry> e) { if (e.OldElement == null) { this._textView = this.CreateNativeControl(); } } protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.get_PropertyName() == Entry.TextProperty.PropertyName) { if (base.Control.get_Text() != base.Element.Text) { base.Control.set_Text(base.Element.Text); if (base.Control.get_IsFocused()) { base.Control.SetSelection(base.Control.get_Text().get_Length()); base.Control.ShowKeyboard(); } } } base.OnElementPropertyChanged(sender, e); }
  • 17. .NET Conf [assembly:ExportEffect (typeof(FocusEffect), "FocusEffect")] namespace EffectsDemo.iOS { public class FocusEffect : PlatformEffect { ... protected override void OnElementPropertyChanged(PropertyChangedEventArgs args) { base.OnElementPropertyChanged(args); if (args.PropertyName == "IsFocused") { if (Control.BackgroundColor == backgroundColor) { Control.BackgroundColor = UIColor.White; } else { Control.BackgroundColor = backgroundColor; } } } }
  • 18. .NET Conf <Entry Text="Effect attached to an Entry"> <Entry.Effects> <local:FocusEffect /> </Entry.Effects> ... </Entry> Consuming the effect
  • 19. .NET Conf <Label Text="Text" > <Label.FontSize> <OnPlatform x:TypeArguments="x:Double" iOS="20" Android="22" /> </Label.FontSize> </Label>
  • 20. .NET Conf #if __ANDROID__ string libraryPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); #elif __IOS__ string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); string libraryPath = Path.Combine (documentsPath, "..", "Library"); #else string libraryPath = Windows.Storage.ApplicationData.Current.LocalFolder.Path; #endif
  • 21. .NET Conf <?xml version="1.0" encoding="utf-8"?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:ios="clr-namespace:UIKit;assembly=Xamarin.iOS;targetPlatform=iOS" xmlns:androidWidget="clr- namespace:Android.Widget;assembly=Mono.Android;targetPlatform=Android" xmlns:formsAndroid="clr- namespace:Xamarin.Forms;assembly=Xamarin.Forms.Platform.Android;targetPlatform=Android" xmlns:win="clr-namespace:Windows.UI.Xaml.Controls;assembly=Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime;targetPlatform=Windows" x:Class="NativeViewDeclaration.NativeViewDeclarationPage"> <ContentPage.Content> <ios:UISwitch OnTintColor="{x:Static ios:UIColor.Red}"/> <androidWidget:Switch x:Arguments="{x:Static formsAndroid:Forms.Context}" Text="Enable Entry?" /> <win:ToggleSwitch Header="Enable Entry?" OffContent="No" OnContent="Yes /> </ContentPage.Content> </ContentPage>
  • 23. .NET Conf // #1 Initialize Forms.Init(this, null); // #2 Use it _history = new HistoryPage().CreateFragment(this); // #1 Initialize Forms.Init(); ... // #2 Use it _historyViewController = new HistoryPage().CreateViewController();
  • 24. .NET Conf // #1 Initialize Forms.Init(); ... // #2 Use it var content = new HistoryPage().CreateFrameworkElement();
  • 26. .NET Conf Xamarin Forms – Live player (Preview)
  • 28. .NET Conf Fast Renderers internal sealed class ButtonRenderer : AppCompatButton, IVisualElementRenderer, AView.IOnAttachStateChangeListener, AView.IOnFocusChangeListener, IEffectControlProvider, AView.IOnClickListener, AView.IOnTouchListener public class ButtonRenderer : ViewRenderer<Button, AButton>, AView.IOnAttachStateChangeListener

Hinweis der Redaktion

  1. Ximian Acquisitions by Novel at 2003, Attachmate 2011 – then layoffs of mono engineers. Evolve 2016 brought Steve Wozniak on stage
  2. Ximian Acquisitions by Novel at 2003, Attachmate 2011 – then layoffs of mono engineers. Evolve 2016 brought Steve Wozniak on stage
  3. When we talk about .NET we’re talking about an entire unified platform and ecosystem. Any workload on .NET supports .NET Standard going forward. With Mono now under the .NET Foundation we can steer the direction of all of these implementations more easily. Each .NET implementation be that .NET Framework, .NET Core, or Mono for Xamarin & Unity, share the same common infrastructure and .NET Standard library. This means not only are your .NET skills portable, but your actual binaries are portable across implementations. You can think of the .NET Standard to HTML5 – it’s a specification of HTML that browsers must implement. Similarly, the .NET Standard defines the API’s that all the .NET’s must implement. This is the promise of .NET Everywhere. See: https://docs.microsoft.com/en-us/dotnet/articles/standard/components
  4. Monotouch keeps its references with retains for automatic disposing from the auto refcounting
  5. Monotouch keeps its references with retains for automatic disposing from the auto refcounting
  6. Monotouch keeps its references with retains for automatic disposing from the auto refcounting