XAM1 - Forms Flashcards

(53 cards)

1
Q

What converts a View to platform specific control?

A
  • Renderers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are types of Forms layouts?

A
  • StackLayout
  • GridLayout
  • AbsoluteLayout
  • RelativeLayout
  • also ScrollView
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What can Margin property be added to?

A
  • all Views

- define new Thickness(L, T, R, B)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can you execute different values on different platforms?

A
  • Device.OnPlatform

- in code you can also check Device.OS and Device.Idiom (enum = TargetIdiom.Tablet)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are steps to setup an abstraction to platform specific code?

A
  • define interface in PLC
  • provide plat spec implementations
  • use Dependency attribute
  • retrieve dependency in shared code using DependencyService.Get
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the syntax of the dependency attribute?

A
  • [assembly:Dependency(typeof(PhoneDialIOS))]

- this gets registered with dependency service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The Grid.Column and Grid.Row are examples of what?

A
  • attached properties
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are requirements for you to be able to set a property in XAML?

A
  • must be public

- must have a setter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is x: namespace?

A
  • common across all XAML platforms

- make common XAML keywords available to parser

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you access XAML elements in code?

A
  • add x:Name which adds private fields
  • must be unique and confirm to variable naming conventions
  • not available until after InitializeComponent() runs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Event handlers in XAML?

A
  • can be done, not recommended due to separation of concerns
  • event handlers in XAML can be public, private or protected
  • ex TextChanged=”OnTextChanged”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How can you share values in XAML?

A
  • ResourceDictionary

- accessing via x:StaticResource

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is XamlCompilation?

A
  • can be applied at class or namespace level
  • compiles XAML into IL
  • performs compile time checking of XAML
  • lowers file size
  • removes some object instantiation time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How can you re-use XAML views?

A
  • use ContentView
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How are rendered control sizes figured?

A
  • Layouts asks children how much space they request by calling Measure method
  • child View responds with preferred size
  • layout panel calls layout method on child view
  • cycle repeats as needed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

View positioning are controlled by what?

A
  • WidthRequest and HeightRequest

- also VerticalOptions and HorizontalOptions of containers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Vertical/HorizontalOptions default to what?

A
  • FILL
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Is Margin available on all Views?

A
  • YES

- Padding only available on layout views

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What does StackLayout consist of?

A
  • IList called Children

- the order matters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is StackLayout default Orientation?

A
  • Vertical
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How are attached properties implemented?

A
  • with BindableProperty and BindableObject
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What are grid defaults for Vertical/HorizontalOptions?

A
  • they default to FILL but do respect settings these options on cells
23
Q

What are grid defaults for RowSpacing and ColumnSpacing?

A
  • both default to 6
24
Q

What are the children of a grid?

A
  • IGridList w/ specialized add methods
25
How do you make it so a resource dictionary value can be updated in code and reflected?
- use DynamicResource instead of StaticResource in XAML to access
26
What do shared resources need defined?
- x:Key | - access via StaticResource/DynamicResource and key
27
How do you check for connectivity?
- Connectivity plugin - Xam.Plugin.Connectivity - CrossConnectivity.Current - iOS doesn't provide roaming info, AND and UWP do
28
What permissions must be added to access connectivity data?
- AND - AccessNetworkState and AccessWifiState | - Win10 - must have Private Networks and Internet (Client and Server) checked
29
REST - what are Safe operations?
- GET, OPTIONS, HEAD - don't modify data on the server; results can be cached
30
Which REST ops are Idempotent?
- all but POST; same request should end with same result on server
31
What is syntax for using JSON.Net?
- JsonConvert.SerializeObject(obj) | - JsonConvert.DeserializeObject(string)
32
How can you tell an outside service you want json?
- Accept header | - potentially a URL parameter
33
Making Http requests - what should be installed?
- HttpClient - install Microsoft.Net.Http into PCL - ModernHttpClient also popular option
34
What are HttpClient methods?
- SendAsync - you define VERB and options | - GetAsync, PostAsync, PutAsync, DeleteAsync
35
What is included in HttpRequestMessage?
- Method - Address URI - Headers - Content
36
What is a drawback of using specific Get methods like GetByteArrayAsync, GetStreamAsync, etc
- returns response data immediately but without the response object and therefore no status codes
37
How do you set headers across all requests for a created HttpClient?
- DefaultRequestHeaders.Add
38
What can headers be applied to?
- Request - Response - and Content
39
What are HttpHandlers?
- live in HttpClient | - do stuff with messages as they flow through pipeline
40
If you customize http pipeline what do you have to add manually?
- HttpClientHandler - this is networking part of pipeline | - you can override HttpClientHandler to use native networking APIs
41
What is ATS?
- App Transport Security for iOS as of iOS 9 - must use HTTPS with TLS 1.2 - applies only to native networking stack - if you use HttpClient without defining native handler you are outside bounds of ATS - you can declare exceptions to ATS in info.plist
42
What are storage options?
- using Settings plugin and storing data in key/value pairs - store directly to file system - full relational DB like SQLite
43
Can you use System.IO in PCL?
- no, only in platform specific projects using System.IO and types like File, Directory, Stream, etc
44
How do you get special places to store files?
- Environment.GetFolderPath(Environment.SpecialFolder.Personal) for iOS/Android - for Win using Windows.Storage.ApplicationData.Current.LocalFolder.Path - for iOS app specific stuff should be placed into Library - use System.IO.Path.Combine to create Paths
45
What is SQLite built into?
- SQLite is built natively into iOS and Android | - for Win it has to be added via NuGet
46
What is extra step for SQLite and UWP?
- you have to add MS Visual C++ 2013 Runtime
47
When creating what is passed into SQLiteConnection?
- fully qualified path to the database
48
What are best locations for databases on platforms?
- Android/databases - iOS/Library - UWP LocalState
49
What are SQLiteOpenFlags?
- can be optionally set | - can change things like setting DB as read-only or changing DateTime to NOT save as Ticks
50
What are common SQLite attributes?
- Table(name) - Column(name) - PrimaryKey - Unique - AutoIncrement - Indexed - MaxLength(value) - NotNull - Ignore
51
What are Linking options for builds?
- Don't Link - Link Framework SDKs only - only "core" mono and "safe" assemblies are pruned - Link All
52
Can you make an assembly be included in the Link Framework SDKs only?
- yes, marking with LinkerSafe | - you can also tell Linker to exclude certain assemblies
53
How can you be sure certain code is Preserved?
- can mark assemblies or classes as Preserve - ex [Preserve(AllMembers=true)] - you can also build a linker configuration XML file with Build Action set to LinkDescription - root and definition