Podcast
Questions and Answers
What is a more robust and loosely coupled version of events?
What is a more robust and loosely coupled version of events?
What does icommand include?
What does icommand include?
Execute, CanExecute, CanExecuteChanged
How can any object work as a command?
How can any object work as a command?
Modal Dialogs are necessary to terminate explicitly in order to interact with the main window.
Modal Dialogs are necessary to terminate explicitly in order to interact with the main window.
Signup and view all the answers
WPF Input Events make possible ____________ interactive content.
WPF Input Events make possible ____________ interactive content.
Signup and view all the answers
What does Data Binding allow in XAML?
What does Data Binding allow in XAML?
Signup and view all the answers
What does the Binding Object contain?
What does the Binding Object contain?
Signup and view all the answers
Synchronization in binding means binding a single target with multiple sources.
Synchronization in binding means binding a single target with multiple sources.
Signup and view all the answers
Example code of binding shows setting a property path like Binding.Path = new PropertyPath(____)
.
Example code of binding shows setting a property path like Binding.Path = new PropertyPath(____)
.
Signup and view all the answers
Which method can be used for cancellation in tasks?
Which method can be used for cancellation in tasks?
Signup and view all the answers
What does DOM stand for?
What does DOM stand for?
Signup and view all the answers
What is the benefit of using JQuery for web development?
What is the benefit of using JQuery for web development?
Signup and view all the answers
Which of the following are basic selectors in JQuery? (Select all that apply)
Which of the following are basic selectors in JQuery? (Select all that apply)
Signup and view all the answers
JQuery provides automatic looping for handling multiple elements.
JQuery provides automatic looping for handling multiple elements.
Signup and view all the answers
What method in JQuery is used to hide elements?
What method in JQuery is used to hide elements?
Signup and view all the answers
Match the following web events with their descriptions:
Match the following web events with their descriptions:
Signup and view all the answers
What is the role of JavaScript in AJAX?
What is the role of JavaScript in AJAX?
Signup and view all the answers
Study Notes
CS411 Short Notes
Chapter 24
- Commands are a more robust and loosely coupled version of events.
- WPF defines a number of built-in commands.
- Any object can work as a command by implementing ICommand.
- ICommand includes three methods: Execute, CanExecute, and CanExecuteChanged.
- Examples of built-in commands include:
- ApplicationCommands (e.g. Close, Save, Open)
- ComponentCommands (e.g. MoveDown, SelectToEnd)
- MediaCommands (e.g. ChannelDown, IncreaseVolume)
- NavigationCommands (e.g. BrowseBack, GoToPage)
- EditingCommands (e.g. AlignCenter, DecreaseFontSize)
Chapter 25
- WPF Window is a Win32 window.
- Any number of child windows can be made by instantiating a window-derived class and calling Show.
- Child windows get closed or minimized when the parent window is closed or minimized.
- Window events include:
- Activated
- Deactivated
- StartupUri in XAML is used to specify the first page to be displayed.
- System.Environment.GetCommandLineArgs is used to get command-line arguments in WPF.
- Application-level events include:
- Startup
- Exit
- Activated
- Deactivated
- SessionEnding
Chapter 26
- A wizard is a dialog box with multiple user interfaces.
- A page in itself cannot be displayed; a window is an area containing a page.
- Navigation-based apps are:
- Windows Explorer
- Media Player
- Photo Gallery
- Host windows are:
- NavigationWindow
- Frame
- Navigation containers provide:
- Navigating
- History journal
- Navigation-related events
- A page can interact with its navigation container using the NavigationService class.
Chapter 27
- Browser-based applications are partial-trust applications.
- Partial trust means with some restrictions.
- Silverlight is cross-platform, but WPF browser-based applications only run on Windows.
- In web-based applications, the journal of the application and web browser are integrated.
- GAC is a Global Assembly Cache.
- ClickOnce applications are cached.
- How to open a file from a local system:
- Use OpenFileDialog
- Data can be given to any website using:
- URL Parameters
- Cookies
- BrowserInteropHelper.Source is used to retrieve the complete URL.
- Application.GetCookie is used to retrieve browser cookies.
Chapter 28
- Localization means that an application can target more than one language or grammar.
- To localize resources, it's necessary to make them embedded resources.
- Logical resources are arbitrary .NET objects stored and named in an element's resource properties.
- Logical resources can be categorized into:
- Static resources
- Dynamic resources
- Dynamic resources allow for subscription to updates of the resource.
Chapter 29
- Data binding allows for declaratively binding two different properties in XAML.
- A binding object has one source and target object.
- Binding binds two properties together and keeps a communication channel open.
- PropertyPath can be used to specify the source property.
- Synchronization means binding multiple targets with a single source.
Chapter 34
- Asynchronous tasks take return quickly.
- Asynchronous tasks are non-blocking.
- For I/O-bound tasks, we can usually work without threads.
- For CPU-bound tasks, we can start and return tasks, which are asynchronous tasks.
- Example of CPU-bound asynchronous task:
- GetPrimesCount
Chapter 35
- Write downloading code:
- async void Go()
- Use WebClient to download data
- Use await to wait for the task to complete
- We can return a task from a void function without explicitly returning it.
- If you have to write an asynchronous function, follow three steps:
- Write its totally synchronous version
- Then use await and async
- Then use return and return Task in place of void
Chapter 36
- Task combinators:
- Task.WhenAny
- Task.WhenAll
- Example of WhenAll in task combinators:
- await Task.WhenAll(Delay1(), Delay2(), Delay3())
- There are two types of parallelism:
- Data parallelism
- Task parallelism
- Three steps of parallelism:
- Partition problem
- Process
- Combine the results
- Data parallelism is easier to perform and scales well, and it's also structured.
- Task parallelism is more complex and harder to get right.
- Concurrent collections are useful when you want a thread-safe collection.### Parallel Loop State
- The
ParallelLoopState
class has several methods:-
Break()
-
Stop()
-
IsExceptional
(getter) -
IsStopped
(getter) -
LowestBreakIteration
(getter) -
ShouldExitCurrentIteration
(getter)
-
Concurrent Collections
- Concurrent collections are three times slower than normal collections when writing, but not when reading.
- Types of concurrent collections:
-
ConcurrentStack
-
ConcurrentQueue
-
ConcurrentBag
-
ConcurrentDictionary
-
HTML, JavaScript, and CSS
- HTML is a Hyper Text Markup Language.
- JavaScript is built-in and supported by all web browsers.
- Web pages have three layers:
- HTML (content/structure)
- CSS (presentation)
- JavaScript (behavioral)
- JavaScript was introduced in 1995 and was originally named "LiveScript" before being renamed to "JavaScript" and later to "JScript" by Microsoft for Internet Explorer.
- jQuery is a JavaScript library that makes JavaScript programming easier by solving complexity and browser incompatibilities.
- HTML basics:
- At least three tags are required:
html
(root tag),head
(containing title, etc.), andbody
(containing all parts to be rendered in the browser window). - Tags have specific meanings, such as
p
(paragraph),em
(emphasis), anda
(hyperlink). - Validating HTML means checking if all tags are properly closed.
- At least three tags are required:
JavaScript
- JavaScript is an interpreted language, meaning each line of code is compiled at runtime.
- JavaScript basics:
- Variables are declared using
var
, and names can start with a letter,$
, or_
. - Arrays can be created and manipulated using
push
,unshift
,shift
, andpop
methods. - Functions can be declared without specifying a return type.
- Variables are declared using
- JavaScript in HTML:
- JavaScript code is included in HTML using the
script
tag. - JavaScript can be used to add/remove/change CSS properties, animate elements, and react to user actions.
- JavaScript code is included in HTML using the
jQuery
- jQuery is a JavaScript library that simplifies tasks such as selecting elements, adding new content, hiding and showing content, and modifying tag attributes.
- Benefits of jQuery:
- Small library size (30k compressed)
- Easy to learn
- Used on millions of websites
- Free and open-source
- Large developer community
- Plugins available
- jQuery selectors:
- Basic selectors:
by class name
,by ID name
,by tag name
- Advanced selectors:
descendent
,child
,adjacent sibling
,attribute
- Basic selectors:
- jQuery events:
- Mouse events:
click
,dblclick
,mousedown
, etc. - Document/window events:
load
,resize
,scroll
,unload
, etc. - Form events:
submit
,reset
,change
,focus
,blur
, etc. - Keyboard events:
keypress
,keydown
,keyup
, etc.
- Mouse events:
Ajax
- Ajax is a term that allows JavaScript to communicate with the server without leaving the page.
- What Ajax can do:
- Display new HTML content without reloading the page
- Submit a form and instantly display the result
- Login without leaving the page
- Ajax process:
- Send a request to the server
- Wait for the response
- Process the response
- Update the web page
- jQuery simplifies the Ajax process.
JSON
- JSON is a JavaScript format for exchanging data.
- JSON is a method for exchanging data between JavaScript and the server.
- JSON is quick and easy for JavaScript.
- JSON objects are similar to JavaScript object literals.
- Example of a JSON object:
{
"firstName": "Frank",
"lastName": "Smith",
"phone": "503-555-1212"
}
- jQuery provides a
getJSON
method to retrieve JSON data from the server.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Short notes on WPF commands, including command implementation and built-in commands. Covers topics such as icommand and Application Commands.