tutors Xamarin programming What is Xamarin Creating UI-apps with XAML Accessing remote data Different devices and capabilities

Size: px
Start display at page:

Download "tutors Xamarin programming What is Xamarin Creating UI-apps with XAML Accessing remote data Different devices and capabilities"

Transcription

1 Xamarin programming What is Xamarin Creating UI-apps with XAML Accessing remote data Different devices and capabilities

2 Topics Xamarin overview Cross-platform development Xamarin features Architecture Getting started Hello world with Xamarin Content Page Basic components Application class Application lifecycle Using XAML Basic constructs Data binding MVVM -model Bindable properties Attached properties Using styles Templates Trigers Ui-techniques Implementing navigation Effects Localization Native views Other features Using files Using SQLite Dependency service Messaging center Accessing cloud Consuming SOAP Consuming REST Azure integration Extra Graphics Accessing Camera Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 2

3 Xamarin Overview Cross-platform development Xamarin features Architecture

4 Cross-platform development Mobile development for different platforms may be tedious Different features Different hardware Different programming languages Even when pretty much the same concepts exist on all platforms This is where Xamarin comes in Xamarin offers an abstraction layer on top of different mobile platforms And uniform API to build applications for all devices Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 4

5 Xamarin features Support for ios, Android and Windows Phone (UWA) Depending on the solution most of the code should be shared between platforms Bindings to native API Platform dependent API can be accessed when needed Development is done with Visual Studio and C# Using subset of.net base classes (Mono.Android.dll, MonoTouch.dll) Xamarin.Forms Library for creating cross-platform UI SkiaSharp 2D-graphics Based on Google s Skia-library used on Android and Chrome UrhoSharp 3D-graphics engine Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 5

6 Xamarin-solution In your solution you will have a project for each platform you target And separate project for shared code Either a shared project from where the files are just compiled into the platform specific binaries Or actual Portable Class Library (PCL) Most of your code should go to the shared-code project UI: Xaml and code behind Occasionally you might need some platform-specific features All general logic (BL) Most of the data-access Occasionally you might need some platform-specific features Some of the device access technologies are abstracted by Xamarin, but you also might need to use some device specific APIs Even simple stuff like file access is not uniform for all device types Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 6

7 Word about mobile development When building end user applications for PC-users you don t typically worry about running out of system resources Performant processors 4-16GB memory that is extended by virtual memory technology to virtually unlimited amount (disk-file extends the physical RAM) Now you are kind of building an embedded application Less performant processors Less memory Less storage You will have to implement you application so that it doesn t steal the resources from other applications Favor non-blocking asynchronous methods Use minimum amount of memory Release resources when you are not running in foreground You cannot expect to have gigabytes of storage available Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 7

8 Getting started Hello World Content page and basic components Application class Application lifecycle

9 Hello world Project creation Project type: Blank App, Master Detail UI Technology: Xamarin.Forms, Native Code Sharing Strategy: Shared Project, Portable Class Library Creates a solution with four projects Root (What-ever you named your solution) Root.Android Root.iOS Root.UWP Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 9

10 Application class Reads the XAML-definitions at InitializeComponent Sets the MainPage Provides the lifecycle methods public partial class App : Application public static List<String> Events = new List<string>(); public App () <StackLayout> InitializeComponent(); <Label Text="Lifecycle events" /> MainPage = new App2.MainPage(); <ListView ItemsSource="x:Static local:app.events" /> </StackLayout> protected override void OnStart () Events.Add("Started " + DateTime.Now.ToShortTimeString()); protected override void OnSleep () Events.Add("Sleep " + DateTime.Now.ToShortTimeString()); protected override void OnResume () Events.Add("Resume " + DateTime.Now.ToShortTimeString()); Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 10

11 Application lifecycle Xamarin.Forms hides the device and OS-specific states We just catch the Sleep and Resume events If you need to catch more precise lifecycle events you need to study the platform specific libraries LeavingBackground Running in Foreground EnteringBackground Launch Running in Background Running in Background Suspended Resuming Suspending Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 11

12 So where is the main? Different entry-points for different platforms ios Main.cs and especially AppDelegate.cs Android MainActivity.cs UWP App.xaml and App.xaml.cs declare the application class Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 12

13 Main-page May be one of supperted page-types ContentPage MasterDetailPage NavigationPage TabbedPage TemplatedPage CarouselPage ContentPage is easiest to get started with Other page-types offer behaviour as their names indicate Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 13

14 Using ContentPage ContentPage can only hold one child The child held on ContentPage is very often a container (a Layout) Layouts provide different means for positioning items ScrollView Frame StackLayout AbsoluteLayout RelativeLayout GridLayout TemplatedView ContentView ContentPresenter StackLayout is perhaps one of the easiest to get started with Items are placed on top of each other (or side by side) Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 14

15 Basic components, the views Despite the name, the views are not something that fill the entire screen. They are the basic building blocks of the UI, the components ActivityIndicator BoxView Button DatePicker Editor Entry Image Label ListView OpenGLView Picker ProgressBar SearchBar Stepper Switch TableView TimePicker WebView Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 15

16 Exercise - Hello world Create the Xamarin.Forms -application CourseApp Study the solution items Especially the CourseApp-project App.xaml (+cs) MainPage.xaml (+cs) The CourseApp.Android will be the Active Project Launch the application in the emulator Or device if you have one attached Modify the MainPage It should hold a StackLayout That in turn holds a Label and button Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 16

17 Events Event handling is quite straight-forward Event is described in XAML, the handler is implemented to Page-class Notice the x:name-attribute for the components MainPage.xaml <StackLayout> <Label x:name="titletext" Text="Welcome to Xamarin Forms!" /> <Button x:name= Greet" Text="Calculator Clicked= Greet_Clicked" /> </StackLayout> private void Greet_Clicked(object sender, EventArgs e) TitleText.Text = "From here to eternity"; Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 17

18 Getting started with NavigationPage Just wrap the MainPage in App-constructor with NavigationPage MainPage = new NavigationPage(new App1.MainPage()); Now you may implement event handlers to push items into navigation stack Or pop items to go back to previous page Notice that navigation is implemented in asynchronous manner It might take some time before the new page becomes initialized Navigation causes OnDisappearing and OnAppearing calls to the pages affected async private void Navigate_Clicked(object sender, EventArgs e) await Navigation.PushAsync(new SecondPage()); Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 18

19 Exercise Implement a new ContentPage EventsCalculator Holds two Entry-views, a Button and Label for Result When the button is clicked display the sum of figures entered into the Entry-fields in the Result-field Navigate to the Calculator from the MainPage Add exception handling Add some attributes to the Entry-fields Keyboard="Numeric" Placeholder="Figure1" Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 19

20 Using XAML UI-patterns Basic XAML-techniques MVVM and Databinding

21 UI-patterns Model-View-Controller Decouples the user interface from the data model Most suitable for Web development Creates Model Controller Action Uses Selects View Model-View-Presenter Presenter Evolves the MVC pattern for event-driven applications Notify Update Action Update Most suitable for forms-over-data development Introduces databinding Model Databinding View Model-View-ViewModel Evolves from the MVP pattern Very commonly used now-a-days More loosely coupled, very flexible Notify Model ViewModel Update Binding Commands Notify View Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 21

22 MVVM - View, Binder and ViewModel View (UI) Binder (xaml) ViewModel Model The View CodeBehind (Page-class) MVVM is a pattern created by Microsoft especially for WPF-applications Now-a-days used on other platforms also Like any pattern can actually be implemented in many ways The key idea is the abstraction of data- and command-binding to xaml Basis for WPF-, UWA and Xamarin-programming Deep understanding of xaml and binding mechanisms provided by it are needed ViewModel provides the data to the view in format it is easily used in the ui: Mediator, Adapter Objects should/could implement INotifyPropertyChanged Collections should/could implement INotifyCollectionChanged (or inherit ObservableCollection) CodeBehind may implement UI-logic associated with the view ViewModel also may contain logic, but it should be view -independent Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 22

23 MVVM - ViewModel and Model View ViewModel Mediator DTO DTO DTO Runtime snapshot of the model DAO DAO DAO Abstraction of storage Storage Persistent, Valid representation of model THERE IS NOT JUST ONE STRAIGHT-FORWARD, ALWAYS TO USE SOLUTION At runtime the model is represented by collection of objects holding the data application is to maintain Some abstraction is needed on how the model is generated Factories, Repositories If data is stored into a database or available through web services DAO-pattern is very convenient The ViewModel shouldn t create the model-objects but ask them from a third-party And most likely we end up with having Data Transfer Objects (Value Objects) holding the data The ViewModel requests data from DAO-objects getting multiple DTOs ViewModel then constructs (or operates as) mediator providing services that combine the manipulation of otherwise unrelated DTOs Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 23

24 Role of XAML The XAML describes the view How should it look like The XAML also describes the databinding What data is presented, how it is presented The XAML also describes event handling OnClick etc, View-specific actions The XAML also describes commanding Application wide and ViewModel -related actions The XAML can also describe some behaviors for the view Animations are a good example Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 24

25 Describing the UI The XAML is used to describe the UI We need the root-element And quite a few XML-namespaces declared And we describe the UI for the root element Calculator.xaml <?xml version="1.0" encoding="utf-8"?> <ContentPage xmlns=" xmlns:x=" x:class="uidemos.calculator"> <ContentPage.Content> <StackLayout> <Label Text="Event-based Calculator!" /> <Entry x:name="figure1" Keyboard="Numeric" Placeholder="Figure1" /> <Entry x:name="figure2" Keyboard="Numeric" Placeholder="Figure2" /> <Button Text="Calculate" Clicked="Calculate_Clicked" /> <Entry x:name="result" /> </StackLayout> </ContentPage.Content> </ContentPage> Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 25

26 Databinding Databinding is one of the strongest features available to us Sadly sometimes ignored and misused We have Binding target => Attribute of an element is described with binding Binding source => Property of an object providing the data Type conversion, in many cases automatic Two-way, One-way <StackLayout> <StackLayout Orientation="Horizontal" HorizontalOptions="Fill"> <Label Text="Value is" HorizontalOptions="FillAndExpand"/> <Entry x:name="value1" BindingContext="x:Reference Slider1" Keyboard="Numeric" HorizontalOptions="FillAndExpand" Text="Binding Value,Mode=TwoWay" /> </StackLayout> <Slider x:name="slider1" Minimum="0" Maximum="20" Value="10" /> <Label x:name="value2" BindingContext="x:Reference Slider2" Text="Binding Value, Mode=OneWay, StringFormat='The value is 0:F1'" /> <Slider x:name="slider2" Minimum="0" Maximum="20" Value="10" /> <StackLayout Orientation="Horizontal" HorizontalOptions="Fill"> <Label Text="Enter value" HorizontalOptions="FillAndExpand"/> <Entry x:name="value3" BindingContext="x:Reference Slider3" Keyboard="Numeric" HorizontalOptions="FillAndExpand" Text="Binding Value,Mode=OneWayToSource" /> </StackLayout> <Slider x:name="slider3" Minimum="0" Maximum="20" Value="10" /> </StackLayout> You can use databinding almost to any attribute of any element on Xaml to any property of any object in the application. Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 26

27 Setting BindingContext to custom object Often you should create a new object-type to contain data for your ui (the ViewModel) Instead of adding huge number of properties to you Window-class Then you can set the BindingContext-property to point to a new object of your class Typically for the entire page But can also be set separately for each container Of course the object can also be instantiated and the BindingContext be set in the constructor class MyData public string data get; set; public MyData() data = "Hello"; <!-- local namespace --> <ContentPage.BindingContext> <local:mydata /> </ContentPage.BindingContext> OR public MyPage() BindingContext=new MyData(); InitializeComponent(); Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 27

28 Notifications To reflect changes of data to UI the model objects need to provide a PropertyChanged-event MyData.cs class MyData : INotifyPropertyChanged public event PropertyChangedEventHandler PropertyChanged; private string data = ""; public string Data get return data; set data = value; if (PropertyChanged!=null) PropertyChanged(this, new PropertyChangedEventArgs( Data")); Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 28

29 Exercise - MVVM Calculator Create a new page BindingCalculator Similar UI to the previous calculator but without the button Add navigation to the new Calculator from the MainPage Create CalculatorVM-class holding Figure1, Figure2 and Result-properties Implement the class in such a manner that you may use it as a ViewModel for your calculator Describe Calculation object as BindingContext for the CalculatorWithModel Use databinding in the xaml to the properties of CalculatorVM object So in this exercise you should NOT touch BindingCalculator.xaml.cs at all Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 29

30 Commanding Commanding offers more separation on object invoking the command and object executing the command Several sources for single action UI understands if the command can be invoked Several components know how to invoke commands Button MenuItem ToolbarItem SearchBar TextCell, ImageCell ListView TapGestureRecognizer Actions that manipulate state of ViewModel should be declared as commands Actions that manipulate the View can be handled as events Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 30

31 Command in ViewModel The ViewModel may contain properties that implement ICommand Variations exist on how to implement class DemoVM : INotifyPropertyChanged private string greeting="greeting from DemoVM"; public ICommand DoCommand get; set; public DemoVM() DoCommand = new Command( ProcessCommand, CanProcessCommand); private void ProcessCommand(object s) Greeting = s.tostring(); Different constructors available public string Greeting get return greeting; set greeting = value; (DoCommand as Command).ChangeCanExecute(); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Greeting")); Enable/disable component private bool CanProcessCommand(object o) return greeting.length > 8; <!-- BindingContext must be MyViewModel <Button Text="Execute command" --> Command="Binding DoCommand" CommandParameter="Altered by Command"/> Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 31

32 Having a collection in the model Data binding can be done towards any IEnumerable How ever the UI will not automatically know if items are added, deleted or replaced in the collection INotifyCollectionChanged describes the event that should be fired when collection changes ObservableCollection is a convenience-class implementing INotyfyCollectionChanged Provides List-like operations, but doesn t implement IList Can be instantiated from any IEnumerable Easy to use, and misuse List<Person> personlist =...; ObservableCollection<Person> col=new ObservableCollection<Person>(personList); Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 32

33 How to use ObservableCollection Not all collections in the ViewModel need to be Observable, analyze your need Don t replace the collection, modify the contents Events are subscribed from a specific instance OK, clearing and then adding huge number of items is not a good idea either You can use LINQ against ObservableCollection but the returned collection is not Observable Don t modify in background thread Modifications cause events that should be processed in the main thread So quite a few design considerations. Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 33

34 Design considerations View (UI) ViewModel (BL) Model (DA) Who is responsible of creating the observables? The view requires observables so the ViewModel should provide them But not all objects need to be observable Depending on the data source the Model might readily provide observables or just plain value objects Should the model objects know when they are updated? Kind of makes us think that the ViewModel should capsulate the objects into observables, but This would lead into dublicate definition of value-objects The basic rule should be: Each tier should provide easy to use service interface to the next tier -> Simplify the work at upper levels and let them concentrate on the logic Debate exists but the authors opinion is that DA-tier should provide observables to the ViewModel Perhaps even give alternatives: GetPerson, GetObservablePerson, GetPersonList, GetObservablePersonList Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 34

35 Grid-view Grid allows somewhat precise layout of items Columns and rows <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="200" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="30" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <ResourceDictionary> <x:array x:key="somearray" Type="x:Type x:string"> <x:string>hello</x:string> <x:string>there</x:string> <x:string>how</x:string> <x:string>is</x:string> <x:string>life</x:string> </x:array> </ResourceDictionary> <Label Text="Grid and List" Grid.Row="0" Grid.ColumnSpan="2"/> <Label Text="Name" Grid.Column="0" Grid.Row="1" /> <Label Text=" " Grid.Column="0" Grid.Row="2" /> <Entry Placeholder="Name" Grid.Column="1" Grid.Row="1" /> <Entry Placeholder=" " Grid.Column="1" Grid.Row="2" /> <ListView Grid.Row="3" ItemsSource="StaticResource SomeArray" /> </Grid> Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 35

36 ListView Listview is often bound to a collection of complex item List of Persons ItemTemplate can be used to declare how items are presented <ListView Grid.Row="4" Grid.ColumnSpan="2" ItemsSource="Binding Persons"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="36" /> <ColumnDefinition Width="300" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Image Grid.Column="0 Source="Binding Path=GenderImage" /> <Label Grid.Column="1" Text="Binding Path=Name" HorizontalTextAlignment="Start" VerticalOptions="Center"/> <Label Grid.Column="2" Text="Binding Path=Age" VerticalOptions="Center"/> </Grid> </ViewCell> </DataTemplate> </ListView.ItemTemplate> </ListView> Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 36

37 Exercise One more calculator: ListCalculator Describe the layout with a grid (two columns, basically Label and Entry where needed) Also Button Accept and a ListView When button is clicked the calculation should appear on the ListView Create Calculation class with properties Figure1,Figure2, Result On the ViewModel hold ObservableCollection to Calculations Bind the ListView to the ObservableCollection Use Commanding to Instruct the ViewModel to add a new Calculation to the ObservableCollection Also catch ItemTapped-event from ListView to cause SelectedCommand against ViewModel. Display data from selected calculation in the UI. Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 37

38 Gestures Gestures indicate user interaction with a component Tap Pinch Pan Gestures can be attached even to elements that don t signal events <Label FontSize="Large" Text="Simple Gesture, Tap me!"> <Label.GestureRecognizers> <TapGestureRecognizer Command="Binding LabelTappedCommand" CommandParameter="Simple tap"/> </Label.GestureRecognizers> </Label> <Label FontSize="Large" Text="Simple Gesture, Tap me twice!"> <Label.GestureRecognizers> <TapGestureRecognizer Command="Binding LabelTappedCommand" CommandParameter="Double tap" NumberOfTapsRequired="2"/> </Label.GestureRecognizers> </Label> Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 38

39 Bindable properties Your custom controls may publish traditional properties You should use bindable properties instead Reduced memory footprint, if the value remains at default object specific value is not stored Value inheritance from parent elements Automatic change notifications Full support for databinding public static readonly BindableProperty TapParameterProperty = BindableProperty.Create("TapParameter", typeof(string), typeof(label), Hello ); public string TapParameter get return (string)this.getvalue(tapparameterproperty); set SetValue(TapParameterProperty, value); Property name Property type Who declares Default value Getter and Setter agains bindable property Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 39

40 Triggers Triggers apply features to UI based on the rule that launches the trigger <Entry x:name="personname" Placeholder="Try entering Tim or Tom"> <Entry.Triggers> <Trigger TargetType="Entry" Property="Text" Value="Tim"> <Setter Property="BackgroundColor" Value="Green" /> </Trigger> </Entry.Triggers> </Entry> <Button Text="Save" IsEnabled="False" > <Button.Triggers> <DataTrigger TargetType="Button" Binding="Binding Source=x:Reference PersonName, Path=Text.Length Value="3"> <Setter Property="IsEnabled" Value="True" /> </DataTrigger> <EventTrigger Event="Clicked" > <local:buttonclicktriggeraction /> </EventTrigger> </Button.Triggers> </Button> Class inherits TriggerAction<Button> and implements invoke-method. Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 40

41 Behaviours Behaviours add extended functionality to a view public class NameValidationBehavior : Behavior<Entry> protected override void OnAttachedTo(Entry entry) entry.textchanged += OnEntryTextChanged; base.onattachedto(entry); <Entry Placeholder="Enter Amy or May"> <Entry.Behaviors> <local:namevalidationbehavior /> </Entry.Behaviors> </Entry> protected override void OnDetachingFrom(Entry entry) entry.textchanged -= OnEntryTextChanged; base.ondetachingfrom(entry); void OnEntryTextChanged(object sender, TextChangedEventArgs args) Entry e = sender as Entry; bool isvalid = new string[] "Amy","May".Contains(e.Text); e.textcolor = isvalid? Color.Black : Color.White; e.backgroundcolor = isvalid? Color.White : Color.Red; Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 41

42 Attached property Attached property is a special type of Bindable Property Property is not declared in a class inheriting BindableObject as contrary to ordinary Bindable Properties Attached property may be attached to any UI-element public static class AttachedNameBehavior public static readonly BindableProperty NameBehaviorProperty = BindableProperty.CreateAttached( "NameBehaviour", typeof(bool), typeof(attachednamebehavior), false, propertychanged: OnNameBehaviorChanged); public static bool GetNameBehavior(BindableObject view) return (bool)view.getvalue(namebehaviorproperty); public static void SetNameBehavior(BindableObject view, bool value) view.setvalue(namebehaviorproperty, value);.. Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 42

43 Behaviour with attached property Completes the AttachedNameBehaviour-class demonstrated on previous page <Entry Placeholder="Enter Kim or Ken" local:attachednamebehavior.namebehavior="true" /> static void OnNameBehaviorChanged(BindableObject view, object oldvalue, object newvalue) var entry = view as Entry; if (entry == null) return; bool attachbehavior = (bool)newvalue; if (attachbehavior) entry.textchanged += OnEntryTextChanged; else entry.textchanged -= OnEntryTextChanged; static void OnEntryTextChanged(object sender, TextChangedEventArgs args) Entry e = sender as Entry; bool isvalid = new string[] "Kim", "Ken".Contains(e.Text); e.textcolor = isvalid? Color.Black : Color.White; e.backgroundcolor = isvalid? Color.White : Color.Red; Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 43

44 Converters Binding target Property Converters Binding source Property Data binding nearly always passes through a converter Integer property to a content string Implicit or explicit Sadly the Visual Studio designer is not very comfortable with the converters Using converter with data binding <TextBox x:name="textbox1" HorizontalAlignment="Left" Margin="58,181,0,0 TextWrapping="Wrap" VerticalAlignment="Top" Text="Binding Path=BirthDate, Converter=StaticResource AgeConverter" /> Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 44

45 Custom converter Often the same result can be achieved by implementing a calculated property to a ViewModel But if same conversion is needed in several ViewModelobjects then custom converter can be reused Converting birthdate to age (not a complete solution) class DateToAgeConverter : IValueConverter public object Convert(object val,type target, object param, CultureInfo cult) DateTime dt = (DateTime)value; return DateTime.Now.Year - dt.year; // OK, not exact public object ConvertBack(object val, Type target, object par, CultureInfo cult) return new DateTime(DateTime.Now.Year - int.parse(value.tostring()), 1, 1); <Label Text="Binding birthday, Converter=StaticResource DateToAgeConverter" /> Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 45

46 Exercise Final touch to the calculator Implement trigger that enables button if Result is non-zero Use behaviours to add validation to the entry-fields Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 46

47 Resources And Styles

48 Styles Each component has its own set of properties that control the styling of the component As in HTML+CSS you shouldn t use element specific style to huge extent Instead you should declare global style-resources to ensure uniform styling through-out the application Some typical styles-attributes include TextColor, occasionally ForegroundColor is used instead BackgroundColor FontSize FontAttributes IsVisible <Label Text="Style from own styles" TextColor="Red" FontSize="Large" FontAttributes = Bold,Italic" XAlign="End"/> Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 48

49 Resources Resources are just objects reusable on several occasions Can be set of styles but other types of resources can also be declared Can be defined at Application context Page context Element context Resources may be referenced Statically: Resolved when XAML is parsed Dynamically: When resource is actually needed at runtime Should the Application declare a resource for the ViewModelobject? Most often at least partially, but can be debated Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 49

50 Resources in App.xaml All the resources that are used between views should be described in App.xaml Unless of course a view-specific instance of the resource-type is needed App.xaml <?xml version="1.0" encoding="utf-8"?> <Application xmlns=" xmlns:x=" xmlns:local="clr-namespace:uidemos" x:class="uidemos.app"> <Application.Resources> <ResourceDictionary> <Style x:key="applabel" TargetType="Label"> <Setter Property="TextColor" Value="#40C080" /> <Setter Property="Text" Value="Text comes from App-resources" /> </Style> <local:demovm x:key="demovm" /> </ResourceDictionary> </Application.Resources> </Application> Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 50

51 Styles Styles can also be declared through resources For each style you declare a set of Setter that define a value for single property Again styles that are used across the views should be defined in App.xaml Both of the following are not applied When x:key is set an element may use the style by binding the Style-property to StaticResource [x:key] When x:key is not set the style is used for all elements of TargetType TargetType must always be set Styles in resources <Style TargetType="Label"> <Setter Property="FontSize" Value="Large" /> </Style> <Style x:key="warninglabel" TargetType="Label"> <Setter Property="TextColor" Value="Red" /> </Style> Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 51

52 Style inheritance Problem on previous slide All labels have spefic font Except those that choose the warningbkr -style Styles can inherit definitions of other styles BasedOn-attribute Style inheritance <Style x:key="standardlabel" TargetType="Label"> <Setter Property="FontSize" Value="Large" /> </Style> <Style TargetType="Label" BasedOn="StaticResource StandardLabel"/> <Style x:key="warninglabel" TargetType="Label" BasedOn="StaticResource StandardLabel"> <Setter Property="TextColor" Value="Red" /> </Style> Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 52

53 Templates Styles can also be used for describing templates for pages This is the basics for building themes <ContentPage.Resources> <ResourceDictionary> <ControlTemplate x:key="templatedview"> <Grid> <BoxView Color="#A0C0F0" VerticalOptions="FillAndExpand" /> <ContentPresenter /> <StackLayout Spacing="0,0,0,0" Padding="0,0,0,0" Orientation="Horizontal HorizontalOptions="FillAndExpand" VerticalOptions="End"> <Label Text="Copyright (c)" BackgroundColor="White VerticalTextAlignment="Center" Margin="0,0,0,0" HorizontalOptions="FillAndExpand"/> <Image Source="logo.jpg" Margin="0,0,0,0" /> <Label Text="Template demo" TextColor="White" FontSize="Large" VerticalTextAlignment="Center" HorizontalTextAlignment="End" VerticalOptions="FillAndExpand" BackgroundColor="#032E51" Margin="0,0,0,0" HorizontalOptions="FillAndExpand"/> </StackLayout> </Grid> </ControlTemplate> </ResourceDictionary> </ContentPage.Resources> <ContentView ControlTemplate="StaticResource TemplatedView"> <StackLayout VerticalOptions="CenterAndExpand"> <Label Text="Welcome to Xamarin Forms!" HorizontalOptions="Center"/> <Button Text="Some action" HorizontalOptions="Center"/> </StackLayout> </ContentView> Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 53

54 Exercise Add some styles to App.xaml Use them in your Calculator Try also implementing a template for your calculator-page Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 54

55 Some Xamarin features Dependency Service Using files Messaging Center Localization Effects SQLite Native Views

56 Dependency Service Through dependency service we call native code from shared code We need Interface that describes platform specific services Implementation of interface on each platform Dependency service itself provides a factory-method for querying the implementation This code goes into Android-project Attribute at namespace-level [assembly: Xamarin.Forms.Dependency(typeof(UIDemos.Droid.DroidDependencies))] namespace UIDemos.Droid class DroidDependencies : IMyDependencies public string PlatformGreeting() return "Hello from Android"; IMyDependencies service = DependencyService.Get<IMyDependencies>(); string greet=service.platformgreeting(); IMyDependecies is described in shared code Usage in shared code Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 56

57 Working with files Files that are packaged into assembly may be accessed in the shared code through reflection-technique For other files we need to rely on platform specific APIs Android and ios support System.io quire widely UWP has its own mechanisms Application working directory string documentspath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); public IEnumerable<string> FileList() try return Directory.EnumerateFiles(documentsPath); catch(exception ex) return new List<String> ex.message, documentspath ; public string ReadText(string fn) return File.ReadAllText(documentsPath+"/"+fn); public string SaveText(string fn, string data) try File.WriteAllText(documentsPath + "/" + fn, data); Implementation goes into a dependency service return "Saved"; catch(exception ex) return ex.message; Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 57

58 Messaging center Messaging center provides high abstraction between message senders and providers For each sent message there is the sender type and message name Messages are subscribed based on those factors for example two ViewModel -objects can communicate if they know the types of each other (no need to find object references) You could also create a separate Messanger -class that sends the messages class Messanger public void Send(string msg,string data) MessagingCenter.Send<Messanger, string>(this, msg, data); // We may send messages new Messanger().Send("GlobalMsg", "Global climate changes"); // And elsewhere we subscribe them MessagingCenter.Subscribe<Messanger, string>(this, "GlobalMsg", (sender, args) => /* process message somehow */); Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 58

59 Localization Need of localization might be one of deciding factors on which code sharing option to use Localization is most easily accomplished if PCL-method is used Also localization is most easily accomplished if you implement it into your project from beginning Translations Number formats Date formats Basis for localization is to identify the Culture (locale) of the user Implement.resx-files for translations against all supported cultures Might also need a helper class to load the translations Great (exhaustive) guide is available at: Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 59

60 Effects The intention of effects is to extend the basic behavior provided by Xamarin.Forms to some extend with platform specific implementation Effect-class is separately implemented to all platform projects And of course you need to understand what platform specific control is used and how to modify its behaviour The effect may be attached to a view in Xaml [assembly:resolutiongroupname ("Codetutors")] [assembly:exporteffect (typeof(myeffect), "MyEffect")] namespace UIDemos.Droid public class MyEffect : PlatformEffect public override void OnAttached()... public override void OnDetached()... protected override void OnElementPropertyChanged(PropertyChangedEventArgs args) /* Actual behaviour here * public class MyEffect : RoutingEffect public MyEffect() : base("codetutors.myeffect") <Entry.Effects> <local:myeffect /> </Entry.Effects> Shared code Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 60

61 Native views The set of Views provided by Xamarin.Forms is not extensive On each platform more advanced controls are available You just need to add a platform specific xml-namespace to the Xaml And disable Xaml-compilation If you truly target multiple platforms the UI-design might become complicated And of course you also need to study the platform specific components available // [XamlCompilation(XamlCompilationOptions.Compile)] public partial class NativeDemo : ContentPage... xmlns:androidwidget="clr-namespace:android.widget;assembly=mono.android;targetplatform=android" xmlns:formsandroid="clr-namespace:xamarin.forms;assembly=xamarin.forms.platform.android;targetplatform=android" <androidwidget:switch x:arguments="x:static formsandroid:forms.context" Checked="True" Text="Enable Entry?" /> Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 61

62 SQLite SQLite is an embedded database solution Not a separate database engine, just a library Data is stored into a single file Supports SQL Basically a C/C++ library but bindings exist to quite a few languages SQLite for.net provides automatic ORM for entities Tables are created for entity types We save and retrieve objects In mobile you need to prepare for asynchronous operations private SQLiteAsyncConnection connection; private CalculatorDatabase(string path) connection = new SQLiteAsyncConnection(path); connection.createtableasync<calculation>().wait(); public Task<List<Calculation>> GetAll() return connection.table<calculation>().tolistasync(); public void Save(Calculation c) connection.insertasync(c); NuGet install sqlite-net-pcl Class CalculatorDatabase Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 62

63 SQLite operations Get by primary key connection.table<person>().where(i => i.id == id).firstordefaultasync(); Select statement connection.queryasync<person>("select * FROM [Person] WHERE [Gender] = Male "); Create database.insertasync(person); Update connection.updateasync(person); Delete connection.deleteasync(person); Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 63

64 Exercise Study instructor pointed CalculatorDatabase-class Use it (as basis) to save calculations on GridCalculator into a database You will need a DependencyService that provides a full path to a given file CalculatorVM constructor should read all data from database When Accept-button is clicked the calculation should be stored to the database Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 64

65 More UI-features Navigation Popups

66 Implementing navigation Designing the navigation is not an easy task How to organize the data and the views for easy and natural access? How to accomplish the above in various devices We don t (typically) use menus extensively Context menus and other types of popup menus can be used, possibly through ActionSheet Application may have some sort of navigation bar Saddly the implementation is platform specific Pages that give support to navigation NavigationPage TabbedPage Carousel MasterDetailPage Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 66

67 Tabbed page and Carousel Using a tabbed page is rather straight-forward Carousel is in fact built in similar manner <?xml version="1.0" encoding="utf-8"?> <TabbedPage xmlns=" xmlns:x=" x:class="uidemos.tabbeddemo" xmlns:local="clr-namespace:uidemos" > <local:eventscalculator Title="Calculator" /> <local:stylesdemo Title="Styles" /> <local:gesturesdemo Title="Gestures" /> </TabbedPage> Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 67

68 MasterDetail MasterDetail page combines List of items available with Menu button Page displayed when item is selected Can be used to display for example a list of persons on master and form to edit persondata on detail But in fact a self-built navigation with traditional NavigationPage might be more suitable for this It can also be used as Start-page for application Original detail displays welcome-page List contains selections for different operations Persons, Companies, Orders etc When item is selected a suitable ListView is presented <MasterDetailPage xmlns=" xmlns:x=" x:class="uidemos.masterdetaildemo" xmlns:pages="clr-namespace:uidemos"> <MasterDetailPage.BindingContext> <pages:personvm /> </MasterDetailPage.BindingContext> <MasterDetailPage.Master> <pages:masterdetaildemomaster x:name="masterpage" /> </MasterDetailPage.Master> <MasterDetailPage.Detail> <NavigationPage> <x:arguments> <pages:masterdetaildemodetail /> </x:arguments> </NavigationPage> </MasterDetailPage.Detail> </MasterDetailPage> ContentPage holding ListView of selectios Default detail-page (ContentPage) Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 68

69 MasterDetail, changing detail In the sample below the master has displayed a list of Persons Detail always shows a form to edit selected person It could as well change the page type based on the selected item on the master You could study the type of selected item and select a different page based on that private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e) Person person = e.selecteditem as Person; if (person == null) return; var page = (Page)Activator.CreateInstance(typeof(MasterDetailDemoDetail)); page.title = person.name; Detail = new NavigationPage(page); IsPresented = false; MasterPage.ListView.SelectedItem = null; (BindingContext as PersonVM).Current = person; Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 69

70 Popups Popups in general display options for the user Alerts are traditional message boxes displaying a message and giving one or two buttons to reply Yes/No, true/false ActionSheets show one or two buttons but also a list of options Return value is the string contained in the button or option Event handler for Button Clicked async void OnDetailOptions(object sender, EventArgs e) bool answer = await DisplayAlert("Question","Want to continue?", "Perhaps","Later"); string action = await DisplayActionSheet("What to do?", "Cancel", null, "Delete", "Refresh", "Save"); SelectedOption.Text = "Selected: " + action; Just a Label on the page Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 70

71 Exercise Create page BookList Displays a ListView of books And BookDetail Entries for editing a book Also create class Book Int id String title String author BookVM holding List <Book> books For the first test you may populate the list with couple books Book current=null When a book is tapped from the ListView Set the current into tapped book Change the view into BookDetail Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 71

72 Remote data Web services SOAP and XML REST and JSON Azure integration

73 Web services Services to other applications over internet with two flawors: SOAP Kind of a function calls over network, remote procedure call technology XML-document describing the method to be executed is passed to the server Server executes the requested method Response is again formatted into XML WSDL (xml) describes the interface available Well suited for application integration (EAI or B2B) REST Data manipulation over internet Uses four methods of HTTP-protocol GET to query data PUT to modify data POST to create data DELETE obviously to. The URL identififies the data item or entity to be manipulated The format in which data is presented can be choosen freely (JSON or XML) Good choice for web clients (JavaScript) and unknown client types Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 73

74 SOAP Soap client for Xamarin-application is implemented in similar manner as traditional.net-application Right-click References on Solution Explorer and Add new web-reference You need access to the wsdl of the web service Also the proxy generated is similar to traditional applications Asynchronous operations should be favored The proxy offers event-driven model for asynchronous operations BookSoapClient.BookService service = new BookSoapClient.BookService(); // Using synchronous method is bad BookSoapClient.Book book = service.getbook(1); // Now asynchronous model is based on events service.getbookcompleted += Service_GetBookCompleted; service.getbookasync(1); private void Service_GetBookCompleted(object sender, BookSoapClient.GetBookCompletedEventArgs e) BookSoapClient.Book book = e.result; Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 74

75 Consuming REST with HttpClient Consuming REST with HttpClient is rather straight-forward System.Net.Http (and System.Net.Http.Headers) must be referenced The benefit is that you work close to the protocol, you absolutely know what is happening Remember that REST is all about HTTP, you send and receive text content Often data is JSON-formatted.NET-Frameword offers (poor) JSON-manipulation classes Newtonsoft.Json is preferred library string url = " HttpClient httpclient = new HttpClient(); var uri = new Uri(url); var response = await client.getasync(uri); if (response.issuccessstatuscode) var content = await response.content.readasstringasync(); var books= JsonConvert.DeserializeObject<List<Book>>(content); NuGet Newtonsoft.Json Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 75

76 Put and Post Implementing put/post is no more complex than get/delete You need to convert your objects into string Create StringContent-object containing the data to be sent Possibly set headers to the call Make the call and read the response Book b = new Book title = "Seven brothers", author = "Kivi" ; string data=jsonconvert.serializeobject(b); StringContent sc = new StringContent(data); sc.headers.contenttype = MediaTypeHeaderValue.Parse("application/json"); var pr=await client.postasync(url, sc); string prs = await pr.content.readasstringasync(); Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 76

77 Exercise Continue with BookList/BookDetail Implement BookClient-class Async method GetBooksAsync Use HttpClient to query books from the RESTful service When Books are received use MessagingCenter to send the list of books BookVM should handle the message from BookClient and store books to the Books-collection And the ListView of course should update automatically When the Book is selected from the ListView again call BookClient Implement getasync(int id), when Book is received again a message is sent which is processed by the ViewModel to update the current Book Extra Implement PUT (Save), POST (Create) and DELETE to the BookClient Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 77

78 Authenticating Security against RESTful services can be implemented in various ways Basic authentication with fixed technical credentials Basic authentication against self implemented user database OAuth against separate identity provider Etc From the client s point of view it all comes to passing the correct Authorizationheader The problem might be how to get the correct value for the header Basic authentication is simple as demonstrated below When using OAuth you just replace Basic with Bearer and the value with a valid token provided by the identity server var request = new HttpRequestMessage() tom:verysecret RequestUri = new Uri(url), base64 encoded Method = HttpMethod.Get ; request.headers.authorization = new AuthenticationHeaderValue( Basic, dg9tonzlcnlzzwnyzxq= ); var resp = await client.sendasync(request); Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 78

79 Authenticating against Azure AD Authentication handler requires some platform-specific code Below the authenticator is implemented as a dependency-service [assembly: Xamarin.Forms.Dependency(typeof(UIDemos.Droid.Authenticator))] namespace UIDemos.Droid class Authenticator : ISecure static public Android.App.Activity MainActivity; Notice te MainActivity return ar; private string authority = " private string bookappresourceuri = " private string bookappclientid = "5d286f7e-fb77-458b-b4b5-0a2b2cc4a7ca"; private string standardredirecturi = " public async Task<AuthenticationResult> Authenticate() try AuthenticationContext ac = new AuthenticationContext(authority); AuthenticationResult ar = await ac.acquiretokenasync( bookappresourceuri, bookappclientid, new Uri(standardRedirectUri), new PlatformParameters(MainActivity)); catch (Exception ex) System.Diagnostics.Debug.WriteLine("Get Token Exception:" + ex.message); return null; Figuring out the correct values for these variables may be a struggle Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 79

80 MainActivity (Android Specific) In the Android-project MainActivity.cs, OnCreate-method you may set Authenticator.MainActivity = this; And also you will need to be able to handle the callbacks from the actual identityprovider by implementing OnActivityResult to the MainActivityclass protected override void OnActivityResult(int requestcode, Result resultcode, Intent data) base.onactivityresult(requestcode, resultcode, data); AuthenticationAgentContinuationHelper.SetAuthenticationAgentContinuationEventArgs( requestcode, resultcode, data); Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 80

81 Finally, make the call The actual call is made in a manner demonstrated earlier AuthenticationResult ar = await DependencyService.Get<ISecure>().Authenticate(); if (ar!= null) HttpClient client = new HttpClient(); string url = " var request = new HttpRequestMessage() RequestUri = new Uri(url), Method = HttpMethod.Get ; request.headers.authorization = new AuthenticationHeaderValue( ar.accesstokentype, ar.accesstoken); var resp = await client.sendasync(request); Copyright Codetutors Consulting Ltd 2017 Xamarin-programming 81

The finished application DEMO ios-specific C# Android-specific C# Windows-specific C# Objective-C in XCode Java in Android Studio C# Shared Logic C# in Visual Studio ios codebase Android codebase Windows

More information

4/25/ Xamarin. All rights reserved.

4/25/ Xamarin. All rights reserved. 1 Xamarin + Xamarin.Forms Traditional Xamarin approach With Xamarin.Forms: more code-sharing, native controls Shared UI Code 2 4/25/15 Metroon for ios 2014 X amarin. All rights r eserved. 3 What s Included

More information

Mobile Computing Xamarin Data Binding MVVM Pattern

Mobile Computing Xamarin Data Binding MVVM Pattern Xamarin Data Binding MVVM Pattern APM@FEUP 1 Data Binding In simple apps Get and set properties of controls is done explicitly in the code behind entry1.text = Hello, world! ; For complex or big apps This

More information

Mobile Computing. Xamarin Data Binding MVVM Pattern. Data Binding. XAML binding example. Target Views. In simple apps. For complex or big apps

Mobile Computing. Xamarin Data Binding MVVM Pattern. Data Binding. XAML binding example. Target Views. In simple apps. For complex or big apps APM@FEUP Xamarin Data Binding MVVM Pattern 1 Data Binding In simple apps Get and set properties of controls is done explicitly in the code behind entry1.text = Hello, world! ; For complex or big apps This

More information

Chris Key. Senior Consultant. Open Circle Solutions

Chris Key. Senior Consultant. Open Circle Solutions Chris Key Senior Consultant Open Circle Solutions www.opencirclesolutions.com Series Part 1: Introduction to Xamarin mobile development September 14 Part 2: Building Cross Platform Mobile Applications

More information

Chapter 23 Triggers and behaviors

Chapter 23 Triggers and behaviors Chapter 23 Triggers and behaviors The introduction of a markup language such as XAML into a graphical programming environment might seem at first to be merely an alternative way to construct an assemblage

More information

Xamarin.Forms. Pages Building an Interface

Xamarin.Forms. Pages Building an Interface Xamarin.Forms Pages Building an Interface VS and Project Configuration VS: Tools Options only UWP only Android Solution Manage Nuget Packages for Solution Help About All projects Build Configuration Manager

More information

Chapter 25 Page varieties

Chapter 25 Page varieties Chapter 25 Page varieties If you think of a Xamarin.Forms application as a building, then you construct this building from bricks that take the form of views and elements. You arrange them into walls using

More information

We re here to help. Erik Polzin. Colby Williams. Engineer Partner Team. Director Partners and Channels. +1 (415)

We re here to help. Erik Polzin. Colby Williams. Engineer Partner Team. Director Partners and Channels. +1 (415) We re here to help Erik Polzin Colby Williams Director Partners and Channels Engineer Partner Team erik@xamarin.com +1 (415) 547-0830 @epolzin colby@xamarin.com +1 (918) 671-5167 @colbylwilliams Xamarin

More information

Chapter 16 Data binding

Chapter 16 Data binding Chapter 16 Data binding Events and event handlers are a vital part of the interactive interface of Xamarin.Forms, but often event handlers perform very rudimentary jobs. They transfer values between properties

More information

Building a mobile enterprise application with Xamarin.Forms, Docker, MVVM and.net Core. Gill

Building a mobile enterprise application with Xamarin.Forms, Docker, MVVM and.net Core. Gill Building a mobile enterprise application with Xamarin.Forms, Docker, MVVM and.net Core Gill Cleeren @gillcleeren www.snowball.be Agenda Overall application structure The Xamarin application architecture

More information

Come and Get Excited about Azure Mobile Services and Xamarin.Forms

Come and Get Excited about Azure Mobile Services and Xamarin.Forms Come and Get Excited about Azure Mobile Services and A story about Azure Mobile Services, SQL Azure and Xamarin Presented By: Fabian G. Williams About the Speaker Fabian Williams, MCSD, MCDBa, MCSE SharePoint

More information

The Model provides underlying data, sometimes involving file or web accesses.

The Model provides underlying data, sometimes involving file or web accesses. Chapter 18 MVVM Can you remember your earliest experiences with programming? It s likely that your main goal was just getting the program working, and then getting it working correctly. You probably didn

More information

Chapter 12 Styles. The basic Style

Chapter 12 Styles. The basic Style Chapter 12 Styles Xamarin.Forms applications often contain multiple elements with identical property settings. For example, you might have several buttons with the same colors, font sizes, and layout options.

More information

Tizen.NET. Transition of Tizen Developer Environment. Samsung Electronics S/W Center Sung-Jae Lee, Seungkeun Lee

Tizen.NET. Transition of Tizen Developer Environment. Samsung Electronics S/W Center Sung-Jae Lee, Seungkeun Lee Tizen.NET Transition of Tizen Developer Environment Samsung Electronics S/W Center Sung-Jae Lee, Seungkeun Lee 2016. 11. 17 Index Intro Language API & Framework Tools Collaborations & Roadmap 01 09 15

More information

Introduction to Data Templates and Value Converters in Silverlight

Introduction to Data Templates and Value Converters in Silverlight Introduction to Data Templates and Value Converters in Silverlight An overview of Data Templates and Value Converters by JeremyBytes.com Overview Business applications are all about data, and laying out

More information

4/25/ Xamarin. All rights reserved.

4/25/ Xamarin. All rights reserved. 1 v v Each cell is represented by some data structure which is then visualized on the screen headshot.source =...; nameentry.text = person.name; emailentry.text = person.email; birthday.date = person.dob;...

More information

Note: This demo app created for this lab uses the Visual Studio 2015 RTM and Windows Tools SDK ver

Note: This demo app created for this lab uses the Visual Studio 2015 RTM and Windows Tools SDK ver Windows 10 UWP Hands on Lab Lab 2: Note: This demo app created for this lab uses the Visual Studio 2015 RTM and Windows Tools SDK ver 10240. 1. Select the Models folder and bring up the popup menu and

More information

Xamarin.Forms. Pages Building an Interface

Xamarin.Forms. Pages Building an Interface Xamarin.Forms Pages Building an Interface VS and Project Configuration VS: Tools Options only UWP only Android Solution Manage Nuget Packages for Solution Help About All projects Build Configuration Manager

More information

XAMARIN Application Development - Workshop

XAMARIN Application Development - Workshop XAMARIN Application Development - Workshop Program 1: August 6 to 10 2017 Program 2: November 5 to 9 2017 Duration:(5days) 9 am to 4 pm Hotel Majestic- Dubai ISIDUS TECH TEAM FZE PO Box 9798 Dubai UAE,

More information

WPF and MVVM Study Guides

WPF and MVVM Study Guides 1. Introduction to WPF WPF and MVVM Study Guides https://msdn.microsoft.com/en-us/library/mt149842.aspx 2. Walkthrough: My First WPF Desktop Application https://msdn.microsoft.com/en-us/library/ms752299(v=vs.110).aspx

More information

Portable Class Libraries ---

Portable Class Libraries --- Portable Class Libraries --- Overview In this lab, you ll learn about Portable Class Libraries (PCLs). PCLs enable you to create managed assemblies that work on more than one.net Framework platform. Within

More information

Index. Alessandro Del Sole 2017 A. Del Sole, Beginning Visual Studio for Mac,

Index. Alessandro Del Sole 2017 A. Del Sole, Beginning Visual Studio for Mac, Index A Android applications, Xamarin activity and intent, 116 APIs in C# Activity classes, 123 Android manifest, 129 App.cs, 123 app properties, setting, 128 CreateDirectoryForPictures methods, 124 device

More information

Chapter 19 Collection views

Chapter 19 Collection views Chapter 19 Collection views Many of the views in Xamarin.Forms correspond to basic C# and.net data types: The Slider and Stepper are visual representations of a double, the Switch is a bool, and an Entry

More information

RadGanttView For Silverlight and WPF

RadGanttView For Silverlight and WPF RadGanttView For Silverlight and WPF This tutorial will introduce RadGanttView, part of the Telerik suite of XAML controls. Setting Up The Project To begin, open Visual Studio and click on the Telerik

More information

04 Sharing Code Between Windows 8 and Windows Phone 8 in Visual Studio. Ben Riga

04 Sharing Code Between Windows 8 and Windows Phone 8 in Visual Studio. Ben Riga 04 Sharing Code Between Windows 8 and Windows Phone 8 in Visual Studio Ben Riga http://about.me/ben.riga Course Topics Building Apps for Both Windows 8 and Windows Phone 8 Jump Start 01 Comparing Windows

More information

Week 8: Data Binding Exercise (Bookstore)

Week 8: Data Binding Exercise (Bookstore) BCIS 4650 Week 8: Data Binding Exercise (Bookstore) Page 1 of 6 Page 2 of 6 XAML CODE FOR MainPage.xaml

More information

Developing Native Windows Phone 7 Applications for SharePoint

Developing Native Windows Phone 7 Applications for SharePoint Developing Native Windows Phone 7 Applications for SharePoint Steve Pietrek Cardinal Solutions About Cardinal OUR FOCUS: Enterprise Rich Internet Applications Mobile Solutions Portals & Collaboration Business

More information

ComponentOne. Xamarin Edition

ComponentOne. Xamarin Edition ComponentOne Xamarin Edition Xamarin Edition 1 Table of Contents Getting Started with Xamarin Edition 6 Breaking Changes for Xuni Users 6-7 NuGet Packages 7-8 Redistributable Files 8-9 System Requirements

More information

Chapter 10. XAML Markup Extensions

Chapter 10. XAML Markup Extensions Chapter 10. XAML Markup Extensions In code, you can set a property in a variety of different ways from a variety of different sources: triangle.angle1 = 45; triangle.angle1 = 180 * radians / Math.PI; triangle.angle1

More information

This tutorial is designed for software developers who want to learn how to develop quality applications with clean structure of code.

This tutorial is designed for software developers who want to learn how to develop quality applications with clean structure of code. About the Tutorial Every good developer wants and tries to create the most sophisticated applications to delight their users. Most of the times, developers achieve this on the first release of the application.

More information

03 Model-View-ViewModel. Ben Riga

03 Model-View-ViewModel. Ben Riga 03 Model-View-ViewModel Ben Riga http://about.me/ben.riga Course Topics Building Apps for Both Windows 8 and Windows Phone 8 Jump Start 01 Comparing Windows 8 and Windows Phone 8 02 Basics of View Models

More information

Developing Mobile Apps (357)

Developing Mobile Apps (357) Developing Mobile Apps (357) Develop a XAML page layout for an adaptive UI Construct a page layout Configure a RelativePanel layout; select the appropriate XAML layout panel based on the UI requirement;

More information

Xamarin for C# Developers

Xamarin for C# Developers Telephone: 0208 942 5724 Email: info@aspecttraining.co.uk YOUR COURSE, YOUR WAY - MORE EFFECTIVE IT TRAINING Xamarin for C# Developers Duration: 5 days Overview: C# is one of the most popular development

More information

Index. Windows 10 running, 199 suspended state, 199 terminate apps,

Index. Windows 10 running, 199 suspended state, 199 terminate apps, A Application lifecycle activation ApplicationExecution State, 216 restoring navigation state, 216 217 restoring session information, 217 218 state transitions, 200 activation, 201 killing, 202 launching,

More information

ComponentOne. Xamarin Edition

ComponentOne. Xamarin Edition ComponentOne Xamarin Edition ComponentOne, a division of GrapeCity 201 South Highland Avenue, Third Floor Pittsburgh, PA 15206 USA Website: http://www.componentone.com Sales: sales@componentone.com Telephone:

More information

Razvoj multiplatformskih mobilnih aplikacija sa Xamarin Forms. Andrej Radinger, MVP, Mobendo

Razvoj multiplatformskih mobilnih aplikacija sa Xamarin Forms. Andrej Radinger, MVP, Mobendo Razvoj multiplatformskih mobilnih aplikacija sa Xamarin Forms Andrej Radinger, MVP, Mobendo andrej@mobendo.com Native User Interfaces Native API Access Native Performance Silo Approach ios Android Windows

More information

RadPDFViewer For Silverlight and WPF

RadPDFViewer For Silverlight and WPF RadPDFViewer For Silverlight and WPF This tutorial will introduce the RadPDFViewer control, part of the Telerik suite of XAML controls Setting Up The Project To begin, open Visual Studio and click on the

More information

var xdoc = XDocument.Load(inStream);

var xdoc = XDocument.Load(inStream); Gradebook Sample App Summary: The goal of this project is to demonstrate how to share code across project types by using a Portable Class Library between a traditional Windows* Desktop application and

More information

This walkthrough assumes you have completed the Getting Started walkthrough and the first lift and shift walkthrough.

This walkthrough assumes you have completed the Getting Started walkthrough and the first lift and shift walkthrough. Azure Developer Immersion In this walkthrough, you are going to put the web API presented by the rgroup app into an Azure API App. Doing this will enable the use of an authentication model which can support

More information

Xamarin.Forms. #xamarin.fo rms

Xamarin.Forms. #xamarin.fo rms Xamarin.Forms #xamarin.fo rms 1 1: Xamarin.Forms 2 2 2 Examples 3 (Visual Studio) 3 Visual Studio Xamarin 3 Xamarin.Forms 4 Hello World Xamarin Forms : 4 1 :. 4 2 : 5 3 : 6 2: CarouselView - 7 7 Examples

More information

MS_40541 Build Native Cross-Platform Mobile Apps with a Shared C# Business Logic for ios, Android, and UWP in C#.NET with Xamarin and Visual Studio

MS_40541 Build Native Cross-Platform Mobile Apps with a Shared C# Business Logic for ios, Android, and UWP in C#.NET with Xamarin and Visual Studio Build Native Cross-Platform Mobile Apps with a Shared C# Business Logic for ios, Android, and UWP in C#.NET with Xamarin and Visual Studio www.ked.com.mx Av. Revolución No. 374 Col. San Pedro de los Pinos,

More information

Name of Experiment: Country Database

Name of Experiment: Country Database Name of Experiment: Country Database Exp No: DB2 Background: Student should have basic knowledge of C#. Summary: Database Management is one of the key factors in any Mobile application development framework.

More information

Accurate study guides, High passing rate! IT TEST BOOK QUESTION & ANSWER. Ittestbook provides update free of charge in one year!

Accurate study guides, High passing rate! IT TEST BOOK QUESTION & ANSWER. Ittestbook provides update free of charge in one year! IT TEST BOOK QUESTION & ANSWER Ittestbook provides update free of charge in one year! Accurate study guides, High passing rate! Exam : 070-506 Title : TS: Microsoft Silverlight 4, Development Version :

More information

This document contains a general description of the MVVMStarter project, and specific guidelines for how to add a new domain class to the project.

This document contains a general description of the MVVMStarter project, and specific guidelines for how to add a new domain class to the project. MVVMStarter Guide This document contains a general description of the MVVMStarter project, and specific guidelines for how to add a new domain class to the project. Table of Content Introduction...2 Purpose...2

More information

ArcGIS Pro SDK for.net Advanced User Interfaces in Add-ins. Wolfgang Kaiser

ArcGIS Pro SDK for.net Advanced User Interfaces in Add-ins. Wolfgang Kaiser ArcGIS Pro SDK for.net Advanced User Interfaces in Add-ins Wolfgang Kaiser Session Overview MVVM Model View ViewModel - View and View Model Implementation in Pro - Dockpane Example - MVVM concepts - Multi

More information

Chapter 10 XAML markup extensions

Chapter 10 XAML markup extensions Chapter 10 XAML markup extensions In code, you can set a property in a variety of different ways from a variety of different sources: triangle.angle1 = 45; triangle.angle1 = 180 * radians / Math.PI; triangle.angle1

More information

windows-10-universal #windows- 10-universal

windows-10-universal #windows- 10-universal windows-10-universal #windows- 10-universal Table of Contents About 1 Chapter 1: Getting started with windows-10-universal 2 Remarks 2 Examples 2 Installation or Setup 2 Creating a new project (C# / XAML)

More information

NE.15 Data Binding In Windows Presentation Foundation

NE.15 Data Binding In Windows Presentation Foundation NE.15 Data Binding In Windows Presentation Foundation Brian Noyes Chief Architect IDesign Inc (www.idesign.net) 1 About Brian Chief Architect, IDesignInc. (www.idesign.net) Microsoft Regional Director/MVP

More information

Practical WPF. Learn by Working Professionals

Practical WPF. Learn by Working Professionals Practical WPF Learn by Working Professionals WPF Course Division Day 1 WPF prerequisite What is WPF WPF XAML System WPF trees WPF Properties Day 2 Common WPF Controls WPF Command System WPF Event System

More information

ArcGIS Pro SDK for.net UI Design for Accessibility. Charles Macleod

ArcGIS Pro SDK for.net UI Design for Accessibility. Charles Macleod ArcGIS Pro SDK for.net UI Design for Accessibility Charles Macleod Overview Styling - Light, Dark, High Contrast Accessibility Custom Styling* Add-in Styling Since1.4: Light and Dark Theme and High Contrast

More information

HOW TO BUILD A CUSTOM CONTROL IN XAMARIN.FORMS

HOW TO BUILD A CUSTOM CONTROL IN XAMARIN.FORMS Filling the Gaps: HOW TO BUILD A CUSTOM CONTROL IN XAMARIN.FORMS KELLEY RICKER Abstract Xamarin.Forms provides a flexible, code-once option for developers to create native mobile apps, and it provides

More information

Pro Windows 8.1. Development with. XAML and C# Jesse Liberty. Philip Japikse. Jon Galloway

Pro Windows 8.1. Development with. XAML and C# Jesse Liberty. Philip Japikse. Jon Galloway Pro Windows 8.1 Development with XAML and C# Jesse Liberty Philip Japikse Jon Galloway Contents About the Authors About the Technical Reviewers Acknowledgments xvii xix xxi HChapter 1: Getting Started

More information

ArcGIS Pro SDK for.net: Advanced User Interfaces in Add-ins. Wolfgang Kaiser

ArcGIS Pro SDK for.net: Advanced User Interfaces in Add-ins. Wolfgang Kaiser ArcGIS Pro SDK for.net: Advanced User Interfaces in Add-ins Wolfgang Kaiser Framework Elements - Recap Any Framework Element is an extensibility point - Controls (Button, Tool, and variants) - Hosted on

More information

Chapter 21 Transforms

Chapter 21 Transforms Chapter 21 Transforms With the help of StackLayout and Grid, Xamarin.Forms does a good job of sizing and positioning visual elements on the page. Sometimes, however, it s necessary (or convenient) for

More information

Steps to Set Up the Environment of Xamarin in Visual

Steps to Set Up the Environment of Xamarin in Visual Before a couple of years ago many people were on the thinking line that Native Languages like Objective-C, Swift and Java is the only choice to develop native Mobile Applications. Well gone are those days

More information

Hands-On Lab. Sensors -.NET. Lab version: Last updated: 12/3/2010

Hands-On Lab. Sensors -.NET. Lab version: Last updated: 12/3/2010 Hands-On Lab Sensors -.NET Lab version: 1.0.0 Last updated: 12/3/2010 CONTENTS OVERVIEW... 3 EXERCISE 1: INTEGRATING THE SENSOR API INTO A WPF APPLICATION... 5 Task 1 Prepare a WPF Project for Sensor Integration...

More information

WebFront for Service Manager

WebFront for Service Manager WebFront for Service Manager Authoring Guide Gridpro AB Rev: 2.10.6513 (System Center 2012) & 3.0.6513 (System Center 2016) Published: November 2017 Contents Purpose... 3 Introduction... 3 Limitations...

More information

Building User Interface for Android Mobile Applications II

Building User Interface for Android Mobile Applications II Building User Interface for Android Mobile Applications II Mobile App Development 1 MVC 2 MVC 1 MVC 2 MVC Android redraw View invalidate Controller tap, key pressed update Model MVC MVC in Android View

More information

CPSC Tutorial 5

CPSC Tutorial 5 CPSC 481 - Tutorial 5 Assignment #2 and WPF (based on previous tutorials by Alice Thudt, Fateme Rajabiyazdi, David Ledo, Brennan Jones, Sowmya Somanath, and Kevin Ta) Introduction Contact Info li26@ucalgary.ca

More information

Chapter 14 Absolute layout

Chapter 14 Absolute layout Chapter 14 Absolute layout In Xamarin.Forms, the concept of layout encompasses all the ways that various views can be assembled on the screen. Here s the class hierarchy showing all the classes that derive

More information

CS 4330/5390: Mobile Application Development Exam 1

CS 4330/5390: Mobile Application Development Exam 1 1 Spring 2017 (Thursday, March 9) Name: CS 4330/5390: Mobile Application Development Exam 1 This test has 8 questions and pages numbered 1 through 7. Reminders This test is closed-notes and closed-book.

More information

Android Essentials with Java

Android Essentials with Java Android Essentials with Java Before You Program o Exercise in algorithm generation Getting Started o Using IntelliJ CE Using Variables and Values o Store data in typed variables Static Methods o Write

More information

CHANNEL9 S WINDOWS PHONE 8.1 DEVELOPMENT FOR ABSOLUTE BEGINNERS

CHANNEL9 S WINDOWS PHONE 8.1 DEVELOPMENT FOR ABSOLUTE BEGINNERS CHANNEL9 S WINDOWS PHONE 8.1 DEVELOPMENT FOR ABSOLUTE BEGINNERS Full Text Version of the Video Series Published April, 2014 Bob Tabor http://www.learnvisualstudio.net Contents Introduction... 2 Lesson

More information

Week 7: NavigationView Control Exercise

Week 7: NavigationView Control Exercise BCIS 4650 Week 7: NavigationView Control Exercise BUILD THE UI FIRST (ALWAYS). ================================================================================================ 1. Start with a New Project

More information

Master Code on Innovation and Inclusion

Master Code on Innovation and Inclusion Microsoft x HKEdCity: Master Code on Innovation and Inclusion Train-the-Trainers Workshop Writing Applications in C# with Visual Studio Content I. Getting the Tools Ready... 3 II. Getting Started with

More information

T R A I N I N G P U B L I S H I N G C O N S U L T I N G

T R A I N I N G P U B L I S H I N G C O N S U L T I N G MOB104 2-Day Writing Cross Platform ios and Android Apps using Xamarin.Forms and C# In this 2-day workshop, you will learn the fundamentals of building cross-platform mobile apps targeting ios and Android

More information

For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to

For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to access them. Contents at a Glance About the Author...

More information

Lecture # 6 Engr. Ali Javed 11th March, 2014

Lecture # 6 Engr. Ali Javed 11th March, 2014 Lecture # 6 Engr. Ali Javed 11 th March, 2014 Instructor s Information Instructor: Engr. Ali Javed Assistant Professor Department of Software Engineering U.E.T Taxila Email: ali.javed@uettaxila.edu.pk

More information

Authoring Guide Gridpro AB Rev: Published: March 2014

Authoring Guide Gridpro AB Rev: Published: March 2014 Authoring Guide Gridpro AB Rev: 2.5.5197 Published: March 2014 Contents Purpose... 3 Introduction... 3 Limitations... 3 Prerequisites... 3 Customizing Forms... 4 Launching the Customization Editor... 4

More information

ArcGIS Pro SDK for.net Beginning Pro Customization. Charles Macleod

ArcGIS Pro SDK for.net Beginning Pro Customization. Charles Macleod ArcGIS Pro SDK for.net Beginning Pro Customization Charles Macleod Session Overview Extensibility patterns - Add-ins - Configurations Primary API Patterns - QueuedTask and Asynchronous Programming - async

More information

Advanced WCF 4.0 .NET. Web Services. Contents for.net Professionals. Learn new and stay updated. Design Patterns, OOPS Principles, WCF, WPF, MVC &LINQ

Advanced WCF 4.0 .NET. Web Services. Contents for.net Professionals. Learn new and stay updated. Design Patterns, OOPS Principles, WCF, WPF, MVC &LINQ Serialization PLINQ WPF LINQ SOA Design Patterns Web Services 4.0.NET Reflection Reflection WCF MVC Microsoft Visual Studio 2010 Advanced Contents for.net Professionals Learn new and stay updated Design

More information

Windows Presentation Foundation (WPF)

Windows Presentation Foundation (WPF) 50151 - Version: 4 21 January 2018 Windows Presentation Foundation (WPF) Windows Presentation Foundation (WPF) 50151 - Version: 4 5 days Course Description: This five-day instructor-led course provides

More information

STARCOUNTER. Technical Overview

STARCOUNTER. Technical Overview STARCOUNTER Technical Overview Summary 3 Introduction 4 Scope 5 Audience 5 Prerequisite Knowledge 5 Virtual Machine Database Management System 6 Weaver 7 Shared Memory 8 Atomicity 8 Consistency 9 Isolation

More information

sharpcorner.com/uploadfile/37db1d/4958/default.aspx?articleid=cb0b291c-52ae-4b80-a95c- 438d76fa1145

sharpcorner.com/uploadfile/37db1d/4958/default.aspx?articleid=cb0b291c-52ae-4b80-a95c- 438d76fa1145 Navigation in Silverlight -3 1. Introduction: In previous article we learn to navigate to another Silverlight page without using navigation framework, which is new feature in Silverlight 3. Read it Here:

More information

ANDROID SYLLABUS. Advanced Android

ANDROID SYLLABUS. Advanced Android Advanced Android 1) Introduction To Mobile Apps I. Why we Need Mobile Apps II. Different Kinds of Mobile Apps III. Briefly about Android 2) Introduction Android I. History Behind Android Development II.

More information

Microsoft Corporation

Microsoft Corporation Microsoft Corporation http://www.jeff.wilcox.name/ 2 3 Display 480x800 QVGA Other resolutions in the future Capacitive touch 4+ contact points Sensors A-GPS, Accelerometer, Compass, Light Camera 5+ megapixels

More information

DOT NET SYLLABUS FOR 6 MONTHS

DOT NET SYLLABUS FOR 6 MONTHS DOT NET SYLLABUS FOR 6 MONTHS INTRODUCTION TO.NET Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.) CLR Architecture and Services The.Net Intermediate

More information

Lesson 9: Exercise: Tip Calculator

Lesson 9: Exercise: Tip Calculator Lesson 9: Exercise: Tip Calculator In this lesson we ll build our first complete app, a Tip Calculator. It will help solve one of the fundamental problems that I have whenever I'm out to a restaurant,

More information

ComponentOne. Extended Library for UWP

ComponentOne. Extended Library for UWP ComponentOne Extended Library for UWP ComponentOne, a division of GrapeCity 201 South Highland Avenue, Third Floor Pittsburgh, PA 15206 USA Website: http://www.componentone.com Sales: sales@componentone.com

More information

Index. Application programming interface (API), 38. Binary Application Markup Language (BAML), 4

Index. Application programming interface (API), 38. Binary Application Markup Language (BAML), 4 Index A Application programming interface (API), 38 B Binary Application Markup Language (BAML), 4 C Class under test (CUT), 65 Code-behind file, 128 Command Query Responsibility Segregation (CQRS), 36

More information

Developing Sopima Cross-platform Mobile Application With Xamarin. Svetlana Borisenkova

Developing Sopima Cross-platform Mobile Application With Xamarin. Svetlana Borisenkova Developing Sopima Cross-platform Mobile Application With Xamarin Svetlana Borisenkova Bachelor s Thesis Degree Programme in Business Information Technology 2015 Abstract Päiväys 22.2.2015 Author(s) Svetlana

More information

CPSC Tutorial 5 WPF Applications

CPSC Tutorial 5 WPF Applications CPSC 481 - Tutorial 5 WPF Applications (based on previous tutorials by Alice Thudt, Fateme Rajabiyazdi, David Ledo, Brennan Jones, and Sowmya Somanath) Today Horizontal Prototype WPF Applications Controls

More information

Cross-Platform Mobile Platforms and Xamarin. Presented by Mir Majeed

Cross-Platform Mobile Platforms and Xamarin. Presented by Mir Majeed Cross-Platform Mobile Platforms and Xamarin Presented by Mir Majeed Agenda 1. Sharing Code Among Different Platforms File-Linking into each App Project Portable Class Libraries 2. Solution Population Strategies

More information

ArcGIS Pro Extensibility - Building and Deploying Addins with the new DotNet SDK

ArcGIS Pro Extensibility - Building and Deploying Addins with the new DotNet SDK ArcGIS Pro Extensibility - Building and Deploying Addins with the new DotNet SDK Charlie Macleod - Esri Esri UC 2014 Demo Theater New at 10.3 is the ArcGIS Pro Application - Extensibility is provided by

More information

--Microsoft-- --Windows Phone--

--Microsoft-- --Windows Phone-- --Microsoft-- --Windows Phone-- Microsoft Windows Phone Course 10553A: Fundamentals of XAML and Microsoft Expression Blend Course Outline Module 1: Binding in XAML This module familiarizes the students

More information

Chapter 11. The Bindable Infrastructure

Chapter 11. The Bindable Infrastructure Chapter 11. The Bindable Infrastructure One of the most basic language constructs of C# is the class member known as the property. All of us very early on in our first encounters with C# learned the general

More information

Windows Presentation Foundation Programming Using C#

Windows Presentation Foundation Programming Using C# Windows Presentation Foundation Programming Using C# Duration: 35 hours Price: $750 Delivery Option: Attend training via an on-demand, self-paced platform paired with personal instructor facilitation.

More information

Building Responsive Apps for Windows 10 Greg Lutz. GrapeCity

Building Responsive Apps for Windows 10 Greg Lutz. GrapeCity Building Responsive Apps for Windows 10 Greg Lutz GrapeCity Responsive Design == Adaptive UI The goal of adaptive UI is to adapt its layout to the needs of the user. In our case Adaptive UI will mean adaption

More information

Wpf Button Click Event Firing Multiple Times

Wpf Button Click Event Firing Multiple Times Wpf Button Click Event Firing Multiple Times Switch back to the designer, then double-click the button again. Repeating step 3 multiple times, it seems that the caret is placed correctly on every second

More information

Authoring Guide v2.1 PATRIK SUNDQVIST

Authoring Guide v2.1 PATRIK SUNDQVIST 2012 Authoring Guide v2.1 PATRIK SUNDQVIST Purpose The purpose of this document is to provide assistance when customizing WebFront for Service Manager 2012. 1 TABLE OF CONTENTS 2 Introduction... 2 3 Limitations...

More information

Yes, this is still a listbox!

Yes, this is still a listbox! Yes, this is still a listbox! Step 1: create a new project I use the beta 2 of Visual Studio 2008 ( codename Orcas ) and Expression Blend 2.0 September preview for this tutorial. You can download the beta2

More information

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology Mobile Application Development Produced by David Drohan (ddrohan@wit.ie) Department of Computing & Mathematics Waterford Institute of Technology http://www.wit.ie User Interface Design" & Development -

More information

CHAPTER 1: INTRODUCING C# 3

CHAPTER 1: INTRODUCING C# 3 INTRODUCTION xix PART I: THE OOP LANGUAGE CHAPTER 1: INTRODUCING C# 3 What Is the.net Framework? 4 What s in the.net Framework? 4 Writing Applications Using the.net Framework 5 What Is C#? 8 Applications

More information

Bringing Together One ASP.NET

Bringing Together One ASP.NET Bringing Together One ASP.NET Overview ASP.NET is a framework for building Web sites, apps and services using specialized technologies such as MVC, Web API and others. With the expansion ASP.NET has seen

More information

Hands-On Lab. Hello Windows Phone

Hands-On Lab. Hello Windows Phone Hands-On Lab Hello Windows Phone Lab version: 1.1.0 Last updated: 12/8/2010 CONTENTS OVERVIEW... 3 EXERCISE 1: CREATING WINDOWS PHONE APPLICATIONS WITH MICROSOFT VISUAL STUDIO 2010 EXPRESS FOR WINDOWS

More information

Introduction to RESTful Web Services. Presented by Steve Ives

Introduction to RESTful Web Services. Presented by Steve Ives 1 Introduction to RESTful Web Services Presented by Steve Ives Introduction to RESTful Web Services What are web services? How are web services implemented? Why are web services used? Categories of web

More information

Midterm Examination. CSCE 4623 (Fall 2017) October 20, 2017

Midterm Examination. CSCE 4623 (Fall 2017) October 20, 2017 Midterm Examination CSCE 4623 (Fall 2017) Name: UA ID: October 20, 2017 Instructions: 1. You have 50 minutes to complete the exam. The exam is closed note and closed book. No material is allowed with you

More information

Aware IM Version 8.2 Aware IM for Mobile Devices

Aware IM Version 8.2 Aware IM for Mobile Devices Aware IM Version 8.2 Copyright 2002-2018 Awaresoft Pty Ltd CONTENTS Introduction... 3 General Approach... 3 Login... 4 Using Visual Perspectives... 4 Startup Perspective... 4 Application Menu... 5 Using

More information

CPSC Tutorial 6

CPSC Tutorial 6 CPSC 481 - Tutorial 6 More WPF (based on previous tutorials by Alice Thudt, Fateme Rajabiyazdi, David Ledo, Brennan Jones, Sowmya Somanath, and Kevin Ta) Introduction Contact Info li26@ucalgary.ca Please

More information