Beta 10.7 of C#/XAML for HTML5 released

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Beta 10.7 of C#/XAML for HTML5 released

Postby JS-Support @Userware » Fri Jan 13, 2017 6:20 pm

Dear CSHTML5 users,

We are pleased to inform you that the Beta 10.7 of CSHTML5 is available for download!


Download:
CSharpXamlForHtml5_v1_0_public_beta10_7.zip
(22.7 MiB) Downloaded 636 times


Here is what's new since Beta 10.6:

  • Added support for TextBox validation, including Binding.ValidatesOnExceptions and Binding.NotifyOnValidationError (special thanks to Azzly for sponsoring this feature!)
  • Improved support for importing TypeScript Definitions (still a work-in-progress feature: major improvements are expected in the coming weeks). For more info, please read: http://cshtml5.com/links/importing-typescript-definitions.aspx
  • Added support for Popup.Placement and Popup.PlacementTarget
  • Fixed an issue where programmatically unchecking a checkbox did not work properly
  • Fixed exception when setting FrameworkElement.MaxWidth and MaxHeight

Many more new features to come... stay tuned!


You may also be interested to read:
- What's new in Beta 10.6
- What's new in Beta 10.5
- What's new in Beta 10.4
- What's new in Beta 10.3
- What's new in Beta 10.2
- What's new in Beta 10.1


-------------------------------------------------------------
Example of use of the TextBox validation feature:
-------------------------------------------------------------

The following example shows a form where the user must enter his/her name and age. Both fields are required, and they display an error message if they are invalid. The "OK" button becomes enabled only when both fields are valid.

2017.01.14 - CSHTML5 TextBox Validation Screenshot.png
2017.01.14 - CSHTML5 TextBox Validation Screenshot.png (5.15 KiB) Viewed 7053 times


XAML CODE:

Code: Select all

    <Border x:Name="ValidationBorder">
        <StackPanel Orientation="Vertical" Margin="15">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Your First Name: "/>
                <TextBox x:Name="NameTextBoxForValidation" Text="{Binding Name, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}" BindingValidationError="ValidationBorder_BindingValidationError" HorizontalAlignment="Left" Margin="5,0,0,0" MinWidth="100"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
                <TextBlock Text="Your Age: "/>
                <TextBox x:Name="AgeTextBoxForValidation" Text="{Binding Age, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}" BindingValidationError="ValidationBorder_BindingValidationError" HorizontalAlignment="Left" Margin="5,0,0,0" MinWidth="40"/>
            </StackPanel>
            <Button x:Name="MyButtonForValidation" Content="OK" Click="MyButtonForValidation_Click" HorizontalAlignment="Left" Margin="0,10,0,0"/>
        </StackPanel>
    </Border>

C# CODE:

Code: Select all

public MainPage()
{
    this.InitializeComponent();
   
    // Set the DataContext:
    Person person = new Person();
    ValidationBorder.DataContext = person;
}

private void ValidationBorder_BindingValidationError(object sender, ValidationErrorEventArgs e)
{
    // Enable or disable the "OK" button depending on whether there are any errors:
    if (Validation.GetHasError(NameTextBoxForValidation) || Validation.GetHasError(AgeTextBoxForValidation))
    {
        MyButtonForValidation.IsEnabled = false;
        MyButtonForValidation.Opacity = 0.4;
    }
    else
    {
        MyButtonForValidation.IsEnabled = true;
        MyButtonForValidation.Opacity = 1.0;
    }
}

private void MyButtonForValidation_Click(object sender, RoutedEventArgs e)
{
    Person person = (Person)((Button)sender).DataContext;
    string str = "Your first name is : " + person.Name + Environment.NewLine + "Your age is: " + person.Age + ".";
    System.Windows.MessageBox.Show(str);
}

public class Person : System.ComponentModel.INotifyPropertyChanged
{
    private string _name;
    public string Name
    {
        get { return _name; }
        set
        {
            if (string.IsNullOrWhiteSpace(value))
                throw new Exception("The 'Name' field cannot be empty.");

            _name = value;
            RaisePropertyChanged("Name");
        }
    }

    private int _age;
    public int Age
    {
        get { return _age; }
        set
        {
            if (value <= 0)
                throw new Exception("The 'Age' field must be greater than 0. You must enter a valid age in order to continue.");

            _age = value;
            RaisePropertyChanged("Age");
        }
    }

    private void RaisePropertyChanged(string propertyName)
    {
        PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
    }
    public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
}




Notes about installation:
  • Before installing this update, it is recommended that you close all the open instances of Visual Studio.
  • If for some reason you need to revert to the previous Beta, simply uninstall this one (from the Control Panel) and reinstall the previous Beta.


We hope you will enjoy this build!

If you find any issues, please post them on the forums or send an email to support@cshtml5.com

Thank you.
Regards,
JS-Support

zemorango
Posts: 36
Joined: Tue Feb 02, 2016 6:30 am

Re: New Beta 10.7 released! [Download]

Postby zemorango » Sat Jan 28, 2017 5:40 am

Validation It's a nice feature :) works just like in silverlight , good work :D but What I really need is Calendars an DatePicker, thats the only features that I miss in chtml5, with those features I can finally migrate my silverlight apps ;)

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: New Beta 10.7 released! [Download]

Postby JS-Support @Userware » Sun Jan 29, 2017 4:17 am

Thanks!
zemorango wrote:Calendars an DatePicker, thats the only features that I miss in chtml5, with those features I can finally migrate my silverlight apps ;)

Coming soon with the Kendo UI Core extension, stay tuned! :)


Return to “Pre-Releases, Downloads and Announcements”

Who is online

Users browsing this forum: No registered users and 32 guests