Skip to content

Instantly share code, notes, and snippets.

View andersonimes's full-sized avatar

Anderson Imes andersonimes

  • Google
  • Seattle, WA
View GitHub Profile
@andersonimes
andersonimes / gist:645999
Created October 25, 2010 23:18
Determining Design Mode from Attached Properties
private bool IsDesignMode {
get {
DependencyProperty isDesignModeProperty = (DependencyProperty)AppDomain.CurrentDomain.GetData(“IsDesignModeProperty”);
return isDesignModeProperty == null ? false : true.Equals(isDesignModeProperty.GetValue(this));
}
}
<ItemsControl Grid.IsSharedSizeScope="True">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="HeaderedContentControl">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition SharedSizeGroup="Labels" />
<ColumnDefinition SharedSizeGroup="Inputs" />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Header}" />
<ContentControl Grid.Column="1" Content="{Binding Content}" />
@andersonimes
andersonimes / gist:645567
Created October 25, 2010 19:31
Testing posting XAML
<ItemsControl ItemsSource="{Binding StuffThatIsCool}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding WhyCool}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>