Allow the user to choose a rating by clicking on a row of stars


∇  xaml←RatingXAML
⍝ XAML for the Rating example
 xaml,←⊂'    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"'
 xaml,←⊂'    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"'
 xaml,←⊂'    xmlns:sftools="clr-namespace:Syncfusion.Windows.Controls.Input;assembly=SyncFusion.SfInput.Wpf"'
 xaml,←⊂'    SizeToContent="WidthAndHeight" >'
 xaml,←⊂'    <StackPanel>'
 xaml,←⊂'        <Label Content="Give a rating to Syncfusion"/>'
 xaml,←⊂'        <sftools:SfRating Name="ranting"/>'
 xaml,←⊂'    </StackPanel>'


∇  z←Rating(items value);⎕IO;⎕ML;xaml;⎕USING;_app
⍝ Simple Rating example
 ⎕IO ⎕ML←0 3
 #.window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncTools')
 window_ranting.(ItemsCount Value)←items value
 _app←⎕NEW Application

No pretence here to understand what's going on with the <Application> stuff - the hint in SyncFusion's documentation is that they show their XAML with <Rating> included in <Page> tags rather than <Window>.  I am indebted to John Daintree for showing the code needed to make this example work.  Be alert that if doing repeated experiments/tests that the <CloseAppDomain> command must be used between repeats.

Unfortunately, it appears impossible to give a zero rating.

The 'SyncTools' argument to #.UTIL.LoadXAML has the effect of adding

 to the ⎕USING list of LoadXAML


       #.Rating.Rating 10 1

Unresolved Issues