Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Phone
Change page: < 1 2 3 4 5 6 7 8 >  |  Displaying page 7 of 8, items 301 to 350 of 376.
Raster Graphics : Becoming a Photo Extras Application
In addition, Posterizer registers itself as a “photos extra” application, which means that it can be invoked by the user from the picture library itself.
Raster Graphics : Saving to the Picture Library
In your program, you create an instance of the MediaLibrary class. The SavedPictures property returns a PictureCollection with a Picture object for each item currently in the Saved Pictures album.
Raster Graphics : Images and Tombstoning
A Windows version appeared in early versions of the Microsoft Windows Software Development Kit (SDK) under the name MUZZLE, where it was the only sample program in the SDK coded in Microsoft Pascal rather than C.
Raster Graphics : Vector Graphics on a Bitmap
You can combine the two approaches of drawing on a WriteableBitmap. The next sample displays a Path on a WriteableBitmap against a gradient that uses transparency so that you can see how the premultiplied alphas work.
Raster Graphics : The Pixel Bits
The Pixels property of WritableBitmap is an array of int, which means that each pixel is 32 bits wide. The Pixels property itself is get-only so you can’t replace the actual array, but you can set and get elements of that array.
Raster Graphics : WriteableBitmap and UIElement
The element argument is of type UIElement and the transform argument is of type Transform. This constructor creates a bitmap based on the size of the UIElement argument as possibly modified by the Transform argument
Raster Graphics - The Bitmap Class Hierarchy
ImageSource has only one descendent class and defines nothing public on its own, so it might seem a little superfluous.
Vector Graphics : The Path Markup Syntax
Silverlight supports a type of “mini-language” that allows you to encode an entire PathGeometry in a string. The language consists of letters (such as M for Move, L for Line, A for Arc, and C for Cubic Bézier) that take the place of PathFigure and PathSegment objects
Vector Graphics : Bézier Curves
The Bézier curve is a spline, which is a type of curve used to approximate discrete data with a smooth continuous function. Silverlight supports the standard two-dimensional form of the cubic Bézier curve but also a quadratic Bézier curve that is somewhat simpler and faster.
Vector Graphics : The Versatile PathGeometry
LineGeometry, RectangleGeometry, EllipseGeometry, GeometryGroup—those are all convenient special cases of PathGeometry, certainly the most versatile of the Geometry derivatives.
Vector Graphics : Grouping Geometries
One of the descendent classes of Geometry is GeometryGroup. This allows you to combine one or more Geometry objects in a composite.
Vector Graphics : Geometries and Transforms
If you’re using EllipseGeometry and you don’t want the axes of the ellipse to be aligned on the horizontal and vertical, you can apply a RotateTransform to it.
Vector Graphics : The Path Element
The Path class defines just one property of its own named Data of type Geometry, but geometries are a very important concept in Silverlight vector graphics
Vector Graphics : Dynamic Polygons
Certain collections will also respond to changes. Collection classes that derive from PresentationFrameworkCollection respond to changes when an object is added to or removed from a collection
Vector Graphics : The Stretch Property
You can probably see why the Stretch property of Shape isn’t used very often in connection with vector graphics, but if you need a particular vector image to fill an area of arbitrary size, it’s a welcome option.
Vector Graphics : Polygon and Fill
If you want the figure to be really closed, you can add another point to the Points collection that is the same as the first point, or you can use a Polygon rather than a Polyline
Vector Graphics : Caps, Joins, and Dashes
The available caps are members of the PenLineCap enumeration: Flat (the default), Square, Round, and Triangle.
Vector Graphics : Polylines and Custom Curves
The Line element looks simple but the markup is a little bloated. You can actually reduce the markup for drawing a single line by switching from the Line to the Polyline
Vector Graphics : Overlapping and ZIndex
If you would prefer that the blue line be on top of the red line, there are two ways you can do it. You could simply swap the order of the two lines in the Grid
Vector Graphics : Canvas and Grid
Coordinates can be negative, but the Grid does not take account of negative coordinates. A negative coordinate will actually be displayed to the left of or above the Grid.
Vector Graphics : The Shapes Library
A Silverlight program that needs to draw vector graphics uses classes defined in the System.Windows.Shapes namespace, commonly referred to as the Shapes library.
Data Bindings : TextBox Binding Updates
The Text property of a TextBox can be a target of a data binding, but some potential problems are introduced. Once you allow the user to type anything into a TextBox, you need to deal with faulty input.
Data Bindings : Give and Take
The two binding services you’ve seen so far simply provide information. You can also create bindings in XAML that deliver data to the binding service and get back a result.
Data Bindings : Converters with Properties
It’s not unreasonable to create a data-binding converter that is so specialized or so weird that it’s only good for one particular application.
Data Bindings : Simple Decision Making
Normally you can do that by formatting the time (if the Clock class actually provided a DateTime object indicating the time) but suppose you want to be very flexible about how you display the AM and PM information—perhaps you’d prefer to display the text “in the morning” or “in the afternoon”—and you want to do it in XAML.
Data Bindings : Setting the DataContext
FrameworkElement defines a property named DataContext that you can set to pretty much any object (in code) or generally a binding (in XAML). The DataContext is one of those properties that propagates down through the visual tree, at which point it can be combined with more local bindings.
Data Bindings : A Simple Binding Server
For example, suppose you want to display the current time in a Windows Phone 7 application, and you want to be fairly flexible about what you display. Perhaps sometimes you only want to display seconds, and you want to do this entirely in XAML.
Data Bindings : Notification Mechanisms
For data bindings to work, the binding source must implement some kind of notification mechanism. This notification mechanism signals when the property value has changed so the new value can be retrieved from the source and transferred to the target.
Data Bindings - The “this” Source
BorderedText derives from UserControl, and UserControl derives from Control, so we know that BorderedText will already have some of these properties through class inheritance.
Data Bindings - Relative Source
The third type of binding is called RelativeSource. In the Windows Presentation Foundation, RelativeSource is much more flexible than the version in Silverlight, so you may not be very impressed with this option.
Data Bindings - Binding Converters
The Converter property of the Binding class is of type IValueConverter, an interface that requires only two methods named Convert and ConvertBack.
Data Bindings : Target and Mode
Bindings have a source and a target. The binding target is considered to be the property on which the binding is set. This property must always be backed by a dependency property
Data Bindings : Source and Target
In a typical data binding, a property of one object is updated automatically from a property of another object.
Dependency Properties - Attached Properties
Notice that the first argument to the PropertyMetadata constructor is explicitly a double so there won’t be a runtime error because the C# compiler assumes the value is an int.
Dependency Properties - Panels with Properties
The Windows Presentation Foundation has a panel I often find useful called UniformGrid. As the name suggests, the UniformGrid divides its area into cells, each of which has the same dimensions.
Dependency Properties - A New Type of Toggle
If you experiment with these controls a bit, you’ll find that you can toggle the switch just by tapping it, but you can also move the larger block back and forth with your finger, although it will tend to snap into position either at the left or right.
Dependency Properties - Deriving from UserControl
Deriving from Control or ContentControl in a proper and cordial manner involves creating a default template in XAML that describes the control’s visual appearance, and allowing that template to be replaced to redefine the visuals of the control.
Dependency Properties - The Dependency Property Difference
What Silverlight providesis an infrastructure to manage all the different ways properties can be set and to impose some kind of order. Dependency properties are a major part of this infrastructure. They’re called dependency properties because the properties depend on a bunch of different external forces, which are then mediated.
Dependency Properties - The Problem Illustrated
Suppose you want to use a bunch of buttons whose foregrounds are colored with various linear gradient brushes, and you figure it would be convenient for you to specify the two colors as properties of the buttons, perhaps properties named Color1 and Color2.
The App Bar and Controls - TextBox and Keyboard Input
The two types of text-entry controls available in Silverlight for Windows Phone are TextBox, which allows typing and editing single-line or multiline plain unformatted text, and PasswordBox, which briefly displays each letter you type but then replaces it with another character, by default an asterisk.
The App Bar and Controls - Buttons and Styles
As a general rule, it makes sense to set TargetType to be the most general class that has all the properties you’re defining in the Style. You can inherit from styles based on derived classes.
The App Bar and Controls - Toggling a Stopwatch
One handy application on a phone is a stopwatch—an ideal use for a ToggleButton as well as the Stopwatch class defined in the System.Diagnostics namespace.
The App Bar and Controls - The Button Hierarchy
Normally the ToggleButton and CheckBox are physical manifestations of a Boolean. They turn on and off with successive clicks. But ToggleButton defines an IsThreeState property that optionally provides a third “indeterminate” state
The App Bar and Controls - Theme Styles and Precedence
Button is defined in the System.Windows library, and that library also contains a default style and template for the Button.
The App Bar and Controls - The Concept of Content
Button derives from Control but it also derives from ContentControl, which is the class that provides the button’s Content property. You can pull out the Content property as a property element
The App Bar and Controls - The Basic Button
It has a simple white border and displays the text string assigned to its Content property. If you put the Button in a horizontal StackPanel, it will be only as wide as it needs to be to fit the content; the opposite effect happens when you switch the StackPanel orientation to Vertical.
The App Bar and Controls - RangeBase and Slider
The RangeBase class defines Minimum, Maximum, SmallChange, and LargeChange properties to define the parameters of scrolling, plus a Value property for the user’s selection and a ValueChanged event that signals when Value has changed.
The App Bar and Controls - Elements and Controls
These derivatives of FrameworkElement include TextBlock, Image, Border, MediaElement, Shape (which is the parent class to Rectangle and Ellipse), and Panel, which is the parent class to Grid, StackPanel, and Canvas.
The App Bar and Controls - Jot and the ApplicationBar
The ApplicatonBar in Jot defines four buttons: for adding a new page, going to the previous page, going to the next page, and deleting the current page.
The App Bar and Controls - Jot and Touch
When the finger first touches the screen (signaled by an Action property of TouchAction.Down), the method creates a new Stroke object. This is added to the Strokes collection of the InkPresenter, and it is re-rendered by InkPresenter with each new point added to it.
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server