0% found this document useful (0 votes)
104 views10 pages

No Iunea de View/Interfa Ă Ț Ț

The document discusses several topics related to user interface development including views/interfaces, navigation events, content templates, layouts, storyboards, data collections, HTTP methods and fields, XML/JSON, regular expressions, and asynchronous methods. It provides descriptions and examples for each topic.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views10 pages

No Iunea de View/Interfa Ă Ț Ț

The document discusses several topics related to user interface development including views/interfaces, navigation events, content templates, layouts, storyboards, data collections, HTTP methods and fields, XML/JSON, regular expressions, and asynchronous methods. It provides descriptions and examples for each topic.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

- Noiunea de View/Interfa

- Navigation Events
Occurs when navigation to a content fragment begins,
which occurs immediately, if the desired fragment is in
the current content, or after the source XAML content has
been loaded, if the desired fragment is in different
content.

- Content Template
Gets or sets the data template that is used to display the
content of the ContentControl.
XAML Values
dataTemplate

A DataTemplate object element that defines the


display for this ContentControl.

templateReference

A {StaticResource} markup extension reference to an


existing DataTemplate definition.

Both attribute and property element syntax


for ContentTemplate are shown, because defining
the template inline or referencing an existing one as
a resource are both equally valid scenarios.
Type: DataTemplate

The data template that is used to display the content of


the ContentControl.

Instead of declaring a fixed DataTemplate, you can also


implement a DataTemplateSelector and use it to set
the ContentTemplateSelector property. This technique
enables custom template switching based on input data,
at the application level. For more information,
see DataTemplateSelector.

- Layouts (structura si componente)


indows Phone provides a flexible layout system that
enables you to specify how controls are positioned on the
screen. This Quickstart describes how to design a user
interface that automatically sizes to various screen
resolutions.
This topic contains the following sections.

Layout overview

Absolute layout

Dynamic layout

Panel controls

Related Topics

Layout overview
Layout is the process of sizing and positioning objects in
your app for Windows Phone. To position visual objects,
you must put them in a container control derived
from Panel or another container object. Windows Phone
provides various Panel controls, such
as Canvas, StackPanel, and Grid, that serve as containers
and enable you to position and arrange the controls.
The Windows Phone layout system supports both an
absolute layout and a dynamic layout. In an absolute
layout, controls are positioned using explicit x/y
coordinates (for example, by using a Canvas). In a
dynamic layout, the user interface automatically sizes to
various screen resolutions (for example, by using
a StackPanel or a Grid).
- Diff Grid Option

- Storyboard (Animation Property)


A container timeline that provides object and property
targeting information for its child animations.
A Storyboard is a type of container timeline that provides
targeting information for the timelines it contains. A
Storyboard can contain any type of Timeline, including
other container timelines and
animations. Storyboard objects enable you to combine
timelines that affect a variety of objects and properties
into a single timeline tree, making it easy to organize and
control complex timing behaviors. For example, suppose
you want a button that does these three things.

Grow and change color when the user selects the


button.

Shrink away and then grow back to its original size


when clicked.

Shrink and fade to 50 percent opacity when it


becomes disabled.
In this case, you have multiple sets of animations that
apply to the same object, and you want to play at
different times, dependent on the state of the
button. Storyboard objects enable you to organize
animations and apply them in groups to one or more
objects.

- Colectii de date (Collection<T>)


The Collection class provides protected methods that can be
used to customize its behaviorwhen adding and removing
items, clearing the collection, or setting the value of an existing
item.

Notes to Implementers

This base class is provided to make it easier for implementers to


create a custom collection. Implementers are encouraged to
extend this base class instead of creating their own.

1. If using in your own code, why not use List as a base class
instead?
Collection<T> provides some protected methods so you can
easily override the behavior and completely enroll your own
business logic, like:
ClearItems()
InsertItem()
RemoveItem()
SetItem()
List<T> does not provide them and has almost no protected
methods to overrides behavior, which makes customizing it
harder.
2. Does it really ever make sense to initialize a new Collection in
your own code in place of List?
No, not just for the sake of initializing some collection. Use it if
you need it as a base class for implementing your own logic.
This will depend on your own business needs. For almost all
cases in daily development work, the existing - and numerous -
collections should already provide what you need. There are type
safe and untyped collections, thread-safe collections, and
whatever else you can think of.
Still, one day there may be a demand for implementing a
collection type that does certain valididation checks before it
allows to add/update/delete any items in it or that handles moving
to the next item in a only sparsely populated list in a specail
manner. You never know what ideas a customer may have.
In those case it might help to create your own collection type.

- WebClient vs HttpWebRequest
Speaking of comparing these two
HttpClient is more closer to HTTP than WebClient.
HttpClient was not meant to be a complete replacement of
Web Client, since there are things like report progress, custom
URI scheme and making FTP calls that WebClient provides
but HttpClient doesnt.
If youre using .NET 4.5, please do use the async goodness with
HttpClient that Microsoft provides to the developers. HttpClient is
very symmetrical to the server side brethren of the HTTP those
are HttpRequest and HttpResponse.
Update: 5 Reasons to use new HttpClient API:
Strongly typed headers.
Shared Caches, cookies and credentials
Access to cookies and shared cookies
Control over caching and shared cache.
Inject your code module into the ASP.NET pipeline. Cleaner
and modular code.
HttpClient is the newer of the APIs and it has the benefits of
has a good async programming model
being worked on by Henrik F Nielson who is basically one of
the inventors of HTTP, and he designed the API so it is easy
for you to follow the HTTP standard, e.g. generating
standards-compliant headers
is in the .Net framework 4.5, so it has some guaranteed level
of support for the forseeable future
also has the xcopyable/portable-framework version of the
library if you want to use it on other platforms - .Net 4.0,
Windows Phone etc.
If you are writing a web service which is making REST calls to
other web services, you should want to be using an async
programming model for all your REST calls, so that you don't hit
thread starvation. You probably also want to use the newest C#
compiler which has async/await support.
Note: It isn't more performant AFAIK. It's probably somewhat
similarly performant if you create a fair test.
Metode Asynchrone(async/await)
Metoda care va fi rulata asincron trebuie sa intoarca void, task sau
task<T>.Metoda apelanta care foloseste in interiorul sei aeplul wait
trebuie marcata ca async.Compilatorul deduce acest patern automan.
Await foloseste SynchronizationContext penrtu a continua pe acelasi
thread pe care async a pornit.
Threads:
Thread este cea mai mica unitate de procesare ce poate fi programata
spre executie de catre sistemul de operare.Este folosit pentru a executa
portiuni distincte din cod in parallel in interiorul aceluiasi
process.Corpul threadurilor nu sunt complet independente si in anumite
momente ale executiei se poate intimpla ca un thread sa astepte executia
altui thread.

Protocolul HTTP:
Protocol la nivel de aplicatie destinat sistemelor de informare distribuite
de genul hypermedia.Aplicatiile care folosesc acest protocol sunt
entitati abstracte din punct de vedere al protocolului.Ele trebuie doar sa
poata ,,comunica,, intre ele pentru formulare de cereri de receptionare
de raspunsuri.Cererile formulate in acest protocol se refera la informatii
care pot fi stocate in diverse baze de date in diverse formate pe diverse
calculatoare.

Metodele si cimpurile HTTP:


Metodele sunt de fapt operatiile care pot fi applicate obiectelor
constituite de resursele din retea , in acceptiunea protocolului HTTP.

Metode:
-Options(optiunile de comunicare disponibile pe conexiune)
-Get(metode care aduce ceva de la resursa, adduce doar un singur
raspuns la o intrebare)
-Head(asemanator ca Get doar ca raspunsul e in forma de cod de
success sau eroare)
-Post(metoda prin care resursei specificate in cerere I se cere sa isi
subordoneze datele incluse in entitatea care trebuie sa insoteasca
cererea).
-Put( asemator ca Post capabila sa stocheze si memorize entitatea
cuprinsa In cerere cu numele specificat in URI)
-Patch(metoda ca Put ce nu contine date ce defines resursa)
-Copy,Move,Delete(metode ce permit lucrului asupra cererei. De
copier, mutare, stergere)
-Link si Unlink(stabilesc relatiile intre cereri de legare/dezlegare)
-Trace(metoda ce arata cum ajung cererile la server)
-Wrapped(metoda ce ofera transmiterea mai multor cereri in una)
Cimpuri:
-Cookie,ETag,Location,HTTP referrer,DNT,X-Forwarded-For

XML/Json:
XML foloseste un format de organizare de tip arbore,standartizat bazat
pe text pentru stocarea de informatii ce pot fi citite usor din
aplicatii.Este folosit pentru stocarea oricarui tip de date .
Json este un format de reprezentare si interschimb de date intre aplicatii
informatice.Este un format text, inteligibil pentru oameni utilizat pentru
reprezentarea obiectelor si altor structure de date pentru a fi transmise
prin retea in mod structurat.Json este o alternativa mai simpla decit
limbajul XML.
RegEx:
Un sir de caractere care descriu un model de cautare in alt sir de
caractere.Cu ajutorul expresiilor regulare se pot gasi si inlocui portiuni
anumite din text si este o metoda puternica de verificare pentru
valididatea adreselor email , domeniilor de internet , sau codului
postal.Este folosita pentru analizarea fisierelor mai mari in text si a
cautarii informatiei droite.

HTML Parsing/xPath:
Parsing permite accesarea cu usurinta si modificare a codului html si
contine o multime de biblioteci ce permite parsarea documentelor in
diferite limbaje de programare.
xPath este un limbaj de expresii ce permite selectarea portiunilor
dintrun document XML sau pentru calcularea valorilor pe baza
continutului unui document XML.Acest limbaj este structurat in forma
de arbore a documentului XML si ofera posibilitatea de navigare in
acest arbore prin selectia nodurilor ce satisfac anumite cereri.

You might also like