Can I add dynamic HTML content to a Frame control ?
The current version displays the HTML content from an URI and it does not display dynamic contents. There is however a ‘Web Browser’ control that is availble as of 3.5SP1.
How to write some XML into IsolatedStorage?
[C#] Stream mystream = new IsolatedStorageFileStream( storeFileName, FileMode.Create, isoStorage ); if( null != mystream ) { XmlTextWriter xmlwriter = new XmlTextWriter(mystream, Encoding.UTF8); this.WriteDateToWriter( xmlwriter ); xmlwriter.Flush(); stream.Close(); }
How can I mark the default value of a custom dependency property to be false?
Here is an example : [C#] public class MyStateControl : ButtonBase { public MyStateControl() : base() { } public Boolean State { get { return (Boolean)this.GetValue(StateProperty); } set { this.SetValue(StateProperty, value); } } public static readonly DependencyProperty StateProperty = DependencyProperty.Register( 'State', typeof(Boolean), typeof(MyStateControl),new PropertyMetadata(false)); }
How can I create Custom Read-Only Dependency Properties ?
The typical reason for specifying a read-only dependency property is that these are the properties that is used to determine the state, but where the state is defined in a multitude of factors. A typical example for a read-only property is IsMouseHover This example shows how to ’register’ an attached property as read-only. You can use dependency properties on any ’DependencyObject’ types. [C#] public static readonly DependencyProperty IsBubbleSourceProperty = DependencyProperty.RegisterReadOnly( 'IsBubbleSource', typeof(Boolean), typeof(AquariumObject), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender) );
How can I enumerate all the descendants of a visual object ?
You can enumerate all the descendants of a visual object as follows : [C#] // Enumerate all the descendants of the visual object. static public void EnumVisual(Visual myVisual) { for (int i = 0; i < VisualTreeHelper.GetChildrenCount(myVisual); i++) { // Retrieve child visual at specified index value. Visual childVisual = (Visual)VisualTreeHelper.GetChild(myVisual, i); // Do processing of the child visual object. // Enumerate children of the child visual object. EnumVisual(childVisual); } }