Skip to content

Instantly share code, notes, and snippets.

View henninga's full-sized avatar

Henning Anderssen henninga

View GitHub Profile
@henninga
henninga / ContainerView.xaml
Created October 31, 2011 15:05
User control for each item in listbox
<UserControl x:Class="AssetTracker.Views.VersionView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:AssetTracker.UserControls" xmlns:cm="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:Triggers="clr-namespace:AssetTracker.Triggers">
<DockPanel LastChildFill="True">
<local:HyperlinkButton DockPanel.Dock="Top" x:Name="NewLicense" HorizontalAlignment="Right" >
<TextBlock Text="+ Ny lisens" />
</local:HyperlinkButton>
<ListBox x:Name="Licenses"
// Common initialization
var xVal = xVal || {};
xVal.Plugins = xVal.Plugins || {};
xVal.Messages = xVal.Messages || {};
xVal.AttachValidator = function(elementPrefix, rulesConfig, options, pluginName) {
if (pluginName != null)
this.Plugins[pluginName].AttachValidator(elementPrefix, rulesConfig, options);
else
for (var key in this.Plugins) {
this.Plugins[key].AttachValidator(elementPrefix, rulesConfig, options);
xVal.AttachValidator(null,
{
"Fields": [
{
"FieldName": "CompanyCode",
"FieldRules": [
{
"RuleName": "Required",
"RuleParameters": {