W miarę przeglądania dokumentacji wyławiam z niej różne mniej pierwszoplanowe informacje. Powstają z tego robocze zapiski, które myślę mogę tutaj również zamieszczać.
WinJS.xhr
At install time, the user sees which capabilities an app asks for, so the app is installed only if the user agrees for it to access those resources.
Windows.Web.Syndication.SyndicationClient
To use WinJS templates, we must reference the bulk of the WinJS CSS and JavaScript files. These files provide the styles and behavior for the data-win-control attribute,
among other things. HTML5 defines the set of data-* attributes that we use for anything app-specific we want to associate with an HTML element. In this case, we declare
a JavaScript constructor function name WinJS.Binding.Template. This constructor gets the associated div so that it can attach itself and provide the necessary behavior.
This is the foundation for declarative controls in WinJS. To cause the data-win-control attributes to be executed, you must call WinJS.UI.processAll, which is an excellent
addition to your onmainwindowactivated event handler.
var template = WinJS.UI.getControl(document.getElementById("template"));
template.render(post).then(function (element) {
// append data to #posts div
posts.appendChild(element);
});
It's easier to edit the template in the HTML than it is to write more and more complicated createElement code as our styling and functionality grow.
But the ListView is much smarter about it, rendering only the template for items that are actually visible.
CSS3 Grid Layout
AsyncOperationWithProgressCompletedHandler in C++ zamiast await
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
Window.Current.Content = new MainPage();
Window.Current.Activate();
}
The XAMLUI framework provides another navigation model that uses Frames and Pages. It also has a navigation history that you can use to go forward and back through pages.
<Frame x:Name="MainFrame" CacheSize="4" />
The cache size is set to 4, so our navigation history will hold the last 4 pages that were visited.
To navigate between pages, we can now use the Frame control's Navigate, GoForward, and GoBack methods.
The Navigate(String, Object) method lets us navigate and pass a data object to the new page.
this.Frame.Navigate("WindowsBlogReader.SplitPage", selectedItem);
The first parameter of the Navigate(String, Object) method is the class name of the page that we're navigating to.
The second parameter is the data object we need to pass to the new page.
For this, we override the Page's OnNavigatedTo method. The NavigationEventArgs.Parameter property has the data object that was passed.
The app bar is hidden by default, and is shown or dismissed when the user swipes a finger from the edge of the screen or interacts with the app.
We can control how and when the app bar is shown and dismissed by setting the IsPersistent, IsOpen, and DismissMode properties.
DismissMode="EdgeSwipe"
We can use built in theme animations and theme transitions in our app to match the ones used in Windows Developer Preview.
A theme animation is a pre-configured animation that we can put inside a Storyboard. Here, we put the PopInThemeAnimation in a Storyboard.
Because the back button and title stay in the same place from page to page, we don't want them to pop in, so we set the target of the animation to be the Border that surrounds our web content.
Sometimes, we can use theme transitions to animate UI elements instead. A theme transition is a complete set of animations and a Storyboard that's essentially a prepackaged behavior that we can attach to a UI element. Here, we use a ContentThemeTransition to animate the blog post title text in SplitPage.xaml.
A ContentThemeTransition is used with a ContentControl, and is automatically triggered when the content of the control changes.
<TextBlock.Transitions>
<TransitionCollection>
<ContentThemeTransition />
</TransitionCollection>
</TextBlock.Transitions>
The DisplayProperties.OrientationChanged event fires when the user rotates a device. The ApplicationLayout.LayoutChanged event fires when the user changes the app between Full, Fill, or Snapped states.
ApplicationLayout.GetForCurrentView().LayoutChanged
DisplayProperties.CurrentOrientation
ApplicationLayout.Value
The splash screen is made up of a background color and an image that's 624 x 304 pixels. We set these values in the Package.appxmanifest file.
You can also extend the splash using the properties and methods of the SplashScreen class.
You can use the SplashScreen class to get the coordinates of the splash screen and use them to place the first page of the app.
And you can find out when the splash screen is dismissed so you know it's time to start any content entrance animations for the app.
c.d.n
Brak komentarzy:
Prześlij komentarz