Skip to content

Commit

Permalink
merge master -> extenders
Browse files Browse the repository at this point in the history
  • Loading branch information
darilek committed May 30, 2016
2 parents ab4193e + 8988883 commit 636bfeb
Show file tree
Hide file tree
Showing 15 changed files with 112 additions and 18 deletions.
2 changes: 2 additions & 0 deletions src/DotVVM.Framework/Controls/CheckableControlBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ protected override void RenderControl(IHtmlWriter writer, IDotvvmRequestContext
}
else if (!string.IsNullOrEmpty(Text))
{
writer.RenderBeginTag("span");
writer.WriteText(Text);
writer.RenderEndTag();
}
else if (!HasOnlyWhiteSpaceContent())
{
Expand Down
49 changes: 41 additions & 8 deletions src/DotVVM.Framework/Controls/GridViewColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,34 @@ public abstract class GridViewColumn : DotvvmBindableObject
{

[MarkupOptions(AllowBinding = false)]
public string HeaderText { get; set; }
public string HeaderText
{
get { return (string)GetValue(HeaderTextProperty); }
set { SetValue(HeaderTextProperty, value); }
}
public static readonly DotvvmProperty HeaderTextProperty
= DotvvmProperty.Register<string, GridViewColumn>(c => c.HeaderText, null);


[MarkupOptions(MappingMode = MappingMode.InnerElement)]
public ITemplate HeaderTemplate { get; set; }
public ITemplate HeaderTemplate
{
get { return (ITemplate)GetValue(HeaderTemplateProperty); }
set { SetValue(HeaderTemplateProperty, value); }
}
public static readonly DotvvmProperty HeaderTemplateProperty
= DotvvmProperty.Register<ITemplate, GridViewColumn>(c => c.HeaderTemplate, null);


[MarkupOptions(MappingMode = MappingMode.InnerElement)]
public ITemplate FilterTemplate { get; set; }
public ITemplate FilterTemplate
{
get { return (ITemplate)GetValue(FilterTemplateProperty); }
set { SetValue(FilterTemplateProperty, value); }
}
public static readonly DotvvmProperty FilterTemplateProperty
= DotvvmProperty.Register<ITemplate, GridViewColumn>(c => c.FilterTemplate, null);


[MarkupOptions(AllowBinding = false)]
public string SortExpression
Expand Down Expand Up @@ -47,8 +68,15 @@ public string SortDescendingHeaderCssClass
DotvvmProperty.Register<string, GridViewColumn>(c => c.SortDescendingHeaderCssClass, "sort-desc");

[MarkupOptions(AllowBinding = false)]
public bool AllowSorting { get; set; }
public bool AllowSorting
{
get { return (bool)GetValue(AllowSortingProperty); }
set { SetValue(AllowSortingProperty, value); }
}
public static readonly DotvvmProperty AllowSortingProperty
= DotvvmProperty.Register<bool, GridViewColumn>(c => c.AllowSorting, false);

[MarkupOptions(AllowBinding = false)]
public string CssClass
{
get { return (string)GetValue(CssClassProperty); }
Expand All @@ -63,12 +91,10 @@ public bool IsEditable
get { return (bool)GetValue(IsEditableProperty); }
set { SetValue(IsEditableProperty, value); }
}

public static readonly DotvvmProperty IsEditableProperty =
DotvvmProperty.Register<bool, GridViewColumn>(t => t.IsEditable, true);



[MarkupOptions(AllowBinding = false)]
public string HeaderCssClass
{
get { return (string)GetValue(HeaderCssClassProperty); }
Expand All @@ -78,7 +104,14 @@ public string HeaderCssClass
DotvvmProperty.Register<string, GridViewColumn>(c => c.HeaderCssClass);

[MarkupOptions(AllowBinding = false)]
public string Width { get; set; }
public string Width
{
get { return (string)GetValue(WidthProperty); }
set { SetValue(WidthProperty, value); }
}
public static readonly DotvvmProperty WidthProperty
= DotvvmProperty.Register<string, GridViewColumn>(c => c.Width, null);



public abstract void CreateControls(IDotvvmRequestContext context, DotvvmControl container);
Expand Down
18 changes: 16 additions & 2 deletions src/DotVVM.Framework/Controls/GridViewTemplateColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,24 @@ public class GridViewTemplateColumn : GridViewColumn
{

[MarkupOptions(AllowBinding = false, MappingMode = MappingMode.InnerElement, Required = true)]
public ITemplate ContentTemplate { get; set; }
public ITemplate ContentTemplate
{
get { return (ITemplate)GetValue(ContentTemplateProperty); }
set { SetValue(ContentTemplateProperty, value); }
}
public static readonly DotvvmProperty ContentTemplateProperty
= DotvvmProperty.Register<ITemplate, GridViewTemplateColumn>(c => c.ContentTemplate, null);


[MarkupOptions(AllowBinding = false, MappingMode = MappingMode.InnerElement)]
public ITemplate EditTemplate { get; set; }
public ITemplate EditTemplate
{
get { return (ITemplate)GetValue(EditTemplateProperty); }
set { SetValue(EditTemplateProperty, value); }
}
public static readonly DotvvmProperty EditTemplateProperty
= DotvvmProperty.Register<ITemplate, GridViewTemplateColumn>(c => c.EditTemplate, null);


public override void CreateControls(IDotvvmRequestContext context, DotvvmControl container)
{
Expand Down
9 changes: 8 additions & 1 deletion src/DotVVM.Framework/Controls/GridViewTextColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ public class GridViewTextColumn : GridViewColumn
/// Gets or sets the format string that will be applied to numeric or date-time values.
/// </summary>
[MarkupOptions(AllowBinding = false)]
public string FormatString { get; set; }
public string FormatString
{
get { return (string)GetValue(FormatStringProperty); }
set { SetValue(FormatStringProperty, value); }
}
public static readonly DotvvmProperty FormatStringProperty
= DotvvmProperty.Register<string, GridViewTextColumn>(c => c.FormatString, null);


/// <summary>
/// Gets or sets the type of value being formatted - Number or DateTime.
Expand Down
18 changes: 16 additions & 2 deletions src/DotVVM.Framework/Controls/IfAuthorized.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,27 @@ public class IfAuthorized : DotvvmControl
/// This is rendered iff user is authorized and has specified roles
/// </summary>
[MarkupOptions(MappingMode = MappingMode.InnerElement)]
public ITemplate Template { get; set; }
public ITemplate Template
{
get { return (ITemplate)GetValue(TemplateProperty); }
set { SetValue(TemplateProperty, value); }
}
public static readonly DotvvmProperty TemplateProperty
= DotvvmProperty.Register<ITemplate, IfAuthorized>(c => c.Template, null);


/// <summary>
/// This is rendered iff user is not logged or does not have specified roles
/// </summary>
[MarkupOptions(MappingMode = MappingMode.InnerElement)]
public ITemplate ElseTemplate { get; set; }
public ITemplate ElseTemplate
{
get { return (ITemplate)GetValue(ElseTemplateProperty); }
set { SetValue(ElseTemplateProperty, value); }
}
public static readonly DotvvmProperty ElseTemplateProperty
= DotvvmProperty.Register<ITemplate, IfAuthorized>(c => c.ElseTemplate, null);


/// <summary>
/// Roles must have to render the template for authorized
Expand Down
3 changes: 2 additions & 1 deletion src/DotVVM.Framework/Controls/InlineScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class InlineScript : DotvvmControl
/// <summary>
/// Gets or sets the comma-separated list of resources that should be loaded before this script is executed.
/// </summary>
[MarkupOptions(AllowBinding = false)]
public string Dependencies
{
get { return (string)GetValue(DependenciesProperty); }
Expand All @@ -28,7 +29,7 @@ public string Dependencies
public static readonly DotvvmProperty DependenciesProperty =
DotvvmProperty.Register<string, InlineScript>(c => c.Dependencies, ResourceConstants.DotvvmResourceName);

[MarkupOptions(MappingMode = MappingMode.InnerElement)]
[MarkupOptions(MappingMode = MappingMode.InnerElement, AllowBinding = false)]
public string Script
{
get { return (string)GetValue(ScriptProperty); }
Expand Down
1 change: 1 addition & 0 deletions src/DotVVM.Framework/Controls/PostBackHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public abstract class PostBackHandler : DotvvmBindableObject
/// <summary>
/// Gets or sets the name of the event which the handler applies to. If this property is not set, it applies to all events.
/// </summary>
[MarkupOptions(AllowBinding = false)]
public string EventName
{
get { return (string)GetValue(EventNameProperty); }
Expand Down
2 changes: 1 addition & 1 deletion src/DotVVM.Framework/Controls/RequiredResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class RequiredResource : DotvvmControl
/// <summary>
/// Gets or sets the name of the resource.
/// </summary>
[MarkupOptions(Required = true)]
[MarkupOptions(Required = true, AllowBinding = false)]
public string Name
{
get { return (string)GetValue(NameProperty); }
Expand Down
1 change: 1 addition & 0 deletions src/DotVVM.Framework/Controls/TextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public bool Enabled
/// <summary>
/// Gets or sets a format of presentation of value to client.
/// </summary>
[MarkupOptions(AllowBinding = false)]
public string FormatString
{
get { return (string)GetValue(FormatStringProperty); }
Expand Down
2 changes: 1 addition & 1 deletion src/DotVVM.Framework/DotVVM.Framework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
<Compile Include="Controls\SelectorItem.cs" />
<Compile Include="Controls\SpaContentPlaceHolder.cs" />
<Compile Include="Controls\TextBoxType.cs" />
<Compile Include="Controls\TextboxValueType.cs" />
<Compile Include="Controls\FormatValueType.cs" />
<Compile Include="Controls\TranslateVirtualPathHtmlAttributeTransformer.cs" />
<Compile Include="Controls\UpdateProgress.cs" />
<Compile Include="Controls\UploadedFilesCollection.cs" />
Expand Down
6 changes: 5 additions & 1 deletion src/DotVVM.Framework/Resources/Scripts/DotVVM.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ namespace DotVVM.Samples.BasicSamples.ViewModels.ControlSamples.CheckBox
{
public class CheckBoxViewModel
{

public string Text { get; set; } = "Label text";

public bool SCB { get; set; }

public string SCBResult { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@
<span> {{value: NumberOfChanges}}</span>
</fieldset>
</div>
<div class="col-md-6">
<fieldset>
<legend>Text binding CheckBox</legend>

<p>
<dot:CheckBox Text="{value: Text}" Checked="{value: SCB}" />
&nbsp; &nbsp;
<dot:Button Text="Postback" Click="{command: UpdateSCB()}" />
&nbsp; &nbsp;
<span>{{value: SCBResult}}</span>
</p>
</fieldset>

</div>
</div>
</div>

Expand Down
2 changes: 2 additions & 0 deletions src/DotVVM.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String></wpf:ResourceDictionary>

0 comments on commit 636bfeb

Please sign in to comment.