Format:
Recent snippets matching tags of binding
SelectedItem="{Binding TheProperty, PresentationTraceSources.TraceLevel=High}"
38 Views
no comments
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib"> <Grid> <Grid.DataContext> <x:Array Type="sys:String"> <sys:String>Red</sys:String> <sys:String>Yellow</sys:String> <sys:String>Blue</sys:String>
180 Views
no comments
<Extension()> _ Public Function GetBindingInfo(ByVal DataLayoutControl As DataLayoutControl, _ Optional ByVal ExcludePropetries As String = "") As List(Of DataLayoutBindingInfo) Dim bh As New LayoutElementsBindingInfoHelper(DataLayoutControl) Dim info As LayoutElementsBindingInfo = bh.CreateDataLayoutElementsBindingInfo GetBindingInfo = (From x As LayoutElementBindingInfo In info.GetAllBindings _ Where (Not x.DataInfo.Name.ToUpper.EqualsAny(ExcludeNames)) _ And (Not x.DataInfo.Name.ToUpper.EqualsAny(ExcludePropetries)) _ Select New DataLayoutBindingInfo(x.DataInfo.Name, x.DataInfo.Caption, x.Visible, x.EditorType)).ToList End Function
329 Views
no comments
/* DataSet myDataSet; Example If you have a common language runtime (CLR) object you would like to bind to from XAML, one way you can make the object available for binding is to define it as a resource and give it an x:Key. In the following example, you have a Person object with a string property named PersonName. The Person object is defined in the namespace called SDKSample. XAML Copy <Window
309 Views
no comments
/// <summary> /// Return all properties from a type up to a specified base type in the inheritance hierarchy /// </summary> /// <param name="type">Type that will be examined</param> /// <param name="baseType">Where to stop in the inheritance hierarchy. Must be a type that first parameter inherits from /// </param> /// <returns>A list of all found properties</returns> public static List<PropertyInfo> GetAllProperties(Type type, Type baseType) { List<PropertyInfo> properties = new List<PropertyInfo>();
336 Views
no comments
public class ListUtils { /// <summary> /// Manual ComboBox binding and adding a first item /// /// Assumes you're binding to an enumerable list of some sort /// and you're binding to Properties (not fields) /// </summary> public static void BindWithFirstItem(IEnumerable items, ComboBox listBox,
766 Views
2 comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
